Skip to content

Commit

Permalink
Merge pull request #133 from Mogazoa-team20/feat/myPage
Browse files Browse the repository at this point in the history
프로필수정시 기본 값 제공 (이미지제외)
  • Loading branch information
yeeZinu authored Jun 24, 2024
2 parents 21d023f + 57cad80 commit 1bf469f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ import cn from "@/utils/classNames";
import { CLOSE_ICON } from "@/utils/constant";
import styles from "./MyProfileButton.module.scss";

type MyProfileButtonProps = {
Iimage: string;
Inickname: string;
Idescription: string;
};

type UserFormValue = {
description: string;
nickname: string;
image: File;
croppedImage: Blob;
};

export default function MyProfileButton() {
export default function MyProfileButton({ Iimage, Inickname, Idescription }: MyProfileButtonProps) {
const queryClient = useQueryClient();
const { data: session } = useSession();
const accessToken = session?.accessToken ?? "";
Expand Down Expand Up @@ -95,7 +101,6 @@ export default function MyProfileButton() {
}
return "저장하기";
};
console.log("입력상태", isValid);

return (
<div className={cn(styles.container)}>
Expand All @@ -109,6 +114,7 @@ export default function MyProfileButton() {
>
<ImageUpload
name='image'
defaultImage={Iimage}
cropFiledName='croppedImage'
setValue={setValue}
register={register}
Expand All @@ -123,14 +129,15 @@ export default function MyProfileButton() {
}}
errors={errors}
type='text'
placeholder='닉네임을 입력해주세요.'
defaultValue={Inickname}
maxLength={10}
className={cn(styles.profileInput)}
/>
<TextArea
name='description'
rows={5}
control={control}
defaultValue={Idescription}
rules={{
required: "자기 소개글은 필수 입력입니다.",
minLength: { value: 1, message: "최소 1자 이상 적어주세요." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
justify-content: space-between;
width: 184px;

:hover {
cursor: pointer;
}

div {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -93,7 +97,7 @@
}
}

.followButton{
.followButton {
display: flex;
align-items: center;
justify-content: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ export default function UserInfo({
</div>
</div>
{Number(userId) === loginUser ? (
<MyProfileButton />
<MyProfileButton
Iimage={image}
Inickname={nickname}
Idescription={description}
/>
) : (
<div className={styles.followButton}>
{isfollow ? (
Expand Down

0 comments on commit 1bf469f

Please sign in to comment.