-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FE][Feat] #372 : 드랍다운 개별적으로 동작하도록 수정
- Loading branch information
Showing
8 changed files
with
125 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
frontend/src/component/common/dropdown/DropdownContext.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// DropdownContext.tsx | ||
import { createContext, ReactNode, useState, useMemo } from 'react'; | ||
|
||
export interface IToggleContext { | ||
openDropdownId: string | null; | ||
setOpenDropdownId: (id: string | null) => void; | ||
} | ||
|
||
interface IToggleProviderProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const ToggleContext = createContext<IToggleContext>({ | ||
openDropdownId: null, | ||
setOpenDropdownId: () => {}, | ||
}); | ||
|
||
export const ToggleProvider = ({ children }: IToggleProviderProps) => { | ||
const [openDropdownId, setOpenDropdownId] = useState<string | null>(null); | ||
|
||
const value = useMemo(() => ({ openDropdownId, setOpenDropdownId }), [openDropdownId]); | ||
|
||
return <ToggleContext.Provider value={value}>{children}</ToggleContext.Provider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createContext } from 'react'; | ||
|
||
export const DropdownInstanceContext = createContext<string | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters