mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
Hide label option.
This commit is contained in:
parent
99861487ea
commit
a15dac05d4
@ -16,6 +16,7 @@ function MenuButton({
|
|||||||
menuAlign = 'right',
|
menuAlign = 'right',
|
||||||
onSelect,
|
onSelect,
|
||||||
renderValue,
|
renderValue,
|
||||||
|
hideLabel,
|
||||||
}) {
|
}) {
|
||||||
const [showMenu, setShowMenu] = useState(false);
|
const [showMenu, setShowMenu] = useState(false);
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
@ -44,7 +45,9 @@ function MenuButton({
|
|||||||
onClick={toggleMenu}
|
onClick={toggleMenu}
|
||||||
variant="light"
|
variant="light"
|
||||||
>
|
>
|
||||||
|
{!hideLabel && (
|
||||||
<div className={styles.text}>{renderValue ? renderValue(selectedOption) : value}</div>
|
<div className={styles.text}>{renderValue ? renderValue(selectedOption) : value}</div>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
{showMenu && (
|
{showMenu && (
|
||||||
<Menu
|
<Menu
|
||||||
|
@ -37,8 +37,8 @@ export default function LanguageButton() {
|
|||||||
options={menuOptions}
|
options={menuOptions}
|
||||||
value={locale}
|
value={locale}
|
||||||
menuClassName={styles.menu}
|
menuClassName={styles.menu}
|
||||||
renderValue={option => option?.display}
|
|
||||||
onSelect={handleSelect}
|
onSelect={handleSelect}
|
||||||
|
hideLabel
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user