Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Fix ] active 상태, 드롭다운 잘림 수정 #318

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const arrowDownStyle = style({

export const dropdownStyle = style({
transform: "translate(0, 8px)",
position: "absolute",
zIndex: theme.zIndex.top,

paddingTop: "1.6rem",
paddingBottom: "1.6rem",
Expand All @@ -30,3 +32,7 @@ export const textStyle = style({
...theme.font.Caption3_M_12,
color: theme.color.mg2,
});

export const activeStyle = style({
backgroundColor: theme.color.mg5,
});
17 changes: 12 additions & 5 deletions src/view/user/setting/GroupList/StatusDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ import { IcnBtnArrowDown } from "@/asset/svg";
import Dropdown from "@/common/component/Dropdown";
import Menu from "@/common/component/Menu/Menu";
import { handleA11yClick } from "@/common/util/dom";
import { useGroupListDispatch } from "@/view/user/setting/GroupList/GroupListTable/hook";
import {
useGroupListDispatch,
useGroupListState,
} from "@/view/user/setting/GroupList/GroupListTable/hook";
import {
activeStyle,
arrowDownStyle,
dropdownStyle,
textStyle,
triggerButtonStyle,
} from "@/view/user/setting/GroupList/StatusDropdownMenu/index.css";
import StatusIcon from "@/view/user/setting/GroupList/StatusIcon";
import clsx from "clsx";

const statusOptions = [
{ label: "inProgress", icon: <StatusIcon status="inProgress" /> },
Expand All @@ -18,6 +23,7 @@ const statusOptions = [
];
const StatusDropdownMenu = () => {
const dispatch = useGroupListDispatch();
const { filterValue } = useGroupListState();
const handleFilterChange = (status: string) => {
dispatch({
type: "SET_FILTER",
Expand All @@ -37,15 +43,16 @@ const StatusDropdownMenu = () => {
}
renderList={
<Dropdown className={dropdownStyle}>
{statusOptions.map((option) => {
const handleClick = () => handleFilterChange(option.label);
{statusOptions.map(({ label, icon }) => {
const handleClick = () => handleFilterChange(label);
return (
<li
key={option.label}
key={label}
className={clsx(label === filterValue && activeStyle)}
onClick={handleClick}
onKeyDown={handleA11yClick(handleClick)}
>
{option.icon}
{icon}
</li>
);
})}
Expand Down
Loading