Skip to content

Commit

Permalink
fix: clickedUserNames -> timeSlotUserNames로 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo committed Jun 30, 2024
1 parent f2551ac commit 3ed9465
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/pages/OverallSchedule/contexts/useClickContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Dispatch, SetStateAction, createContext, useContext } from 'react';
interface ClickContextType {
clickedSlot: string | undefined;
setClickedSlot: Dispatch<SetStateAction<ClickContextType['clickedSlot']>>;
clickedUserNames: string[];
setClickedUserNames: Dispatch<SetStateAction<ClickContextType['clickedUserNames']>>;
timeSlotUserNames: string[];
setTimeSlotUserNames: Dispatch<SetStateAction<ClickContextType['timeSlotUserNames']>>;
}

export const ClickContext = createContext<ClickContextType>({
clickedSlot: undefined,
setClickedSlot: () => undefined,
clickedUserNames: [],
setClickedUserNames: () => [],
timeSlotUserNames: [],
setTimeSlotUserNames: () => [],
});

export function useClickContext() {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/OverallSchedule/hooks/useSlotClick.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useClickContext } from '../contexts/useClickContext';

export const useSlotClick = () => {
const { clickedSlot, setClickedSlot, setClickedUserNames } = useClickContext();
const { clickedSlot, setClickedSlot, setTimeSlotUserNames } = useClickContext();

const onClickSlot = (targetSlot: string, targetUserNames: string[]) => {
setClickedSlot(targetSlot);
setClickedUserNames(targetUserNames);
setTimeSlotUserNames(targetUserNames);
};

return { clickedSlot, onClickSlot };
Expand Down

0 comments on commit 3ed9465

Please sign in to comment.