Skip to content
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

[FE] 유저 닉네임 수정 레이아웃 구현 및 API 연동 #225

Merged
merged 9 commits into from
Nov 28, 2024

Conversation

dongree
Copy link
Collaborator

@dongree dongree commented Nov 28, 2024

✅ 주요 작업

  • 유저 닉네임 수정 레이아웃 구현
  • 유저 닉네임 수정 API 연동

💭 고민과 해결과정

유저 닉네임이 수정되었을 때 기존에 가져왔던 query 데이터가 업데이트 되지 않았다.
커스텀 훅으로 묶어서 닉네임 수정이 완료되었을 때 invaludateQueries를 보내 업데이트 해주었다.

export default function useUser() {
  const queryClient = useQueryClient();

  const userQuery = useQuery(['myInfo', 'profile'], () => getMyProfile(), {
    staleTime: 1000,
  });

  const updateNickame = useMutation((nickname: string) => rename(nickname), {
    onSuccess: () => queryClient.invalidateQueries(['myInfo', 'profile']),
  });

  return { userQuery, updateNickame };
}

@dongree dongree added FE 프론트엔드 LAYOUT 레이아웃 구현 INTEGRATION API/Socket 연동 labels Nov 28, 2024
@dongree dongree requested a review from dannysir November 28, 2024 04:01
Comment on lines +43 to +46
<div className='flex w-full max-w-[600px] items-center gap-2 py-2 sm:w-[80%] lg:w-[50%]'>
<div className='flex items-center justify-between w-full'>
<p className='w-28 min-w-[100px] truncate font-medium text-juga-grayscale-black'>
username
<p className='w-28 min-w-[80px] truncate font-medium text-juga-grayscale-black sm:min-w-[100px]'>
닉네임
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟢 sm 이랑 lg로 설정하는게 적응형 웹 관련 설정인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반응형 웹 설정입니다!
tailwind가 반응형하기 쉽게 되어있더라구요 ㅎㅎ

@dannysir dannysir merged commit 99b4903 into front/main Nov 28, 2024
2 checks passed
@dongree dongree deleted the feature/mypage/myInfo branch December 5, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE 프론트엔드 INTEGRATION API/Socket 연동 LAYOUT 레이아웃 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants