mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Refactored menu buttons.
This commit is contained in:
parent
92d1fddf8b
commit
6319a8c6e0
13 changed files with 114 additions and 119 deletions
|
|
@ -15,6 +15,7 @@ export default function DropDown({
|
|||
}) {
|
||||
const [showMenu, setShowMenu] = useState(false);
|
||||
const ref = useRef();
|
||||
const selectedOption = options.find(e => e.value === value);
|
||||
|
||||
function handleShowMenu() {
|
||||
setShowMenu(state => !state);
|
||||
|
|
@ -40,7 +41,13 @@ export default function DropDown({
|
|||
<Icon icon={<Chevron />} className={styles.icon} size="small" />
|
||||
</div>
|
||||
{showMenu && (
|
||||
<Menu className={menuClassName} options={options} onSelect={handleSelect} float="bottom" />
|
||||
<Menu
|
||||
className={menuClassName}
|
||||
options={options}
|
||||
selectedOption={selectedOption}
|
||||
onSelect={handleSelect}
|
||||
float="bottom"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue