Skip to content

Commit

Permalink
feat: MenuIcon 컴포넌트 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
hyonun321 committed Nov 27, 2024
1 parent ad80ef8 commit bdeacb3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useUserInfo } from "@stores/useUserStore";
import { menuItemWrapper, imageBox, textBox } from "./MenuButton.style";
import { MenuIcon } from "./components/MenuIcon";

export const MenuButton = () => {
const { name } = useUserInfo();

return (
<>
<button className={menuItemWrapper}>
<div className={imageBox}></div>
<MenuIcon />
<p className={textBox}>{name ?? "Nocta"}</p>
</button>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { css } from "@styled-system/css";

export const iconContainer = css({
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "40px",
height: "40px",
overflow: "hidden",
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import NoctaDayIcon from "@assets/icons/noctaDayIcon.svg?react";
// import { noctaNightIcon } from "@assets/icons/noctaNightIcon.svg";
import { iconContainer } from "./MenuIcon.style";

export const MenuIcon = () => {
// const { isDarkMode } = useThemeStore();

// const [isSystemDark, setIsSystemDark] = useState(() =>
// window.matchMedia('(prefers-color-scheme: dark)').matches
// );

// useEffect(() => {
// const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
// const handleChange = (e: MediaQueryListEvent) => {
// setIsSystemDark(e.matches);
// };

// mediaQuery.addEventListener('change', handleChange);
// return () => mediaQuery.removeEventListener('change', handleChange);
// }, []);

// const currentIcon = (isDarkMode ?? isSystemDark) ? noctaNightIcon : noctaDayIcon;

return (
<div className={iconContainer}>
<NoctaDayIcon />
</div>
);
};

0 comments on commit bdeacb3

Please sign in to comment.