Skip to content

Commit

Permalink
feat: 셀 비어있는 버그 픽스
Browse files Browse the repository at this point in the history
  • Loading branch information
JJIIIINN committed Dec 26, 2023
1 parent 5469037 commit 1054574
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/main/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import styled from "styled-components";
import { TabItemType, TabItemInfo } from "../../constants/main";
import { useExcelTypeState } from "../../store/questionState";
import {
useExcelTabTypeState,
useExcelTypeState,
} from "../../store/questionState";
import { excelTypes } from "../../utils/functions/Translation";

interface TabProps {
Expand All @@ -10,6 +13,7 @@ interface TabProps {

const Tab = ({ clickItemInfo, setClickItemInfo }: TabProps) => {
const { setExcelType } = useExcelTypeState();
const { resetExcelTab } = useExcelTabTypeState();
return (
<Container>
{TabItemInfo.map((item, idx) => (
Expand All @@ -18,6 +22,7 @@ const Tab = ({ clickItemInfo, setClickItemInfo }: TabProps) => {
onClick={() => {
setClickItemInfo(item);
setExcelType(excelTypes[item.tabItem]);
resetExcelTab();
}}
key={idx}
>
Expand Down
2 changes: 2 additions & 0 deletions src/store/questionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ export const useExcelDataState = create<excelDataState>()(
interface excelTabTypeState {
excelTab: excelTabType;
setExcelTab: (tab: excelTabType) => void;
resetExcelTab: () => void;
}

export const useExcelTabTypeState = create<excelTabTypeState>()(
devtools((set) => ({
excelTab: "paymentTargetTab",
setExcelTab: (tab: excelTabType) => set({ excelTab: tab }),
resetExcelTab: () => set({ excelTab: "paymentTargetTab" }),
}))
);

0 comments on commit 1054574

Please sign in to comment.