Skip to content

Commit baaa9d3

Browse files
committed
fix ColorHelper stories
1 parent 51c71db commit baaa9d3

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

stories/ColorHelper/Search.tsx

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,11 @@ export function Search(props: Props) {
120120
onContextChange(event.target.value || (undefined as any)),
121121
"value": contextes.length === 1 ? contextes[0] : context ?? ""
122122
}}
123-
>
124-
{[undefined, ...contextes].map(context => (
125-
<option value={context ?? ""} key={context ?? 0}>
126-
{context ?? "No no context selected..."}
127-
</option>
128-
))}
129-
</Select>
123+
options={[undefined, ...contextes].map(context => ({
124+
"value": context ?? "",
125+
"label": context ?? "No context selected..."
126+
}))}
127+
/>
130128
<Select
131129
label={`Filter by color name (${colors.length})`}
132130
disabled={colors.length === 1}
@@ -135,13 +133,11 @@ export function Search(props: Props) {
135133
onColorChange(event.target.value || (undefined as any)),
136134
"value": colors.length === 1 ? colors[0] : color ?? ""
137135
}}
138-
>
139-
{[undefined, ...colors].map(color => (
140-
<option value={color ?? ""} key={color ?? 0}>
141-
{color ?? "No no color selected..."}
142-
</option>
143-
))}
144-
</Select>
136+
options={[undefined, ...colors].map(color => ({
137+
"value": color ?? "",
138+
"label": color ?? "No color selected..."
139+
}))}
140+
/>
145141
<Select
146142
label={`Filter by usage (${usages.length})`}
147143
disabled={usages.length === 1}
@@ -150,13 +146,11 @@ export function Search(props: Props) {
150146
onUsageChange(event.target.value || (undefined as any)),
151147
"value": usages.length === 1 ? usages[0] : usage ?? ""
152148
}}
153-
>
154-
{[undefined, ...usages].map(usage => (
155-
<option value={usage ?? ""} key={usage ?? 0}>
156-
{usage ?? "No usage selected..."}
157-
</option>
158-
))}
159-
</Select>
149+
options={[undefined, ...usages].map(usage => ({
150+
"value": usage ?? "",
151+
"label": usage ?? "No usage selected..."
152+
}))}
153+
/>
160154
</div>
161155
</>
162156
);

0 commit comments

Comments
 (0)