Skip to content

Commit f7b3d51

Browse files
committed
feat: add red diagonal line to transparent box
1 parent 2a2279f commit f7b3d51

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/form-fields/color-picker/colorPicker.jsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,36 @@ function ColorPicker({ label, onColorPick, color = '' }) {
4949
onClick={() => setShowPicker(true)}
5050
style={colorButtonStyle}
5151
>
52-
<span
52+
<svg
53+
width="20"
54+
height="20"
5355
style={{
54-
display: 'inline-block',
55-
width: 20,
56-
height: 20,
5756
borderRadius: 2,
5857
border: '1px solid rgba(0,0,0,0.2)',
59-
background: color || 'transparent',
58+
display: 'inline-block',
6059
}}
61-
/>
60+
>
61+
<rect
62+
width="20"
63+
height="20"
64+
fill={color || 'transparent'}
65+
/>
66+
{!color && (
67+
<line
68+
x1="0"
69+
y1="0"
70+
x2="20"
71+
y2="20"
72+
stroke="red"
73+
strokeWidth="1"
74+
/>
75+
)}
76+
</svg>
6277
<span style={{ flex: 1, textAlign: 'left', fontSize: 14 }}>
6378
{color || i18n.t('No color selected')}
6479
</span>
6580
{showPicker ? <IconChevronUp16 /> : <IconChevronDown16 />}
6681
</button>
67-
6882
{color && (
6983
<Button
7084
type="button"

0 commit comments

Comments
 (0)