Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit 5c65993

Browse files
authored
Merge pull request #9 from fcollonval/fix-jlab-1x
Fixes retrocompatibility for JLab 1.x
2 parents 60e04a8 + f26d9f1 commit 5c65993

File tree

1 file changed

+40
-19
lines changed

1 file changed

+40
-19
lines changed

src/ToastJupyterLab.tsx

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,49 @@
1-
import * as React from "react";
1+
import { faBell } from "@fortawesome/free-solid-svg-icons/faBell";
2+
import { faCheck } from "@fortawesome/free-solid-svg-icons/faCheck";
3+
import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons/faExclamationCircle";
4+
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons/faExclamationTriangle";
5+
import { faSpinner } from "@fortawesome/free-solid-svg-icons/faSpinner";
26
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
7+
import * as React from "react";
38
import {
4-
faSpinner,
5-
faBell,
6-
faCheck,
7-
faExclamationTriangle,
8-
faExclamationCircle
9-
} from "@fortawesome/free-solid-svg-icons";
10-
import { closeIcon } from "@jupyterlab/ui-components";
11-
import {
9+
ClearWaitingQueueParams,
10+
ToastContainerProps,
1211
ToastContent,
1312
ToastOptions,
14-
UpdateOptions,
13+
ToastTransitionProps,
1514
TypeOptions,
16-
ToastContainerProps,
17-
ClearWaitingQueueParams,
18-
ToastTransitionProps
15+
UpdateOptions
1916
} from "react-toastify";
2017

18+
// import { closeIcon } from "@jupyterlab/ui-components"; // Not available on JLab 1.x #8
19+
const closeIcon: JSX.Element = (
20+
<svg
21+
element-position="center"
22+
height="16px"
23+
viewBox="0 0 24 24"
24+
width="16px"
25+
xmlns="http://www.w3.org/2000/svg"
26+
>
27+
<g
28+
className="jp-icon-none jp-icon-selectable-inverse jp-icon3-hover"
29+
fill="none"
30+
>
31+
<circle cx="12" cy="12" r="11" />
32+
</g>
33+
34+
<g
35+
className="jp-icon3 jp-icon-selectable jp-icon-accent2-hover"
36+
fill="#616161"
37+
>
38+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
39+
</g>
40+
41+
<g className="jp-icon-none jp-icon-busy" fill="none">
42+
<circle cx="12" cy="12" r="7" />
43+
</g>
44+
</svg>
45+
);
46+
2147
export namespace INotification {
2248
export interface IButton {
2349
/**
@@ -494,12 +520,7 @@ namespace Private {
494520
closeToast
495521
}) => (
496522
<i onClick={closeToast}>
497-
<closeIcon.react
498-
className="jp-icon-hover"
499-
elementPosition="center"
500-
height="16px"
501-
width="16px"
502-
/>
523+
<span className="jp-icon-hover">{closeIcon}</span>
503524
</i>
504525
);
505526

0 commit comments

Comments
 (0)