Skip to content

Commit 5486a10

Browse files
workflow icon (#452)
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
1 parent 7e476ef commit 5486a10

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import * as React from 'react'
2+
import styles from './Icons.module.css'
3+
import { SMALL, MEDIUM, LARGE, MAIN_DARK_BLUE } from '../constants'
4+
5+
const WorkflowIcon = ({
6+
color = MAIN_DARK_BLUE,
7+
size = MEDIUM,
8+
disabled = false,
9+
inactive = false
10+
}) => {
11+
let className = `${styles.svgClassName} ` + styles[`${color}`]
12+
if (disabled) {
13+
className += ` ${styles.iconDisabled}`
14+
}
15+
if (inactive) {
16+
className += ` ${styles.iconInactive}`
17+
}
18+
let icon = <></>
19+
20+
switch (size) {
21+
case SMALL:
22+
icon = (
23+
<svg
24+
width={16}
25+
height={16}
26+
viewBox='0 0 16 16'
27+
fill='none'
28+
xmlns='http://www.w3.org/2000/svg'
29+
className={className}
30+
>
31+
<rect x={2} y={2} width={5} height={3} stroke='none' strokeLinejoin='round' />
32+
<path d='M5.5 6.5H10.5V9.5H5.5V6.5Z' stroke='none' strokeLinejoin='round' />
33+
<rect x={9} y={11} width={5} height={3} stroke='none' strokeLinejoin='round' />
34+
<path d='M4 5V7.5C4 8.05228 4.44772 8.5 5 8.5H6M7.5 10V11.5C7.5 12.0523 7.94772 12.5 8.5 12.5H9' stroke='none' />
35+
</svg>
36+
)
37+
break
38+
case MEDIUM:
39+
icon = (
40+
<svg
41+
width={24}
42+
height={24}
43+
viewBox='0 0 24 24'
44+
fill='none'
45+
xmlns='http://www.w3.org/2000/svg'
46+
className={className}
47+
>
48+
<rect x={3} y={3} width={7.5} height={4.5} stroke='none' strokeWidth={1.5} strokeLinejoin='round' />
49+
<path d='M8.25 9.75H15.75V14.25H8.25V9.75Z' stroke='none' strokeWidth={1.5} strokeLinejoin='round' />
50+
<rect x={13.5} y={16.5} width={7.5} height={4.5} stroke='none' strokeWidth={1.5} strokeLinejoin='round' />
51+
<path d='M6 7.5V11.25C6 12.0784 6.67157 12.75 7.5 12.75H9M11.25 15V17.25C11.25 18.0784 11.9216 18.75 12.75 18.75H13.5' stroke='none' strokeWidth={1.5} />
52+
</svg>
53+
)
54+
break
55+
case LARGE:
56+
icon = (
57+
<svg
58+
width={40}
59+
height={40}
60+
viewBox='0 0 40 40'
61+
fill='none'
62+
xmlns='http://www.w3.org/2000/svg'
63+
className={className}
64+
>
65+
<rect x={5} y={5} width={12.5} height={7.5} stroke='none' strokeWidth={2} strokeLinejoin='round' />
66+
<path d='M13.75 16.25H26.25V23.75H13.75V16.25Z' stroke='none' strokeWidth={2} strokeLinejoin='round' />
67+
<rect x={22.5} y={27.5} width={12.5} height={7.5} stroke='none' strokeWidth={2} strokeLinejoin='round' />
68+
<path d='M10 12.5V17.5C10 18.8807 11.1193 20 12.5 20H14M18.75 24V28.75C18.75 30.1307 19.8693 31.25 21.25 31.25H22.5' stroke='none' strokeWidth={2} />
69+
</svg>
70+
)
71+
break
72+
73+
default:
74+
break
75+
}
76+
return icon
77+
}
78+
79+
export default WorkflowIcon

src/components/icons/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ import UserComputerIcon from './UserComputerIcon'
226226
import UserIcon from './UserIcon'
227227
import UserRemoveIcon from './UserRemoveIcon'
228228
import UserRoleIcon from './UserRoleIcon'
229+
import WorkflowIcon from './WorkflowIcon'
229230
import WorkspaceDynamicIcon from './WorkspaceDynamicIcon'
230231
import WorkspaceEmptyIcon from './WorkspaceEmptyIcon'
231232
import WorkspaceFailIcon from './WorkspaceFailIcon'
@@ -465,6 +466,7 @@ export default {
465466
UserIcon,
466467
UserRemoveIcon,
467468
UserRoleIcon,
469+
WorkflowIcon,
468470
WorkspaceDynamicIcon,
469471
WorkspaceEmptyIcon,
470472
WorkspaceFailIcon,

0 commit comments

Comments
 (0)