Skip to content

Commit 3dffe36

Browse files
committed
feat: update empty canvas style
1 parent 1717cff commit 3dffe36

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

packages/studio-components/src/EmptyCanvas/image.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import React from 'react';
22
import { theme } from 'antd';
33

4-
export default () => {
4+
export default ({ style }: { style?: React.CSSProperties }) => {
55
const { token } = theme.useToken();
6-
const stroke = token.colorBgBase;
6+
const stroke = token.colorBgLayout;
77
return (
8-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 915 866" fill="none">
8+
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 915 866" fill="none" style={style}>
99
<path
1010
fillRule="evenodd"
1111
clipRule="evenodd"
1212
d="M552.085 623.067C491.189 655.842 482.589 745.72 418.484 770.756C352.941 796.353 259.359 798.915 226.164 750.352C189.108 696.141 291.287 607.551 265.559 547.035C237.793 481.726 101.961 496.952 88.3682 426.238C76.2288 363.085 150.831 297.41 208.118 248.21C263.376 200.753 332.496 162.372 402.856 156.147C468.399 150.348 511.091 201.87 571.612 216.049C633.101 230.454 738.7 185.557 759.412 239.679C782.973 301.247 654.143 363.856 654.328 432.195C654.506 498.496 794.484 523.038 760.348 586.766C727.485 648.115 617.062 588.097 552.085 623.067Z"
13-
fill={token.colorText}
13+
fill={token.colorBgLayout}
14+
opacity={0.5}
1415
/>
1516
<circle cx="595.876" cy="255.218" r="12.5406" transform="rotate(30 595.876 255.218)" fill={stroke} />
1617
<circle cx="724.312" cy="289.146" r="12.5406" transform="rotate(30 724.312 289.146)" fill={stroke} />

packages/studio-components/src/EmptyCanvas/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ const Empty: React.FunctionComponent<IEmptyProps> = props => {
1818
fontSize: '14px',
1919
height: '100%',
2020
width: '100%',
21-
display: 'flex',
22-
justifyContent: 'center',
23-
alignItems: 'center',
2421
}}
2522
>
26-
<Image />
23+
<Image
24+
style={{
25+
position: 'absolute',
26+
zIndex: 2,
27+
}}
28+
/>
2729
<Typography.Text
2830
type="secondary"
2931
style={{
3032
position: 'absolute',
33+
zIndex: 3,
3134
}}
3235
>
3336
{description}

packages/studio-website/src/layouts/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ export default function StudioLayout() {
4949
});
5050
}
5151
}
52+
const graph_id = Utils.getSearchParams('graph_id');
53+
if (graph_id === 'DRAFT_GRAPH') {
54+
return {
55+
graphs: res,
56+
graphId: 'DRAFT_GRAPH',
57+
};
58+
}
5259
return {
5360
graphs: res,
54-
graphId: (matchGraph && matchGraph.id) || '',
61+
graphId: (matchGraph && matchGraph.id) || 'DRAFT_GRAPH',
5562
};
5663
});
5764
};

0 commit comments

Comments
 (0)