Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Dec 27, 2019
1 parent bc433b7 commit 4c31686
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 45 deletions.
5 changes: 2 additions & 3 deletions packages/apputils-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { URLExt } from '@jupyterlab/coreutils';

import { IStateDB, StateDB } from '@jupyterlab/statedb';

import { defaultIconRegistry } from '@jupyterlab/ui-components';
import { jupyterFaviconIcon } from '@jupyterlab/ui-components';

import { PromiseDelegate } from '@lumino/coreutils';

Expand Down Expand Up @@ -149,8 +149,7 @@ const splash: JupyterFrontEndPlugin<ISplashScreen> = {
galaxy.id = 'galaxy';
logo.id = 'main-logo';

defaultIconRegistry.icon({
name: 'jupyter-favicon',
jupyterFaviconIcon.element({
container: logo,
center: true,
kind: 'splash'
Expand Down
16 changes: 5 additions & 11 deletions packages/filebrowser/src/crumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { ArrayExt } from '@lumino/algorithm';

import { Message } from '@lumino/messaging';

import { IDragEvent } from '@lumino/dragdrop';

import { ElementExt } from '@lumino/domutils';

import { IDragEvent } from '@lumino/dragdrop';

import { Widget } from '@lumino/widgets';

import { DOMUtils, showErrorMessage } from '@jupyterlab/apputils';

import { PathExt, PageConfig } from '@jupyterlab/coreutils';
import { PageConfig, PathExt } from '@jupyterlab/coreutils';

import { renameFile } from '@jupyterlab/docmanager';

import { defaultIconRegistry } from '@jupyterlab/ui-components';
import { folderIcon } from '@jupyterlab/ui-components';

import { FileBrowserModel } from './model';

Expand All @@ -31,11 +31,6 @@ const MATERIAL_CLASS = 'jp-MaterialIcon';
*/
const BREADCRUMB_CLASS = 'jp-BreadCrumbs';

/**
* The class name for the folder icon for the breadcrumbs home
*/
const BREADCRUMB_HOME = 'jp-FolderIcon';

/**
* The class name for the breadcrumbs home node
*/
Expand Down Expand Up @@ -363,8 +358,7 @@ namespace Private {
*/
export function createCrumbs(): ReadonlyArray<HTMLElement> {
let home = document.createElement('span');
defaultIconRegistry.icon({
name: BREADCRUMB_HOME,
folderIcon.element({
className: BREADCRUMB_HOME_CLASS,
container: home,
kind: 'breadCrumb'
Expand Down
13 changes: 11 additions & 2 deletions packages/filebrowser/src/listing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1812,11 +1812,20 @@ export namespace DirListing {
const text = DOMUtils.findElement(node, ITEM_TEXT_CLASS);
const modified = DOMUtils.findElement(node, ITEM_MODIFIED_CLASS);

let icon = fileType?.iconRenderer ? fileType.iconRenderer : (fileType?.iconClass ? JLIcon.get(fileType.iconClass) : fileIcon);
let icon = fileType?.iconRenderer
? fileType.iconRenderer
: fileType?.iconClass
? JLIcon.get(fileType.iconClass)
: fileIcon;
let iconClass = classes(ITEM_ICON_CLASS, fileType?.iconClass);

// render the icon svg node
icon.element({className: iconClass, container: iconContainer, center: true, kind: 'listing'});
icon.element({
className: iconClass,
container: iconContainer,
center: true,
kind: 'listing'
});

let hoverText = 'Name: ' + model.name;
// add file size to pop up if its available
Expand Down
45 changes: 16 additions & 29 deletions packages/launcher/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import {
VDomRenderer
} from '@jupyterlab/apputils';

import {
classes,
DefaultIconReact,
defaultIconRegistry
} from '@jupyterlab/ui-components';
import { classes, JLIcon } from '@jupyterlab/ui-components';

import {
ArrayExt,
Expand Down Expand Up @@ -203,20 +199,15 @@ export class Launcher extends VDomRenderer<LauncherModel> {
section = (
<div className="jp-Launcher-section" key={cat}>
<div className="jp-Launcher-sectionHeader">
{kernel && defaultIconRegistry.contains(iconClass) ? (
<DefaultIconReact
{kernel && (
<JLIcon.getReact
name={iconClass}
className={''}
center={true}
kind={'launcherSection'}
/>
) : (
<div
className={classes(
iconClass,
'jp-Launcher-sectionIcon',
'jp-Launcher-icon'
)}
center={true}
kind="launcherSection"
/>
)}
<h2 className="jp-Launcher-sectionTitle">{cat}</h2>
Expand Down Expand Up @@ -415,7 +406,6 @@ function Card(
};

// Return the VDOM element.
const iconClass = kernel ? '' : commands.iconClass(command, args);
return (
<div
className="jp-LauncherCard"
Expand All @@ -426,27 +416,24 @@ function Card(
data-category={item.category || 'Other'}
key={Private.keyProperty.get(item)}
>
{kernel ? (
<div className="jp-LauncherCard-icon">
{item.kernelIconUrl ? (
<div className="jp-LauncherCard-icon">
{kernel ? (
item.kernelIconUrl ? (
<img src={item.kernelIconUrl} className="jp-Launcher-kernelIcon" />
) : (
<div className="jp-LauncherCard-noKernelIcon">
{label[0].toUpperCase()}
</div>
)}
</div>
) : (
<div className="jp-LauncherCard-icon">
<DefaultIconReact
name={`${iconClass} jp-Launcher-icon`}
className={''}
fallback={true}
)
) : (
<JLIcon.getReact
name={commands.iconClass(command, args)}
className="jp-Launcher-icon"
center={true}
kind={'launcherCard'}
kind="launcherCard"
/>
</div>
)}
)}
</div>
<div className="jp-LauncherCard-label" title={title}>
<p>{label}</p>
</div>
Expand Down

0 comments on commit 4c31686

Please sign in to comment.