From 14e033b2e97b5f3639b1e6f4972520034a25bd4e Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Tue, 30 Jul 2024 08:36:06 +0900 Subject: [PATCH] [Update] Config Window: Setting Box: DropdownMenu: Adjust design. add arrow icon that can toggle and border-radius. Also change the open dropdown menu function to the toggle function. --- .../components/dropdown_menu/DropdownMenu.jsx | 17 ++++++++++++----- .../dropdown_menu/DropdownMenu.module.scss | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src-ui/windows/config_window/setting_section/setting_box/components/dropdown_menu/DropdownMenu.jsx b/src-ui/windows/config_window/setting_section/setting_box/components/dropdown_menu/DropdownMenu.jsx index 24ac8769..6cc32ff7 100644 --- a/src-ui/windows/config_window/setting_section/setting_box/components/dropdown_menu/DropdownMenu.jsx +++ b/src-ui/windows/config_window/setting_section/setting_box/components/dropdown_menu/DropdownMenu.jsx @@ -1,14 +1,18 @@ import styles from "./DropdownMenu.module.scss"; import clsx from "clsx"; - +import ArrowLeftSvg from "@images/arrow_left.svg?react"; import { useIsOpenedDropdownMenu } from "@store"; export const DropdownMenu = (props) => { const { updateIsOpenedDropdownMenu, currentIsOpenedDropdownMenu } = useIsOpenedDropdownMenu(); - const openDropdownMenu = () => { - updateIsOpenedDropdownMenu(props.dropdown_id); + const toggleDropdownMenu = () => { + if (currentIsOpenedDropdownMenu === props.dropdown_id) { + updateIsOpenedDropdownMenu(""); + } else { + updateIsOpenedDropdownMenu(props.dropdown_id); + } }; const selectValue = (key) => { @@ -27,17 +31,20 @@ export const DropdownMenu = (props) => { [styles["is_loading"]]: (props.state === "loading") ? true : false }); + const arrow_class_names = clsx(styles["arrow_left_svg"], { + [styles["is_opened"]]: (currentIsOpenedDropdownMenu === props.dropdown_id) ? true : false + }); return (
Loading...
:{props.list[props.selected_id]}
} {(props.state === "loading") ? - : null + :