Skip to content

Commit

Permalink
fix: do not use font-weight: 500 for "simplistic" selects, those with…
Browse files Browse the repository at this point in the history
… no item descriptions
  • Loading branch information
starpit committed Nov 21, 2022
1 parent c133c93 commit dc2c137
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion plugins/plugin-codeflare/src/components/Ask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,15 @@ export default class AskUI extends React.PureComponent<Props, State> {
children: mkOptions(),
}

// is every message the same as the title?
const isSimplistic = ask.prompt.choices.every(
(_) => _.name === stripAnsi(_.message).replace(" ◄ you selected this last time", "")
)

return (
<React.Fragment>
<span id={titleId} hidden />
{this.card(ask, <Select {...props} />)}
{this.card(ask, <Select {...props} data-is-simplistic={isSimplistic || undefined} />)}
</React.Fragment>
)
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/plugin-codeflare/web/scss/components/Ask/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ $max-width: 50rem;
max-width: $max-width;
}

.pf-c-select__menu-item-main {
.pf-c-select__menu:not([data-is-simplistic]) .pf-c-select__menu-item-main {
font-weight: 500;
}
.pf-c-select__menu-item-main {
white-space: normal;
}
}
Expand Down

0 comments on commit dc2c137

Please sign in to comment.