feat: migrate query input components#3555
Conversation
hehe, I like the compressed one for sure. Also with long queries, the long dropdowns are taking up unnecessary space. What do you all think? |
Yeah! In fact I've been trying to reduce the sizes and add the colors but fluent doesn't support that. There's actually no way to reduce the size of the dropdown |
Merged it in. It is good to go. |
| placeholder='Select method' | ||
| value={sampleQuery.selectedVerb} | ||
| className={classes.smallDropdown} | ||
| onOptionSelect={(event, data) => { |
There was a problem hiding this comment.
You can use the button slot to style the dropdown value color to match the badge colors
| onOptionSelect={(event, data) => { | |
| button={{ style: { color: selectedBadgeColor } }} | |
| onOptionSelect={(event, data) => { |
then define the selected badge color as
const selectedMethod = sampleQuery.selectedVerb; const selectedBadgeColor = getStyleFor(selectedMethod);
Then update the getStyleFor method to use v9 tokens
export function getStyleFor(method: string) {
method = method?.toUpperCase();
const styles: Record<string, string> = {
GET: tokens.colorBrandBackground,
POST: tokens.colorStatusSuccessForeground1,
PUT: tokens.colorStatusWarningForeground2,
PATCH: tokens.colorStatusWarningForeground3,
DELETE: tokens.colorStatusDangerForeground1
};
return styles[method] || tokens.colorNeutralForeground1;
}
|









Overview
fixes #3550
fixes #3551
Demo
Optional. Screenshots,
curlexamples, etc.Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions