Skip to content

Commit

Permalink
Feat: #118 유저 정보 설정 페이지에 API 호출한 유저 데이터 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonyesol committed Sep 9, 2024
1 parent e5b2c40 commit 63c0c81
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/pages/setting/UserSettingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ import ValidationInput from '@components/common/ValidationInput';
import ProfileImageContainer from '@/components/user/auth-form/ProfileImageContainer';
import LinkContainer from '@/components/user/auth-form/LinkContainer';
import type { EditUserInfoForm } from '@/types/UserType';
import { useReadUserInfo } from '@/hooks/query/useUserInfoQuery';

export default function UserSettingPage() {
const [imageUrl, setImageUrl] = useState(USER_INFO_DUMMY.profileImageUrl);
// TODO: 유저 데이터 불러오기
const { data: userInfoData } = useReadUserInfo();

const [imageUrl, setImageUrl] = useState(userInfoData?.profileImageUrl || '');

const methods = useForm<EditUserInfoForm>({
mode: 'onChange',
defaultValues: {
username: USER_INFO_DUMMY.username,
email: USER_INFO_DUMMY.email,
nickname: USER_INFO_DUMMY.nickname,
bio: USER_INFO_DUMMY.bio,
links: USER_INFO_DUMMY.links,
profileImageUrl: USER_INFO_DUMMY.profileImageUrl,
username: userInfoData?.username,
email: userInfoData?.email,
nickname: userInfoData?.nickname,
bio: userInfoData?.bio,
links: userInfoData?.links,
profileImageUrl: userInfoData?.profileImageUrl,
},
});

Expand Down

0 comments on commit 63c0c81

Please sign in to comment.