diff --git a/public/assets/tool_tip_24.svg b/public/assets/tool_tip_24.svg new file mode 100644 index 00000000..84e1d5f3 --- /dev/null +++ b/public/assets/tool_tip_24.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/ErrorBoundary/StayDuringRoutingAlert.tsx b/src/components/ErrorBoundary/StayDuringRoutingAlert.tsx index 76a83177..8af81940 100644 --- a/src/components/ErrorBoundary/StayDuringRoutingAlert.tsx +++ b/src/components/ErrorBoundary/StayDuringRoutingAlert.tsx @@ -1,3 +1,4 @@ +import { useQueryClient } from '@tanstack/react-query'; import { useOverlay } from '@toss/use-overlay'; import { Alert } from 'concept-be-design-system'; import { useCallback, useEffect } from 'react'; @@ -14,6 +15,7 @@ interface Props { let isOpenAlert = false; const StayDuringRoutingAlert = ({ content }: Props) => { + const queryClient = useQueryClient(); const overlay = useOverlay({ exitOnUnmount: false, }); @@ -27,13 +29,14 @@ const StayDuringRoutingAlert = ({ content }: Props) => { close(); exit(); isOpenAlert = false; + queryClient.invalidateQueries({ queryKey: ['ideas'] }); }} content={content} buttonContent={buttonContent} /> )); }, - [overlay], + [overlay, queryClient], ); useEffect(() => { diff --git a/src/pages/Feed/Feed.page.tsx b/src/pages/Feed/Feed.page.tsx index e4c0e566..796cc5f6 100644 --- a/src/pages/Feed/Feed.page.tsx +++ b/src/pages/Feed/Feed.page.tsx @@ -44,7 +44,7 @@ const Feed = () => { - {getUserNickname()} + {getUserNickname() || 'Guest1234'}, 님, diff --git a/src/pages/Feed/utils/getUserNickname.ts b/src/pages/Feed/utils/getUserNickname.ts index b4a5c2b5..dab5cfb2 100644 --- a/src/pages/Feed/utils/getUserNickname.ts +++ b/src/pages/Feed/utils/getUserNickname.ts @@ -7,5 +7,5 @@ export const getUserNickname = (): string => { return user.nickname; } - return 'Guest1234'; + return ''; }; diff --git a/src/pages/Profile/types/index.ts b/src/pages/Profile/types/index.ts index f00713e2..6aa09a32 100644 --- a/src/pages/Profile/types/index.ts +++ b/src/pages/Profile/types/index.ts @@ -1,13 +1,13 @@ export type Idea = { id: number; - title: string; // 게시글 제목, - introduce: string; // 게시글 본문, - hitsCount: number; // 조회수, - commentsCount: number; // 댓글 개수, - likesCount: number; // 좋아요수, - bookmarksCount: number; // 북마크 수, - branches: string[]; // 분야, - skillCategories: string[]; // 목적 + title: string; + introduce: string; + hitsCount: number; + commentsCount: number; + likesCount: number; + bookmarksCount: number; + branches: string[]; + skillCategories: string[]; }; export type MemberSkills = { @@ -17,15 +17,16 @@ export type MemberSkills = { }; export type Member = { - profileImageUrl: string; // 프로필 이미지, - nickname: string; // 닉네임 - isMyProfile: boolean; // 내 프로필 여부 - mainSkill: string; // 주요 스킬 - livingPlace: string; // 지역 - workingPlace: string; // 직장명 - introduction: string; // 자기소개 - skills: MemberSkills[]; // 세부 스킬 - joinPurposes: string[]; // 관심 영역 + email: string; + profileImageUrl: string; + nickname: string; + isMyProfile: boolean; + mainSkill: string; + livingPlace: string; + workingPlace: string; + introduction: string; + skills: MemberSkills[]; + joinPurposes: string[]; }; export interface MemberResponse { diff --git a/src/pages/ProfileEdit/ProfileEdit.page.tsx b/src/pages/ProfileEdit/ProfileEdit.page.tsx index f9f451f8..330e94fb 100644 --- a/src/pages/ProfileEdit/ProfileEdit.page.tsx +++ b/src/pages/ProfileEdit/ProfileEdit.page.tsx @@ -23,6 +23,7 @@ import { FormEvent } from 'react'; import useProfileEditQuery from './hooks/useProfileEditQuery.ts'; import usePutProfileMutation from './hooks/usePutProfileMutation.ts'; import { DropdownValue, FieldValue } from './types'; +import { ReactComponent as SVGToolTip24 } from '../../../public/assets/tool_tip_24.svg'; import { NICKNAME_REG_EXP } from '../../constants/index.ts'; import useAlert from '../../hooks/useAlert.tsx'; import Back from '../../layouts/Back.tsx'; @@ -163,6 +164,28 @@ const ProfileEdit = () => { + + + 이메일 + + + openAlert({ + content: '가입 시 등록한 이메일입니다. 확인용이며 본인 외 다른 사람에게 노출되지 않습니다.', + }) + } + cursor="pointer" + /> + + + + {my.email} + + + + { skillLevels, regions, purposes, - my: { ...my, ['skills']: mySkills, ['joinPurposes']: myPurposes }, + my: { ...my, skills: mySkills, joinPurposes: myPurposes, email: my.email }, }; }; diff --git a/src/pages/SignUp/hooks/useCheckDuplicateNickname.ts b/src/pages/SignUp/hooks/useCheckDuplicateNickname.ts index 7017ee9e..4f6d9556 100644 --- a/src/pages/SignUp/hooks/useCheckDuplicateNickname.ts +++ b/src/pages/SignUp/hooks/useCheckDuplicateNickname.ts @@ -14,8 +14,10 @@ const useCheckDuplicateNickname = ({ nickname, setFieldErrorValue }: Props) => { const userNickname = getUserNickname(); const timerId = useRef(null); + console.log(userNickname); + useEffect(() => { - if (userNickname === nickname || nickname.length < 2 || NICKNAME_REG_EXP.test(nickname)) { + if (nickname.length < 2 || NICKNAME_REG_EXP.test(nickname)) { return; } @@ -28,8 +30,9 @@ const useCheckDuplicateNickname = ({ nickname, setFieldErrorValue }: Props) => { if (!nickname) return; const isUnique = await getCheckDuplicateNickname(nickname); + const isSameBeforeNickname = userNickname === nickname; - if (!isUnique) { + if (!isUnique && !isSameBeforeNickname) { setFieldErrorValue((prev) => ({ ...prev, nickname: '이미 사용 중인 닉네임입니다.',