-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
주민증 생성 boadring페이지, 주민증이 없는 경우 마이페이지에 접근했을 때 처리 (#260)
* refactor: 주민증 생성 boadring페이지에 뒤로가기 버튼 * feat: checkIdCardServer * feat: CreateIdCardButton * refactor: MyPage 주민증이 없는 경우 마이페이지에 접근했을 때 처리 * refactor: EmptyPlanet에서 PlanetCreationButton 분리
- Loading branch information
1 parent
03ef3f7
commit 4a28344
Showing
8 changed files
with
138 additions
and
91 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
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
31 changes: 31 additions & 0 deletions
31
src/modules/CreateIdCardButton/CreateIdCardButton.client.tsx
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,31 @@ | ||
'use client'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
import { PlusIcon } from '~/components/Icon'; | ||
import { useCommunityStore } from '~/stores/community.store'; | ||
|
||
export const CreateIdCardButton = () => { | ||
const { communityId } = useCommunityStore(); | ||
const router = useRouter(); | ||
|
||
// TODO: communityId가 없는 경우 에러 처리가 필요해요( ex. 홈이나 다른 페이지로 보내기) | ||
const onClickCreateIdCardButton = () => { | ||
router.replace(`/planet/${communityId}/id-card/create`); | ||
}; | ||
return ( | ||
<div> | ||
<h1 className="text-h3 text-grey-800">내 주민증</h1> | ||
<div className="mt-16pxr flex h-[404px] w-full items-center justify-center rounded-[16px] border border-dashed border-primary-500 bg-blue-100"> | ||
<div className="flex flex-col items-center gap-8pxr"> | ||
<button | ||
onClick={onClickCreateIdCardButton} | ||
className="flex h-[52px] w-[52px] items-center justify-center rounded-full bg-blue-200" | ||
> | ||
<PlusIcon className="fill-primary-500 stroke-2" /> | ||
</button> | ||
<span className="text-b1 text-primary-500">주민증 만들기</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
17 changes: 17 additions & 0 deletions
17
src/modules/CreateIdCardButton/CreateIdCardButton.stories.tsx
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,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { CreateIdCardButton } from './index'; | ||
|
||
const meta: Meta<typeof CreateIdCardButton> = { | ||
title: 'modules/CreateIdCardButton', | ||
component: CreateIdCardButton, | ||
args: {}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof CreateIdCardButton>; | ||
|
||
export const Primary: Story = { | ||
render: () => <CreateIdCardButton />, | ||
}; |
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 @@ | ||
export * from './CreateIdCardButton.client'; |
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