-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Refactor/#106] Navigation 공통 컴포넌트 리팩토링
- Loading branch information
Showing
6 changed files
with
97 additions
and
100 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
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,9 @@ | ||
import { headerAtom } from "@stores/header"; | ||
import { useAtom } from "jotai"; | ||
|
||
export const useHeader = () => { | ||
//여기서 header는 header 설정을 위해 필요한 속성들을 담은 객체. | ||
const [header, setHeader] = useAtom(headerAtom); | ||
|
||
return { header, setHeader }; | ||
}; |
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,5 @@ | ||
import { NAVIGATION_STATE } from "@constants/navigationState"; | ||
import { HeaderProps } from "@typings/headerType"; | ||
import { atom } from "jotai"; | ||
|
||
export const headerAtom = atom<HeaderProps>({ headerStyle: NAVIGATION_STATE.ICON_TITLE_SUB_TEXT }); |
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,9 @@ | ||
import { NavigationState } from "@constants/navigationState"; | ||
|
||
export interface HeaderProps { | ||
headerStyle: NavigationState; | ||
title?: string; | ||
subText?: string; | ||
leftOnClick?: () => void; | ||
rightOnClick?: () => void; | ||
} |