Repository navigation
[Feat/#96] 설정 화면과 전화번호 변경·회원 탈퇴 화면 구현 #97
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
Open
xeoxxn
wants to merge
17
commits into
main
Choose a base branch
from
feat/#96-settings-screens
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
18fe3df
feat: 설정 화면 구현
xeoxxn 77225a2
feat: 알림 설정 화면 구현
xeoxxn 59f1f1a
feat: 전화번호 변경 화면 구현
xeoxxn 0bd0274
feat: 홈 헤더에 설정 진입 버튼 추가
xeoxxn 2fe57f7
docs: 설정 화면에서 확정한 WDS 컴포넌트 매핑 추가
xeoxxn d9ea739
fix: 확인 모달 설명의 줄바꿈이 무시되는 문제 수정
xeoxxn 69a06c6
refactor: 완료 체크 모션을 공용 컴포넌트로 분리
xeoxxn b003a6b
feat: 회원 탈퇴 확인 화면 구현
xeoxxn 0eb4a27
feat: 회원 탈퇴 완료 화면 구현
xeoxxn 255df75
Merge branch 'main' into feat/#96-settings-screens
xeoxxn cd77dfd
refactor: 탈퇴 완료 화면을 공용 ResultScreen 기반으로 변경
xeoxxn 07e15a6
Merge branch 'main' into feat/#96-settings-screens
xeoxxn 318f10a
refactor: 알림 설정 화면을 알림 기능 쪽 한 벌로 통합
xeoxxn 0b4312f
refactor: 설정 화면 경로·이탈 경로를 상수로 빼고 갱신된 Figma 노드 ID 반영
xeoxxn beaec0b
refactor: 설정 화면 리뷰 반영 — 계정 정보를 users 엔티티로, 전화번호 로직을 공용으로
xeoxxn 14d71b1
fix: 주소가 없는 설정 행을 비활성으로 그린다
xeoxxn 6173104
refactor: 외부 링크 여는 처리를 화면 밖으로 분리
xeoxxn 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,15 @@ | ||
| // 설정 화면 계정 정보 카드(Figma 3524:152329)가 보여 주는 내 계정 정보. | ||
| // 용어 사전(terminology.md)의 `사용자 → users` 도메인이다. | ||
| export interface MyAccount { | ||
| name: string; | ||
| email: string; | ||
| /** `010-1234-5678` 형태. 전화번호 변경 화면이 바꾸는 값이다. */ | ||
| phone: string; | ||
| } | ||
|
|
||
| // Figma는 "26.0.1 · 최신버전"처럼 한 줄로 보여 주지만, 버전과 최신 여부는 서버가 내려 주는 | ||
| // 별개 값이라 나눠서 받는다 — 문구 조합은 화면이 한다. | ||
| export interface AppVersion { | ||
| version: string; | ||
| isLatest: 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,17 @@ | ||
| import type { AppVersion, MyAccount } from "@/entities/users/types"; | ||
| import { APP_VERSION, MY_ACCOUNT } from "@/entities/users/usersMock"; | ||
| import { mockupApi } from "@/lib/mockupApi"; | ||
|
|
||
| // 실 API가 붙으면 함수 안쪽만 요청 코드로 바꾼다 — 화면은 이 함수로만 데이터를 받는다. | ||
| // | ||
| // 백엔드 연동 시 확인할 것: 설정 화면은 묶음 이름이고 데이터는 `users` 도메인이라고 보고 | ||
| // 여기에 뒀다(terminology.md에 `settings`는 없다). 엔드포인트가 `/api/users/me`가 아니라 | ||
| // 설정 전용으로 따로 나오면 도메인 폴더와 라우트(`/settings`)를 그때 맞춘다. | ||
| export function fetchMyAccount(): Promise<MyAccount> { | ||
| return mockupApi("users/me", () => MY_ACCOUNT); | ||
| } | ||
|
|
||
| // 앱 버전은 계정과 다른 요청이라 key를 나눈다 — 설정 화면이 둘을 한 카드에 섞어 쓰지 않는다. | ||
| export function fetchAppVersion(): Promise<AppVersion> { | ||
| return mockupApi("users/app-version", () => APP_VERSION); | ||
| } |
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,13 @@ | ||
| import type { AppVersion, MyAccount } from "@/entities/users/types"; | ||
|
|
||
| // Figma 설정 화면(3524:152322)에 적힌 값 그대로. 실 API가 붙으면 이 파일은 사라진다. | ||
| export const MY_ACCOUNT: MyAccount = { | ||
| email: "pog454@kookmin.ac.kr", | ||
| name: "이예담", | ||
| phone: "010-1234-5678", | ||
| }; | ||
|
|
||
| export const APP_VERSION: AppVersion = { | ||
| isLatest: true, | ||
| version: "26.0.1", | ||
| }; |
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
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,120 @@ | ||
| import { | ||
| ActionArea, | ||
| ActionAreaButton, | ||
| TextField, | ||
| TopNavigationButton, | ||
| Typography, | ||
| } from "@wanteddev/wds"; | ||
| import { IconChevronLeft } from "@wanteddev/wds-icon"; | ||
| import { useState } from "react"; | ||
| import { useNavigate } from "react-router-dom"; | ||
|
|
||
| import ScreenHeader from "@/components/ui/ScreenHeader"; | ||
| import ScreenToast from "@/components/ui/ScreenToast"; | ||
| import { useScreenHeader } from "@/components/ui/useScreenHeader"; | ||
| import { | ||
| formatPhoneNumber, | ||
| isValidPhoneNumber, | ||
| PHONE_NUMBER_MAX_LENGTH, | ||
| } from "@/lib/phone"; | ||
|
|
||
| // Figma: 전화번호 변경 (nodeId 3524:152450), 입력 중 (3524:152465), 완료 토스트 (3524:152457). | ||
| // 입력칸은 Figma `Textinput/Textfield`(445:8591, WDS 공식 문서 링크 확인)라 WDS `TextField`를 | ||
| // 그대로 쓴다. 다만 WDS `TextField`는 입력 박스만 그려서, 위 라벨("새 전화번호")과 아래 안내 | ||
| // 문구는 Figma 구조대로 형제 요소로 따로 그린다 — WDS `Label`은 required `*` 처리만 더해주는 | ||
| // Typography 래퍼라 여기선 쓸 이유가 없다(wds-component-usage.md의 행사 신청 폼 선례와 같다). | ||
| // | ||
| // "변경하기" 버튼은 번호를 형식에 맞게 다 입력했을 때만 활성화된다(Figma 비활성 #F4F4F5 / | ||
| // 활성 #0066FF). 높이 56px은 ActionAreaButton 기본(48px)과 달라 sx로 세로 padding만 보정한다. | ||
| // 실제 변경 API가 없어서 누르면 Figma처럼 완료 토스트만 띄운다. | ||
| // | ||
| // 하이픈 포맷과 유효성 판정은 온보딩 연락처 입력(#110)과 같은 로직이라 `lib/phone.ts`에 있다. | ||
| // | ||
| function PhoneChangeScreen() { | ||
| const navigate = useNavigate(); | ||
| const [phone, setPhone] = useState(""); | ||
| const [toastOpen, setToastOpen] = useState(false); | ||
| // 토스트가 떠 있는 중에 다시 저장해도 스크린리더가 재안내하도록 매번 새로 마운트한다 | ||
| // (EventsApplicationScreen·BililgeReturnSection과 같은 패턴). | ||
| const [toastToken, setToastToken] = useState(0); | ||
|
|
||
| useScreenHeader( | ||
| <ScreenHeader | ||
| leading={ | ||
| <TopNavigationButton | ||
| aria-label="뒤로가기" | ||
| onClick={() => navigate(-1)} | ||
| variant="icon" | ||
| > | ||
| <IconChevronLeft /> | ||
| </TopNavigationButton> | ||
| } | ||
| title="전화번호 변경" | ||
| variant="normal" | ||
| />, | ||
| ); | ||
|
|
||
| const handleSave = () => { | ||
| setToastOpen(true); | ||
| setToastToken((token) => token + 1); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="flex h-full flex-col"> | ||
| <div className="flex flex-1 flex-col gap-2 px-5 pt-2"> | ||
| <Typography | ||
| as="label" | ||
| color="semantic.label.neutral" | ||
| htmlFor="phone" | ||
| variant="label1" | ||
| weight="bold" | ||
| > | ||
| 새 전화번호 | ||
| </Typography> | ||
| <TextField | ||
| id="phone" | ||
| inputMode="tel" | ||
| maxLength={PHONE_NUMBER_MAX_LENGTH} | ||
| onChange={(event) => setPhone(formatPhoneNumber(event.target.value))} | ||
| placeholder="010-1234-5678" | ||
| type="tel" | ||
| value={phone} | ||
| /> | ||
| <Typography | ||
| as="p" | ||
| color="semantic.label.alternative" | ||
| variant="caption1" | ||
| weight="regular" | ||
| > | ||
| 행사 신청 시 사용돼요. | ||
| </Typography> | ||
| </div> | ||
|
|
||
| <div className="shrink-0"> | ||
| <ActionArea> | ||
| {/* Figma Main Action은 56px인데 ActionAreaButton(size="large")은 48px이라 세로 padding만 보정 */} | ||
| <ActionAreaButton | ||
| disabled={!isValidPhoneNumber(phone)} | ||
| onClick={handleSave} | ||
| sx={{ paddingBlock: "16px" }} | ||
| > | ||
| 변경하기 | ||
| </ActionAreaButton> | ||
| </ActionArea> | ||
| {/* Figma Action Area(110px)의 버튼 아래 34px 중 WDS가 주는 padding 20px을 뺀 14px을 더한다 | ||
| (EventsApplicationScreen과 같은 보정) */} | ||
| <div className="h-safe-bottom-extra bg-background-elevated-normal sm:h-[14px]" /> | ||
| </div> | ||
|
|
||
| <ScreenToast | ||
| key={toastToken} | ||
| message="전화번호를 변경했어요." | ||
| onOpenChange={setToastOpen} | ||
| open={toastOpen} | ||
| variant="positive" | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default PhoneChangeScreen; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[c]
settings가terminology.md용어 사전에 없는 것 같아서 확인 부탁드립니다! coding-style.md에 "사전에 없는 새 도메인이면 먼저 그 문서에 추가한 뒤 코드에 반영한다"는 규칙이 있어서요. 계정 정보, 전화번호 변경, 탈퇴는 백엔드에서users쪽 엔드포인트일 가능성이 커 보이는데, 라우트와 폴더를settings로 둘지 백엔드와 한번 맞춰보면 좋을 것 같습니다.사소하지만 경로는
/withdraw(동사), 컴포넌트는Withdrawal*(명사)로 형태가 달라서 하나로 맞추면 찾기 편할 것 같아요.