Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button } from "@/components";
import Link from "next/link";

interface ProfileProps {
userName: string;
Expand All @@ -16,7 +17,9 @@ const MyPageProfile = ({ userName, email }: ProfileProps) => {
<span className="truncate text-body2-regular text-layout-body-default">{email}</span>
</div>
</div>
<Button variant="outlined"> 프로필 수정 </Button>
<Button as={Link} href="/mypage/profile" variant="outlined">
프로필 수정
</Button>
</div>
);
};
Expand Down
1 change: 0 additions & 1 deletion src/app/(route)/mypage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { MyPageIconNav, MyPageMenuSection, MyPageProfile } from "./_components";
import { MYPAGE_MENU_LIST } from "./_constants/MYPAGE_MENU_LIST";

const page = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { InputText, Button, Icon } from "@/components";

const MypageProfileForm = () => {
const profileImgURL = "";

const handleSubmitMypageProfile = () => {
// TODO(수현): 폼 제출 함수 추가 예정
};

return (
<form onSubmit={handleSubmitMypageProfile} className="flex h-dvh w-full flex-col">
<div className="flex justify-center py-[30px]">
<div className="relative h-[80px] w-[80px]">
{profileImgURL ? (
<img
src={profileImgURL}
alt="프로필 이미지"
className="h-[80px] w-[80px] rounded-full"
/>
Comment on lines +15 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image 컴포넌트가 아닌, img 태그로 사용하신 이유가 있으실까요?
따로 없다면, Image 컴포넌트가 좋을 것 같아요. 나중에 변경하실때 확인해주시면 좋을것 같아요

) : (
<Icon name="UserProfile" size={80} />
)}
{/* TODO(수현): 디자인 토큰 변경 요청 해놓은 상태로 등록 시 추후 변경 */}
<button
className="absolute left-[52px] top-[52px] h-[28px] w-[28px] rounded-full bg-[#f5f5f5] flex-center"
aria-label="프로필 이미지 변경 버튼"
>
<Icon name="CameraBorder" size={16} />
</button>
</div>
</div>

<div className="flex w-full flex-col gap-5 p-5">
<InputText
name="nickname"
label="닉네임"
// TODO(수현): 기존 닉네임이 placeholder로 들어갈 예정
placeholder="기존 닉네임 표기"
rule="2~10자, 특수문자/금칙어 제한"
maxLength={10}
validation={{
required: true,
maxLength: 10,
}}
>
중복 확인
</InputText>
</div>

<div className="sticky bottom-0 mt-auto h-[88px] w-full border-t border-divider-default bg-white px-4 py-3">
<Button type="submit" variant="auth" ariaLabel="설정완료 버튼">
설정 완료
</Button>
</div>
</form>
);
};

export default MypageProfileForm;
1 change: 1 addition & 0 deletions src/app/(route)/mypage/profile/_components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as MypageProfileForm } from "./MypageProfileForm/MypageProfileForm";
31 changes: 31 additions & 0 deletions src/app/(route)/mypage/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client";

import { DetailHeader } from "@/components";
import { FormProvider, useForm } from "react-hook-form";
import { Suspense } from "react";
import { MypageProfileForm } from "./_components";

interface MypageProfileFormType {
profile: string;
nickname: string;
email: string;
emailAuth: number;
}

const page = () => {
const methods = useForm<MypageProfileFormType>({
mode: "onChange",
reValidateMode: "onChange",
});

return (
<Suspense fallback="">
<DetailHeader title="프로필 설정" />
<FormProvider {...methods}>
<MypageProfileForm />
</FormProvider>
</Suspense>
);
};

export default page;
3 changes: 3 additions & 0 deletions src/assets/camera-border.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/user-profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/common/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ export { default as AlertNewChat } from "@/assets/alert-new-chat.svg";
export { default as AlertNewComment } from "@/assets/alert-new-comment.svg";
export { default as AlertStar } from "@/assets/alert-star.svg";
export { default as AlertUnreadChat } from "@/assets/alert-unread-chat.svg";
export { default as UserProfile } from "@/assets/user-profile.svg";
export { default as CameraBorder } from "@/assets/camera-border.svg";