-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#56] 사장님 스토어 계정 및 스토어 정보 수정 페이지 생성 #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,49 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
| import { Header, Icon } from "@compasser/design-system"; | ||
|
|
||
| interface SettingMenuItemProps { | ||
| label: string; | ||
| onClick: () => void; | ||
| } | ||
|
|
||
| function SettingMenuItem({ label, onClick }: SettingMenuItemProps) { | ||
| return ( | ||
| <button | ||
| type="button" | ||
| onClick={onClick} | ||
| className="flex w-full items-center justify-between border-b border-gray-200 px-[1.6rem] py-[1.6rem] text-left" | ||
| > | ||
| <span className="body1-r text-default">{label}</span> | ||
| <Icon | ||
| name="NextButton" | ||
| width={20} | ||
| height={20} | ||
| ariaHidden={false} | ||
| /> | ||
| </button> | ||
| ); | ||
| } | ||
|
|
||
| export default function MyPageSettingsPage() { | ||
| const router = useRouter(); | ||
|
|
||
| return ( | ||
| <div className="flex min-h-dvh flex-col bg-white"> | ||
| <Header variant="center-title-shadow" title="설정" /> | ||
|
|
||
| <div className="flex flex-col"> | ||
| <SettingMenuItem | ||
| label="스토어 정보 수정" | ||
| onClick={() => router.push("/mypage/store-info")} | ||
| /> | ||
|
|
||
| <SettingMenuItem | ||
| label="내 스토어 계정" | ||
| onClick={() => router.push("/mypage/store-account")} | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
66 changes: 66 additions & 0 deletions
66
apps/owner/src/app/(tabs)/mypage/store-account/_components/ConfirmActionModal.tsx
This file contains hidden or 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,66 @@ | ||
| "use client"; | ||
|
|
||
| import { Button, Modal } from "@compasser/design-system"; | ||
| import type { ConfirmActionModalProps } from "../_types/confirmAction"; | ||
|
|
||
| export const ConfirmActionModal = ({ | ||
| open, | ||
| title, | ||
| cancelText, | ||
| confirmText, | ||
| cancelVariant = "gray", | ||
| confirmVariant = "primary", | ||
| onClose, | ||
| onConfirm, | ||
| reverseButtons = false, | ||
| }: ConfirmActionModalProps) => { | ||
| const cancelButton = ( | ||
| <Button | ||
| size="sm" | ||
| variant={cancelVariant} | ||
| fullWidth={false} | ||
| className="px-[2.2rem]" | ||
| onClick={onClose} | ||
| > | ||
| {cancelText} | ||
| </Button> | ||
| ); | ||
|
|
||
| const confirmButton = ( | ||
| <Button | ||
| size="sm" | ||
| variant={confirmVariant} | ||
| fullWidth={false} | ||
| className="px-[2.2rem]" | ||
| onClick={onConfirm} | ||
| > | ||
| {confirmText} | ||
| </Button> | ||
| ); | ||
|
|
||
| return ( | ||
| <Modal | ||
| open={open} | ||
| onClose={onClose} | ||
| variant="confirm" | ||
| title={title} | ||
| bodyClassName="mt-0" | ||
| footerClassName="mt-[2rem]" | ||
| footer={ | ||
| <div className="flex items-center justify-center gap-[1.2rem]"> | ||
| {reverseButtons ? ( | ||
| <> | ||
| {confirmButton} | ||
| {cancelButton} | ||
| </> | ||
| ) : ( | ||
| <> | ||
| {cancelButton} | ||
| {confirmButton} | ||
| </> | ||
| )} | ||
| </div> | ||
| } | ||
| /> | ||
| ); | ||
| }; |
89 changes: 89 additions & 0 deletions
89
apps/owner/src/app/(tabs)/mypage/store-account/_components/OwnerAccountCard.tsx
This file contains hidden or 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,89 @@ | ||
| "use client"; | ||
|
|
||
| import { useState } from "react"; | ||
| import { Card } from "@compasser/design-system"; | ||
| import { ConfirmActionModal } from "./ConfirmActionModal"; | ||
|
|
||
| export const OwnerAccountCard = () => { | ||
| const [isLogoutModalOpen, setIsLogoutModalOpen] = useState(false); | ||
| const [isWithdrawModalOpen, setIsWithdrawModalOpen] = useState(false); | ||
|
|
||
| const handleOpenLogoutModal = () => { | ||
| setIsLogoutModalOpen(true); | ||
| }; | ||
|
|
||
| const handleCloseLogoutModal = () => { | ||
| setIsLogoutModalOpen(false); | ||
| }; | ||
|
|
||
| const handleOpenWithdrawModal = () => { | ||
| setIsWithdrawModalOpen(true); | ||
| }; | ||
|
|
||
| const handleCloseWithdrawModal = () => { | ||
| setIsWithdrawModalOpen(false); | ||
| }; | ||
|
|
||
| const handleLogout = () => { | ||
| console.log("로그아웃"); | ||
| setIsLogoutModalOpen(false); | ||
| }; | ||
|
|
||
| const handleWithdraw = () => { | ||
| console.log("회원탈퇴"); | ||
| setIsWithdrawModalOpen(false); | ||
| }; | ||
skyblue1232 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <> | ||
| <Card variant="gray-200-elevated"> | ||
| <div> | ||
| <p className="body1-m text-primary">내 스토어 계정</p> | ||
|
|
||
| <div className="mt-[0.8rem] border-t border-gray-200 px-[1rem] py-[1rem]"> | ||
| <div className="flex flex-col items-start gap-[1.2rem]"> | ||
| <button | ||
| type="button" | ||
| onClick={handleOpenLogoutModal} | ||
| className="body2-r text-default" | ||
| > | ||
| 로그아웃 | ||
| </button> | ||
|
|
||
| <button | ||
| type="button" | ||
| onClick={handleOpenWithdrawModal} | ||
| className="body2-r text-default" | ||
| > | ||
| 회원탈퇴 | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
|
|
||
| <ConfirmActionModal | ||
| open={isLogoutModalOpen} | ||
| title="로그아웃하시겠습니까?" | ||
| cancelText="그만두기" | ||
| confirmText="로그아웃" | ||
| cancelVariant="gray" | ||
| confirmVariant="primary" | ||
| onClose={handleCloseLogoutModal} | ||
| onConfirm={handleLogout} | ||
| /> | ||
|
|
||
| <ConfirmActionModal | ||
| open={isWithdrawModalOpen} | ||
| title="탈퇴하시겠습니까?" | ||
| cancelText="그만두기" | ||
| confirmText="탈퇴하기" | ||
| cancelVariant="gray" | ||
| confirmVariant="secondary" | ||
| onClose={handleCloseWithdrawModal} | ||
| onConfirm={handleWithdraw} | ||
| reverseButtons={true} | ||
| /> | ||
| </> | ||
| ); | ||
| }; | ||
20 changes: 20 additions & 0 deletions
20
apps/owner/src/app/(tabs)/mypage/store-account/_components/OwnerBusinessNumberCard.tsx
This file contains hidden or 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,20 @@ | ||
| "use client"; | ||
|
|
||
| import { Card } from "@compasser/design-system"; | ||
|
|
||
| export const OwnerBusinessNumberCard = () => { | ||
| return ( | ||
| <Card variant="gray-200-elevated"> | ||
| <div> | ||
| <p className="body1-m text-primary">내 사업자 등록번호</p> | ||
|
|
||
| <div className="mt-[0.8rem] border-t border-gray-200 py-[1rem]"> | ||
| <div className="flex items-center justify-between"> | ||
| <span className="body2-r text-default">사업자 등록번호</span> | ||
| <span className="body2-r text-gray-600">123-45-67890</span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
| ); | ||
| }; |
26 changes: 26 additions & 0 deletions
26
apps/owner/src/app/(tabs)/mypage/store-account/_components/OwnerProfileSection.tsx
This file contains hidden or 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,26 @@ | ||
| "use client"; | ||
|
|
||
| import { Icon } from "@compasser/design-system"; | ||
|
|
||
| export const OwnerProfileSection = () => { | ||
| return ( | ||
| <section className="bg-background px-[1.6rem] py-[3.2rem]"> | ||
| <div className="flex items-start"> | ||
| <div className="shrink-0"> | ||
| <Icon | ||
| name="ProfileCharacter" | ||
| width={80} | ||
| height={80} | ||
| ariaHidden={true} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="ml-[0.8rem] min-w-0 body1-m text-default"> | ||
| <p>홍길동</p> | ||
| <p>루키사장</p> | ||
| <p>owner@example.com</p> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; |
52 changes: 52 additions & 0 deletions
52
apps/owner/src/app/(tabs)/mypage/store-account/_components/OwnerStoreAccountInfoCard.tsx
This file contains hidden or 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,52 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
| import { Card, Icon } from "@compasser/design-system"; | ||
|
|
||
| export const OwnerStoreAccountInfoCard = () => { | ||
| const router = useRouter(); | ||
|
|
||
| const handleMoveStoreInfoPage = () => { | ||
| router.push("/mypage/store-info"); | ||
| }; | ||
|
|
||
| return ( | ||
| <Card variant="gray-200-elevated"> | ||
| <div> | ||
| <div className="flex items-center justify-between"> | ||
| <p className="body1-m text-primary">내 계좌 정보</p> | ||
|
|
||
| <button | ||
| type="button" | ||
| onClick={handleMoveStoreInfoPage} | ||
| className="flex items-center gap-[0.2rem] text-gray-600" | ||
| > | ||
| <span className="body2-m text-gray-600">수정하기</span> | ||
| <Icon | ||
| name="NextButton" | ||
| width={16} | ||
| height={16} | ||
| ariaHidden={true} | ||
| /> | ||
| </button> | ||
| </div> | ||
|
|
||
| <div className="mt-[0.8rem] border-t border-gray-200 py-[1rem]"> | ||
| <div className="flex flex-col gap-[1.2rem]"> | ||
| <div className="flex items-center justify-between"> | ||
| <span className="body2-r text-default">은행명</span> | ||
| <span className="body2-r text-gray-600">국민은행</span> | ||
| </div> | ||
|
|
||
| <div className="flex items-center justify-between"> | ||
| <span className="body2-r text-default">계좌번호</span> | ||
| <span className="body2-r text-gray-600"> | ||
| 123-456-789012 | ||
| </span> | ||
skyblue1232 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
| ); | ||
| }; | ||
11 changes: 11 additions & 0 deletions
11
apps/owner/src/app/(tabs)/mypage/store-account/_types/confirmAction.ts
This file contains hidden or 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 @@ | ||
| export interface ConfirmActionModalProps { | ||
| open: boolean; | ||
| title: string; | ||
| cancelText: string; | ||
| confirmText: string; | ||
| cancelVariant?: "gray" | "primary" | "secondary"; | ||
| confirmVariant?: "gray" | "primary" | "secondary"; | ||
| onClose: () => void; | ||
| onConfirm: () => void; | ||
| reverseButtons?: boolean; | ||
| } |
This file contains hidden or 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,32 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
| import { Header } from "@compasser/design-system"; | ||
| import { OwnerAccountCard } from "./_components/OwnerAccountCard"; | ||
| import { OwnerBusinessNumberCard } from "./_components/OwnerBusinessNumberCard"; | ||
| import { OwnerProfileSection } from "./_components/OwnerProfileSection"; | ||
| import { OwnerStoreAccountInfoCard } from "./_components/OwnerStoreAccountInfoCard"; | ||
|
|
||
| export default function StoreAccountPage() { | ||
| const router = useRouter(); | ||
|
|
||
| return ( | ||
| <main className="flex min-h-dvh flex-col bg-white"> | ||
| <Header | ||
| variant="back-title" | ||
| title="내 스토어 계정" | ||
| onBackClick={() => router.back()} | ||
| /> | ||
|
|
||
| <OwnerProfileSection /> | ||
|
|
||
| <section className="flex-1 bg-white px-[1.75rem] pt-[3.2rem] pb-[3.2rem]"> | ||
| <div className="flex flex-col gap-[2rem]"> | ||
| <OwnerAccountCard /> | ||
| <OwnerStoreAccountInfoCard /> | ||
| <OwnerBusinessNumberCard /> | ||
| </div> | ||
| </section> | ||
| </main> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.