Skip to content

Commit 670b8e4

Browse files
committed
Refactor cell-metadata and status icons into functional components
Signed-off-by: amaly <amaly@users.noreply.github.com>
1 parent 1d8d872 commit 670b8e4

16 files changed

Lines changed: 1402 additions & 1408 deletions

labextension/src/icons/statusRunning.tsx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,35 @@
1515
import * as React from 'react';
1616
// import { CSSProperties } from 'jss/css';
1717

18-
export default class StatusRunning extends React.Component<{ style: any }> {
19-
public render(): JSX.Element {
20-
const { style } = this.props;
21-
return (
22-
<svg
23-
width={style.width as string}
24-
height={style.height as string}
25-
viewBox="0 0 18 18"
18+
export default function StatusRunning({
19+
style,
20+
}: {
21+
style: React.CSSProperties;
22+
}): React.ReactNode {
23+
return (
24+
<svg
25+
width={style.width as string}
26+
height={style.height as string}
27+
viewBox="0 0 18 18"
28+
>
29+
<g
30+
transform="translate(-450, -307)"
31+
fill={style.color as string}
32+
fillRule="nonzero"
2633
>
27-
<g
28-
transform="translate(-450, -307)"
29-
fill={style.color as string}
30-
fillRule="nonzero"
31-
>
32-
<g transform="translate(450, 266)">
33-
<g transform="translate(0, 41)">
34-
<path
35-
d="M9,4 C6.23857143,4 4,6.23857143 4,9 C4,11.7614286 6.23857143,14 9,14
34+
<g transform="translate(450, 266)">
35+
<g transform="translate(0, 41)">
36+
<path
37+
d="M9,4 C6.23857143,4 4,6.23857143 4,9 C4,11.7614286 6.23857143,14 9,14
3638
C11.7614286,14 14,11.7614286 14,9 C14,8.40214643 13.8950716,7.8288007
3739
13.702626,7.29737398 L15.2180703,5.78192967 C15.7177126,6.74539838
3840
16,7.83973264 16,9 C16,12.866 12.866,16 9,16 C5.134,16 2,12.866 2,9 C2,5.134
3941
5.134,2 9,2 C10.933,2 12.683,2.7835 13.94975,4.05025 L12.7677679,5.23223214
4042
L9,9 L9,4 Z"
41-
/>
42-
</g>
43+
/>
4344
</g>
4445
</g>
45-
</svg>
46-
);
47-
}
46+
</g>
47+
</svg>
48+
);
4849
}

labextension/src/icons/statusTerminated.tsx

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,34 @@
1414

1515
import * as React from 'react';
1616
// import { CSSProperties } from 'jss/css';
17-
export default class StatusTerminated extends React.Component<{ style: any }> {
18-
public render(): JSX.Element {
19-
const { style } = this.props;
20-
return (
21-
<svg
22-
width={style.width as string}
23-
height={style.height as string}
24-
viewBox="0 0 18 18"
25-
>
26-
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
27-
<g>
28-
<polygon points="0 0 18 0 18 18 0 18" />
29-
<path
30-
d="M8.9925,1.5 C4.8525,1.5 1.5,4.86 1.5,9 C1.5,13.14 4.8525,16.5 8.9925,16.5
17+
export default function StatusTerminated({
18+
style,
19+
}: {
20+
style: React.CSSProperties;
21+
}): React.ReactNode {
22+
return (
23+
<svg
24+
width={style.width as string}
25+
height={style.height as string}
26+
viewBox="0 0 18 18"
27+
>
28+
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
29+
<g>
30+
<polygon points="0 0 18 0 18 18 0 18" />
31+
<path
32+
d="M8.9925,1.5 C4.8525,1.5 1.5,4.86 1.5,9 C1.5,13.14 4.8525,16.5 8.9925,16.5
3133
C13.14,16.5 16.5,13.14 16.5,9 C16.5,4.86 13.14,1.5 8.9925,1.5 Z M9,15 C5.685,15
3234
3,12.315 3,9 C3,5.685 5.685,3 9,3 C12.315,3 15,5.685 15,9 C15,12.315 12.315,15 9,15 Z"
33-
fill={style.color as string}
34-
fillRule="nonzero"
35-
/>
36-
<polygon
37-
fill={style.color as string}
38-
fillRule="nonzero"
39-
points="6 6 12 6 12 12 6 12"
40-
/>
41-
</g>
35+
fill={style.color as string}
36+
fillRule="nonzero"
37+
/>
38+
<polygon
39+
fill={style.color as string}
40+
fillRule="nonzero"
41+
points="6 6 12 6 12 12 6 12"
42+
/>
4243
</g>
43-
</svg>
44-
);
45-
}
44+
</g>
45+
</svg>
46+
);
4647
}

labextension/src/widgets/LeftPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import * as React from 'react';
1616
import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
1717
import NotebookUtils from '../lib/NotebookUtils';
18-
import { InlineCellsMetadata } from './cell-metadata/InlineCellMetadata';
18+
import { InlineCellsMetadata } from './cell-metadata/InlineCellsMetadata';
1919
import { SplitDeployButton } from '../components/DeployButton';
2020
import { Kernel } from '@jupyterlab/services';
2121
import { ExperimentInput } from '../components/ExperimentInput';

0 commit comments

Comments
 (0)