Skip to content

Commit

Permalink
#68 fix : 닉네임 자기 소개 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamong0620 committed Sep 24, 2024
1 parent d6774b9 commit f662f38
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/components/ProfileUpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { useAtom } from 'jotai';
import { descriptionAtom, nicknameAtom } from '../contexts/NickName';
import { useQuery } from '@tanstack/react-query';
import { userInfoApi } from '../api/UserApi';
import { customErrToast } from '../utils/customErrorToast';
import { unreadCount } from '../contexts/sseAtom';

type Props = {
onModalVisibleFunc: () => void;
};
const ProfileUpdateModal = ({ onModalVisibleFunc }: Props) => {
const [nickname, setNicknameAtom] = useAtom(nicknameAtom);
const [description, setDescriptionAtom] = useAtom(descriptionAtom);
const [, setNicknameAtom] = useAtom(nicknameAtom);
const [, setDescriptionAtom] = useAtom(descriptionAtom);
const [newNickname, setNewNickname] = useState<string>('');
const [newDescription, setNewDescription] = useState<string>('');
const [errMsg, setErrMsg] = useState<string>('한글자 이상은 작성해주세요!');
Expand Down Expand Up @@ -62,7 +62,7 @@ const ProfileUpdateModal = ({ onModalVisibleFunc }: Props) => {
if (e.target.value === '') {
setDescriptionErrMsg('한글자 이상은 작성해주세요!');
} else if (e.target.value.length > 20) {
setDescriptionErrMsg('닉네임은 20자 이하로 작성해주세요');
setDescriptionErrMsg('자기소개는 20자 이하로 작성해주세요');
}
setNewDescription(e.target.value);
};
Expand Down
11 changes: 8 additions & 3 deletions src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ const MainPage = () => {
}

// 개인 대시보드 데이터 업데이트
setDashboardDetail(personalDashboardData);
if (personalDashboardData) {
setDashboardDetail(personalDashboardData);
setTeamDashboardDetail(null);
}

if (teamDashboardData)
// 팀 대시보드 데이터 업데이트
//팀 대시보드 데이터 업데이트
if (teamDashboardData) {
setDashboardDetail(null);
setTeamDashboardDetail(teamDashboardData);
}
} catch (error) {
console.error('Error fetching data', error);
}
Expand Down
16 changes: 10 additions & 6 deletions src/types/MyPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { DashboardItem } from './PersonalDashBoard';
//* 사용자 프로필 타입
export interface ProfileInfo {
statusCode: number;
message: 'string';
message: string;
data: {
picture: 'string';
email: 'string';
name: 'string';
nickName: 'string';
picture: string;
email: string;
name: string;
nickName: string;
socialType: 'KAKAO' | 'GOOGLE';
introduction: 'string';
introduction: string;
};
}

Expand Down Expand Up @@ -55,6 +55,10 @@ interface ChallengeInfoResDto {
authorName: string;
authorProfileImage: string;
blockName: string;
participantCount: number;
isParticipant: boolean;
isAuthor: boolean;
completedMembers: string[];
}

export interface PersonalDashboardList {
Expand Down

0 comments on commit f662f38

Please sign in to comment.