File tree Expand file tree Collapse file tree 3 files changed +84
-1
lines changed
src/workflow-editor/nodes Expand file tree Collapse file tree 3 files changed +84
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { PlusOutlined } from "@ant-design/icons"
2
+ import { memo } from "react"
3
+ import { styled } from "styled-components"
4
+
5
+ const AddButtonBox = styled . div `
6
+ width: 240px;
7
+ display: -webkit-inline-box;
8
+ display: -ms-inline-flexbox;
9
+ display: inline-flex;
10
+ -ms-flex-negative: 0;
11
+ flex-shrink: 0;
12
+ -webkit-box-flex: 1;
13
+ -ms-flex-positive: 1;
14
+ position: relative;
15
+ &:before {
16
+ content: "";
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ z-index: -1;
23
+ margin: auto;
24
+ width: 2px;
25
+ height: 100%;
26
+ background-color: #cacaca
27
+ }
28
+ `
29
+
30
+ const Button = styled . div `
31
+ user-select: none;
32
+ width: 240px;
33
+ padding: 20px 0 32px;
34
+ display: flex;
35
+ -webkit-box-pack: center;
36
+ justify-content: center;
37
+ flex-shrink: 0;
38
+ -webkit-box-flex: 1;
39
+ flex-grow: 1;
40
+ .btn {
41
+ //display: flex;
42
+ //justify-content: center;
43
+ //align-items: center;
44
+ padding-left: 4.5px;
45
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1);
46
+ width: 30px;
47
+ height: 30px;
48
+ background: #3296fa;
49
+ border-radius: 50%;
50
+ position: relative;
51
+ border: none;
52
+ line-height: 28px;
53
+ -webkit-transition: all .3s cubic-bezier(.645, .045, .355, 1);
54
+ transition: all .3s cubic-bezier(.645, .045, .355, 1);
55
+ cursor: pointer;
56
+ color:#fff;
57
+ font-size: 20px;
58
+ &:hover {
59
+ transform: scale(1.3);
60
+ box-shadow: 0 13px 27px 0 rgba(0, 0, 0, .1)
61
+ }
62
+ &:active {
63
+ transform: none;
64
+ background: #1e83e9;
65
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1)
66
+ }
67
+ }
68
+ `
69
+
70
+ export const AddButton = memo ( ( ) => {
71
+ return (
72
+ < AddButtonBox className = "add-node-button-box" >
73
+ < Button >
74
+ < div className = "btn" >
75
+ < PlusOutlined />
76
+ </ div >
77
+ </ Button >
78
+ </ AddButtonBox >
79
+ )
80
+ } )
Original file line number Diff line number Diff line change 1
1
import { memo } from "react"
2
2
import { useStartNode } from "../../hooks/useStartNode"
3
3
import { NodeContent , NodeTitle , NodeWrap , NodeWrapBox } from "../styled"
4
+ import { AddButton } from "../AddButton"
4
5
5
6
export const StartNode = memo ( ( ) => {
6
7
const { startNode } = useStartNode ( )
@@ -14,6 +15,7 @@ export const StartNode = memo(() => {
14
15
所有人
15
16
</ NodeContent >
16
17
</ NodeWrapBox >
18
+ < AddButton />
17
19
</ NodeWrap >
18
20
)
19
21
} )
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ export const NodeWrapBox = styled.div`
19
19
width: 220px;
20
20
min-height: 72px;
21
21
flex-shrink: 0;
22
- background: #fff;
22
+ background: ${ props => props . theme . token ?. colorBgContainer } ;
23
+ border: solid ${ props => props . theme . mode === "dark" ? "1px" : 0 } ${ props => props . theme ?. token ?. colorBorder } ;
23
24
border-radius: 4px;
24
25
cursor: pointer;
25
26
&:after{
You can’t perform that action at this time.
0 commit comments