-
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(volunteer): 마이페이지 ui 추가 * fix(volunteer): 봉사자 마이페이지 정보 조회 api 타입 수정 * feat(volunteer): 봉사자의 마이정보조회 useQuery 훅 추가 * feat(volunteer): 봉사자 마이페이지 msw 연결 * fix(volunteer): 계정정보조회 fetch 훅을 useFetchMyVolunteer hook으로 변경 * remove(volunteer): useFetchAccount hook 삭제
- Loading branch information
Showing
5 changed files
with
67 additions
and
46 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,11 @@ | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { getMyVolunteerInfo } from '@/apis/volunteer'; | ||
|
||
const useFetchMyVolunteer = () => | ||
useSuspenseQuery({ | ||
queryKey: ['myVolunteer'], | ||
queryFn: async () => (await getMyVolunteerInfo()).data, | ||
}); | ||
|
||
export default useFetchMyVolunteer; |
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,46 @@ | ||
import { Box, Divider, Highlight } from '@chakra-ui/react'; | ||
import Label from 'shared/components/Label'; | ||
import ProfileInfo from 'shared/components/ProfileInfo'; | ||
import Tabs from 'shared/components/Tabs'; | ||
|
||
import useFetchMyVolunteer from './_hooks/useFetchMyVolunteer'; | ||
|
||
export default function MyPage() { | ||
return <h1>MyPage</h1>; | ||
const { data } = useFetchMyVolunteer(); | ||
|
||
return ( | ||
<Box> | ||
<ProfileInfo | ||
infoImage={data.volunteerImageUrl} | ||
infoTitle={data.volunteerName} | ||
infoTexts={[data.volunteerEmail, data.volunteerPhoneNumber]} | ||
> | ||
<Label labelTitle={`${data.volunteerTemperature}℃`} /> | ||
</ProfileInfo> | ||
<Divider /> | ||
<Box | ||
textAlign="center" | ||
fontWeight={500} | ||
border="1px solid" | ||
borderColor="gray.200" | ||
borderRadius={10} | ||
m={4} | ||
mb={25} | ||
py={3} | ||
> | ||
<Highlight | ||
query={`${data.completedVolunteerCount}회`} | ||
styles={{ color: 'orange.400', fontWeight: 600 }} | ||
> | ||
{`김프롱 님께서는 봉사를 ${data.completedVolunteerCount}회 완료했어요!`} | ||
</Highlight> | ||
</Box> | ||
<Tabs | ||
tabs={[ | ||
['신청한 봉사 목록', <Box key={1} minH={500} />], | ||
['작성한 봉사 후기', <Box key={2} minH={500} />], | ||
]} | ||
/> | ||
</Box> | ||
); | ||
} |
32 changes: 0 additions & 32 deletions
32
apps/volunteer/src/pages/settings/account/_hooks/useFetchAccount.ts
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