Skip to content

Commit

Permalink
[FE] FEAT: DisplayStyleCard 및 DisplayStyleCard container 에 props 받아지도…
Browse files Browse the repository at this point in the history
…록 수정
  • Loading branch information
gykoh42 committed Sep 10, 2024
1 parent 05459aa commit e4e88ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const DisplayStyleCardContainer = () => {

return (
<DisplayStyleCard
displayStyleToggle={toggleType}
handleDisplayStyleButtonClick={handleDisplayStyleButtonClick}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ interface IToggleItemSeparated {
icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;
}

interface DisplayStyleCardProps {
handleDisplayStyleButtonClick: (key: DisplayStyleToggleType) => void;
}

const toggleList: IToggleItemSeparated[] = [
{
name: "라이트",
Expand All @@ -33,13 +37,16 @@ const toggleList: IToggleItemSeparated[] = [
},
];

const DisplayStyleCard = () => {
const DisplayStyleCard: React.FC<DisplayStyleCardProps> = ({
handleDisplayStyleButtonClick,
}) => {
const [displayStyleToggle, setDisplayStyleToggle] =
useRecoilState(displayStyleState);

const handleButtonClick = (key: DisplayStyleToggleType) => {
localStorage.setItem("display-style-toggle", key);
setDisplayStyleToggle(key);
handleDisplayStyleButtonClick(key);
};

return (
Expand Down

0 comments on commit e4e88ce

Please sign in to comment.