-
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.
feat: 공통 header 기능 개발 및 layout 컴포넌트 리팩토링 (#54)
* refactor(shared): useLayout hook 을 usePageType hook 으로 변경 * refactor(shared): layout 컴포넌트에서 appType 을 prop 으로 받도록 수정 * feat(shared): headerTitle 상수 추가 * refactor(shared): pageType 에서 headerType 제거 * refactor(shared): getHeaderType 및 getHeaderTitle 함수 로직 변경 * remove(shared): header 관련 Prop 제거 * refactor(shared): useBottomNavBar hook 리팩토링 * feat(shared): defaultHeader custom hook 개발 * feat(shared): detailHeader custom hook 개발 * feat(shared): searchHeader 개발 * fix(shared): useHeader hook 에서는 headerType 상태만 관리하도록 변경 * fix(shared): packages/shared import 경로 수정 * refactor(shelter): 보호소 앱 router 리팩토링 * refactor(volunteer): 봉사자 앱 router 리팩토링 * refactor(shared): shared layout 관련 로직에서 appType, pageType 상수를 적극적으로 사용하도록 수정 * fix(shared): 누락된 봉사자 앱 설정 페이지 추가 * chore(shared): shared 에 zustand 의존성 추가 * feat(shared): searchHeader store 기능 개발 * feat(shared): searchHeader 컴포넌트 onChange, onSubmit 이벤트와 search header store 연결 * fix(shared): bottomNavBar 함수이름 오타 수정 * fix(shelter): 보호동물 수정 페이지 id 오타 수정 * feat(shared): optionMenu 컴포넌트 개발 * feat(shared): detail header store 기능 추가 * refactor(shared): searchHeaderStore 이름 변경 * fix(shared): optionMenuProps 의 children 중복 definition 제거 * refactor(shared): searchHeader 의 handleChangeKeyword 함수 리팩토링 * refactor(shared): detailHeaderStore 에 DeleteFunction 타입 추가 * refactor(shared): searchHeaderStore 에 SearchFunction 타입 추가 * refactor(shelter): animalsSearchPage 디렉토리 이름 수정 * feat(shared): searchHeaderStore 와 SearchPage 연결 * feat(shared): detailHeaderStore 와 DetailPage 연결
- Loading branch information
Showing
32 changed files
with
721 additions
and
377 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import { useEffect } from 'react'; | ||
import useDetailHeaderStore from 'shared/store/detailHeaderStore'; | ||
|
||
const handleDeletePost = (postId: number) => { | ||
// TODO: AnimalPost delete API 호출 | ||
console.log('[Delete Animal] postId:', postId); | ||
}; | ||
|
||
export default function AnimalsDetailPage() { | ||
const setOnDelete = useDetailHeaderStore((state) => state.setOnDelete); | ||
|
||
useEffect(() => { | ||
setOnDelete(handleDeletePost); | ||
|
||
return () => { | ||
setOnDelete(() => {}); | ||
}; | ||
}, [setOnDelete]); | ||
|
||
return <h1>AnimalsDetailPage</h1>; | ||
} |
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,21 @@ | ||
import { useEffect } from 'react'; | ||
import useSearchHeaderStore from 'shared/store/searchHeaderStore'; | ||
|
||
const handleSearchkeyword = (keyword: string) => { | ||
// TODO: AnimalList 검색 API 호출 | ||
console.log('[Search Animal] - keyword:', keyword); | ||
}; | ||
|
||
export default function AnimalsSearchPage() { | ||
const setOnSearch = useSearchHeaderStore((state) => state.setOnSearch); | ||
|
||
useEffect(() => { | ||
setOnSearch(handleSearchkeyword); | ||
|
||
return () => { | ||
setOnSearch(() => {}); | ||
}; | ||
}, [setOnSearch]); | ||
|
||
return <h1>AnimalsSearchPage</h1>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import { useEffect } from 'react'; | ||
import useDetailHeaderStore from 'shared/store/detailHeaderStore'; | ||
|
||
const handleDeletePost = (postId: number) => { | ||
// TODO: VolunteerPost delete API 호출 | ||
console.log('[Delete Volunteer] postId:', postId); | ||
}; | ||
|
||
export default function VolunteersDetailPage() { | ||
const setOnDelete = useDetailHeaderStore((state) => state.setOnDelete); | ||
|
||
useEffect(() => { | ||
setOnDelete(handleDeletePost); | ||
|
||
return () => { | ||
setOnDelete(() => {}); | ||
}; | ||
}, [setOnDelete]); | ||
|
||
return <h1>VolunteersDetailPage</h1>; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import { useEffect } from 'react'; | ||
import useSearchHeaderStore from 'shared/store/searchHeaderStore'; | ||
|
||
const handleSearchkeyword = (keyword: string) => { | ||
// TODO: VolunteerList 검색 API 호출 | ||
console.log('[Search Volunteer] keyword:', keyword); | ||
}; | ||
|
||
export default function VolunteersSearchPage() { | ||
const setOnSearch = useSearchHeaderStore((state) => state.setOnSearch); | ||
|
||
useEffect(() => { | ||
setOnSearch(handleSearchkeyword); | ||
|
||
return () => { | ||
setOnSearch(() => {}); | ||
}; | ||
}, [setOnSearch]); | ||
|
||
return <h1>VolunteersSearchPage</h1>; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import { useEffect } from 'react'; | ||
import useSearchHeaderStore from 'shared/store/searchHeaderStore'; | ||
|
||
const handleSearchkeyword = (keyword: string) => { | ||
// TODO: VolunteerList 검색 API 호출 | ||
console.log('[Search Volunteer] keyword:', keyword); | ||
}; | ||
|
||
export default function VolunteersSearchPage() { | ||
const setOnSearch = useSearchHeaderStore((state) => state.setOnSearch); | ||
|
||
useEffect(() => { | ||
setOnSearch(handleSearchkeyword); | ||
|
||
return () => { | ||
setOnSearch(() => {}); | ||
}; | ||
}, [setOnSearch]); | ||
|
||
return <h1>VolunteersSearchPage</h1>; | ||
} |
Oops, something went wrong.