Skip to content

Commit

Permalink
Hide label option.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Nov 4, 2021
1 parent 9986148 commit a15dac0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/common/MenuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function MenuButton({
menuAlign = 'right',
onSelect,
renderValue,
hideLabel,
}) {
const [showMenu, setShowMenu] = useState(false);
const ref = useRef();
Expand Down Expand Up @@ -44,7 +45,9 @@ function MenuButton({
onClick={toggleMenu}
variant="light"
>
<div className={styles.text}>{renderValue ? renderValue(selectedOption) : value}</div>
{!hideLabel && (
<div className={styles.text}>{renderValue ? renderValue(selectedOption) : value}</div>
)}
</Button>
{showMenu && (
<Menu
Expand Down
2 changes: 1 addition & 1 deletion components/settings/LanguageButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default function LanguageButton() {
options={menuOptions}
value={locale}
menuClassName={styles.menu}
renderValue={option => option?.display}
onSelect={handleSelect}
hideLabel
/>
);
}

0 comments on commit a15dac0

Please sign in to comment.