Skip to content

Commit

Permalink
Merge pull request #99 from fcollonval/fcollonval/issue98
Browse files Browse the repository at this point in the history
Add dashboard icon
  • Loading branch information
hbcarlos authored Mar 23, 2021
2 parents 772c11b + 321484d commit 0d729c9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { NotebookPanel, INotebookModel } from '@jupyterlab/notebook';

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

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

import { CommandRegistry } from '@lumino/commands';

import { IDisposable } from '@lumino/disposable';

import { dashboardIcon } from '../../icons';

const VOILA_ICON_CLASS = 'jp-MaterialIcon jp-VoilaIcon';

/**
Expand All @@ -33,7 +33,7 @@ export class EditorButton
createNew(panel: NotebookPanel): IDisposable {
const button = new ToolbarButton({
tooltip: 'Open with Voilà GridStack',
icon: editIcon,
icon: dashboardIcon,
onClick: () => {
this._commands.execute('docmanager:open', {
path: panel.context.path,
Expand Down
9 changes: 9 additions & 0 deletions packages/jupyterlab-gridstack/src/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { LabIcon } from '@jupyterlab/ui-components';

// icon svg import statements
import pullRequest from '../style/icons/dashboard.svg';

export const dashboardIcon = new LabIcon({
name: '@voila-dashboards/jupyterlab-gridstack:icon-dashboard',
svgstr: pullRequest
});
13 changes: 13 additions & 0 deletions packages/jupyterlab-gridstack/src/svg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

// including this file in a package allows for the use of import statements
// with svg files. Example: `import xSvg from 'path/xSvg.svg'`

// for use with raw-loader in Webpack.
// The svg will be imported as a raw string

declare module '*.svg' {
const value: string;
export default value;
}
8 changes: 8 additions & 0 deletions packages/jupyterlab-gridstack/style/icons/dashboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0d729c9

Please sign in to comment.