From 9fb40509ef4dcf66fb8baef3960ea89aad1700a9 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 16:43:28 +0900 Subject: [PATCH 01/14] =?UTF-8?q?Refactor:=20userId=20=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A4=EB=8A=94=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - useLocation으로 userId 넘기지 않고 authStore를 통해 가져오도록 수정 --- src/pages/loginPending/LoginPending.tsx | 2 +- src/pages/register/RegisterCompany.tsx | 4 +++- src/pages/register/RegisterUser.tsx | 3 --- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/loginPending/LoginPending.tsx b/src/pages/loginPending/LoginPending.tsx index f2b9896..3e59fb4 100644 --- a/src/pages/loginPending/LoginPending.tsx +++ b/src/pages/loginPending/LoginPending.tsx @@ -32,7 +32,7 @@ const LoginPending = () => { const { userId, accessToken, refreshToken, isRegistered } = res.data; if (!isRegistered) { - navigate("/register/user", { state: { userId: userId } }); + navigate("/register/user"); } if (isRegistered) { diff --git a/src/pages/register/RegisterCompany.tsx b/src/pages/register/RegisterCompany.tsx index d5e1031..a5de1e0 100644 --- a/src/pages/register/RegisterCompany.tsx +++ b/src/pages/register/RegisterCompany.tsx @@ -22,6 +22,7 @@ import Spacing from "@/components/common/Spacing"; import useToast from "@/hooks/useToast"; import { palette } from "@/styles/palette"; import { typo } from "@/styles/typo"; +import useAuthStore from "@/store/AuthStore.tsx"; import useThemeStore from "@/store/ThemeStore"; import { JobList } from "@/constants/index.ts"; @@ -29,6 +30,7 @@ const RegisterCompany = () => { const navigate = useNavigate(); const { showToast } = useToast(); const isDarkMode = useThemeStore((state) => state.isDarkMode); + const userId = useAuthStore((state) => state.userId); const userInfo: UserInfoType = useLocation().state; const [isCodeSame, setIsCodeSame] = useState(null); const [codeChecked, setCodeChecked] = useState(null); @@ -112,7 +114,7 @@ const RegisterCompany = () => { } const formData = new FormData(); - formData.append("userId", userInfo.userId); + formData.append("userId", userId.toString()); formData.append("companyName", data.companyName); formData.append("companyEmail", data.companyEmail); formData.append("department", data.department[0]); diff --git a/src/pages/register/RegisterUser.tsx b/src/pages/register/RegisterUser.tsx index e842e66..ca3dbed 100644 --- a/src/pages/register/RegisterUser.tsx +++ b/src/pages/register/RegisterUser.tsx @@ -16,13 +16,11 @@ import Spacing from "@/components/common/Spacing"; import useToast from "@/hooks/useToast"; import { palette } from "@/styles/palette"; import { typo } from "@/styles/typo"; -import useAuthStore from "@/store/AuthStore.tsx"; import useThemeStore from "@/store/ThemeStore"; import { InterestList } from "@/constants/index.ts"; const RegisterUser = () => { const navigate = useNavigate(); - const userId = useAuthStore((state) => state.userId); const [doubleChecked, setDoubleChecked] = useState(false); const [nicknameDuplicated, setNicknameDuplicated] = useState(null); @@ -82,7 +80,6 @@ const RegisterUser = () => { const submitUserProfileData = (data: UserInfoStateType) => { if (formValidation(data.nickname)) { const userInfo = { - userId: userId, nickname: data.nickname, keywords: data.interest, }; From 119218c76e1682ce0eb85e7455f6f3a423ca62c3 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 17:05:09 +0900 Subject: [PATCH 02/14] =?UTF-8?q?Style:=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 빈 태그로 스타일을 주는 방식에서 css 적용 방식으로 수정 --- src/pages/register/RegisterUser.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/register/RegisterUser.tsx b/src/pages/register/RegisterUser.tsx index ca3dbed..79d8f57 100644 --- a/src/pages/register/RegisterUser.tsx +++ b/src/pages/register/RegisterUser.tsx @@ -92,11 +92,9 @@ const RegisterUser = () => { - {"프로필 등록"} Date: Wed, 17 Jan 2024 22:28:11 +0900 Subject: [PATCH 03/14] =?UTF-8?q?Style:=20=EC=9C=A0=EC=A0=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=93=B1=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 다크모드 적용 - 닉네임 입력 영역 너비 조정 --- src/pages/register/RegisterUser.tsx | 48 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/src/pages/register/RegisterUser.tsx b/src/pages/register/RegisterUser.tsx index 79d8f57..e421e25 100644 --- a/src/pages/register/RegisterUser.tsx +++ b/src/pages/register/RegisterUser.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; -import { MdWbSunny } from "react-icons/md"; +import { BiSolidMoon } from "react-icons/bi"; +import { RiSunFill } from "react-icons/ri"; import { useNavigate } from "react-router-dom"; import type { UserInfoStateType } from "@/schemas/userInfo"; import { UserInfoSchema } from "@/schemas/userInfo"; @@ -26,6 +27,7 @@ const RegisterUser = () => { const [nicknameDuplicated, setNicknameDuplicated] = useState(null); const { showToast } = useToast(); const isDarkMode = useThemeStore((state) => state.isDarkMode); + const toggleDarkMode = useThemeStore((state) => state.toggleDarkMode); const userInfoForm = useForm({ resolver: zodResolver(UserInfoSchema), @@ -88,19 +90,34 @@ const RegisterUser = () => { }; return ( - + - {"프로필 등록"} + {"프로필 등록"} - + {isDarkMode ? ( + + ) : ( + + )} @@ -108,9 +125,10 @@ const RegisterUser = () => {
- + {"닉네임"} + @@ -155,7 +173,7 @@ const RegisterUser = () => { )} - {"관심사"} + {"관심사"} { ); }; -const StyleRegisterWrapper = styled.div` - background-color: ${palette.GRAY100}; +const StyleRegisterWrapper = styled.div<{ isDarkMode: boolean }>` + background-color: ${({ isDarkMode }) => (isDarkMode ? palette.DARK_BLUE : palette.GRAY100)}; height: 100%; `; const StyleRegisterHeader = styled.div``; -const StyleHeaderText = styled.span` +const StyleHeaderText = styled.span<{ isDarkMode: boolean }>` margin: 0 auto; font-size: ${typo.Body_24()}; + color: ${({ isDarkMode }) => (isDarkMode ? palette.DARK_WHITE : palette.BLACK)}; `; const StyleDivider = styled.hr` height: 1px; background-color: ${palette.GRAY200}; border: 0; `; -const StyleInterestText = styled.div` +const StyleSectionText = styled.div<{ isDarkMode: boolean }>` padding: 10px; margin-left: 25px; font-size: ${typo.Body_18()}; + color: ${({ isDarkMode }) => (isDarkMode ? palette.DARK_WHITE : palette.BLACK)}; `; const StyleSubmitButtonWrapper = styled.div` display: flex; From c37868ece3b755f119a35a36b4aa59a346d839db Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:14:53 +0900 Subject: [PATCH 04/14] =?UTF-8?q?Style:=20GRAY=20=EA=B3=84=EC=97=B4=20?= =?UTF-8?q?=EC=83=89=EC=83=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GRAY800, GRAY900 --- src/styles/palette.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styles/palette.ts b/src/styles/palette.ts index d2e79fe..49e1e2e 100644 --- a/src/styles/palette.ts +++ b/src/styles/palette.ts @@ -16,6 +16,8 @@ export const palette = { YELLOW: "#FEE500", BLUE: "#004BFF", DARK_ICON: "#4F5965", + GRAY900: "#1C1F25", + GRAY800: "#2A2E35", GRAY700: "#313741", GRAY600: "#33363B", GRAY500: "#717580", From 2d1ae45b082bf350ba7ab7669937f08022a77782 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:15:55 +0900 Subject: [PATCH 05/14] =?UTF-8?q?Feat:=20RegisterInput=20=EB=8B=A4?= =?UTF-8?q?=ED=81=AC=EB=AA=A8=EB=93=9C=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/RegisterInput/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/common/RegisterInput/index.tsx b/src/components/common/RegisterInput/index.tsx index 87a4947..4af96c6 100644 --- a/src/components/common/RegisterInput/index.tsx +++ b/src/components/common/RegisterInput/index.tsx @@ -9,6 +9,7 @@ interface InputProps extends ComponentProps<"input"> { height?: number; placeholder: string; type?: string; + isDarkMode: boolean; } /** @@ -21,7 +22,7 @@ interface InputProps extends ComponentProps<"input"> { * @returns */ const RegisterInput = forwardRef( - ({ width, height, placeholder, type, ...props }, ref) => { + ({ width, height, placeholder, type, isDarkMode, ...props }, ref) => { return ( ( heightProps={height} placeholder={placeholder} type={type} + isDarkMode={isDarkMode} {...props} ref={ref} /> @@ -45,10 +47,10 @@ const StyleInputWrapper = styled.span` align-items: center; /* width: 100%; */ `; -const StyleInput = styled.input<{ widthProps?: number; heightProps?: number }>` - background-color: ${palette.WHITE}; +const StyleInput = styled.input<{ widthProps?: number; heightProps?: number; isDarkMode: boolean }>` + background-color: ${({ isDarkMode }) => (isDarkMode ? palette.GRAY600 : palette.WHITE)}; height: ${({ heightProps }) => (heightProps ? `${heightProps}px` : "46px")}; - border: 1px solid ${palette.GRAY200}; + border: 1px solid ${({ isDarkMode }) => (isDarkMode ? palette.GRAY600 : palette.GRAY200)}; border-radius: 10px; width: ${({ widthProps }) => (widthProps ? `${widthProps}px` : "100%")}; font-size: ${typo.Body_14()}; From ba62ae7d615196803c4df7fcd833b3dd6bb7279a Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:16:24 +0900 Subject: [PATCH 06/14] =?UTF-8?q?Chore:=20RegisterInput=20TSDocs=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/RegisterInput/index.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/common/RegisterInput/index.tsx b/src/components/common/RegisterInput/index.tsx index 4af96c6..2681569 100644 --- a/src/components/common/RegisterInput/index.tsx +++ b/src/components/common/RegisterInput/index.tsx @@ -13,11 +13,12 @@ interface InputProps extends ComponentProps<"input"> { } /** - * @param width : input width - * @param height : input height - * @param placeholder : input placeholder - * @param type : input type - * @param props : input other props + * @param width : number 너비 + * @param height : number 높이 + * @param placeholder : string 빈 값일 때 보여줄 텍스트 + * @param type : string input 타입 + * @param props : string 기타 props + * @param isDarkMode : boolean 다크모드 여부 * @description : 정보 등록 및 수정 페이지에서 활용하는 Input 컴포넌트입니다. form 구성 시 {...register("label")}를 prop으로 전달해주세요. * @returns */ From 86f80033b8435db3ef8cba933ebb2db537228e97 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:17:54 +0900 Subject: [PATCH 07/14] =?UTF-8?q?Style:=20=EC=9C=A0=EC=A0=80=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=93=B1=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?Input=20=EB=B0=8F=20=EB=B2=84=ED=8A=BC=20=EB=8B=A4=ED=81=AC?= =?UTF-8?q?=EB=AA=A8=EB=93=9C=20=EC=B6=94=EA=B0=80=EB=A1=9C=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/register/RegisterUser.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/register/RegisterUser.tsx b/src/pages/register/RegisterUser.tsx index e421e25..7ccef1a 100644 --- a/src/pages/register/RegisterUser.tsx +++ b/src/pages/register/RegisterUser.tsx @@ -130,10 +130,11 @@ const RegisterUser = () => { { event.preventDefault(); doubleCheckNickName(userInfoForm.getValues("nickname")); From 8c9182d1c9c57740a4a10c34ef09ba6a252ecd09 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:19:06 +0900 Subject: [PATCH 08/14] =?UTF-8?q?Style:=20=ED=9A=8C=EC=82=AC=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=93=B1=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=8B=A4=ED=81=AC=EB=AA=A8=EB=93=9C=20=EB=8C=80=EC=9D=91=20?= =?UTF-8?q?=EC=99=B8=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 일부 Input 너비 감소 조정 --- src/pages/register/RegisterCompany.tsx | 75 +++++++++++++++++--------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/src/pages/register/RegisterCompany.tsx b/src/pages/register/RegisterCompany.tsx index a5de1e0..66c93c4 100644 --- a/src/pages/register/RegisterCompany.tsx +++ b/src/pages/register/RegisterCompany.tsx @@ -1,7 +1,9 @@ import { useEffect } from "react"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; -import { MdOutlinePhotoCamera, MdWbSunny } from "react-icons/md"; +import { BiSolidMoon } from "react-icons/bi"; +import { MdOutlinePhotoCamera } from "react-icons/md"; +import { RiSunFill } from "react-icons/ri"; import { useLocation, useNavigate } from "react-router-dom"; import type { CompanyInfoStateType } from "@/schemas/companyInfo.ts"; import { CompanyInfoSchema } from "@/schemas/companyInfo.ts"; @@ -30,6 +32,7 @@ const RegisterCompany = () => { const navigate = useNavigate(); const { showToast } = useToast(); const isDarkMode = useThemeStore((state) => state.isDarkMode); + const toggleDarkMode = useThemeStore((state) => state.toggleDarkMode); const userId = useAuthStore((state) => state.userId); const userInfo: UserInfoType = useLocation().state; const [isCodeSame, setIsCodeSame] = useState(null); @@ -139,7 +142,7 @@ const RegisterCompany = () => { }; return ( - + { { navigate("/register/user"); }} /> - {"회사 인증"} + {"회사 인증"} - + {isDarkMode ? ( + + ) : ( + + )} - + @@ -174,8 +193,9 @@ const RegisterCompany = () => { > @@ -193,12 +213,13 @@ const RegisterCompany = () => { { event.preventDefault(); handleEmailCertification(companyInfoForm.getValues("companyEmail")); @@ -228,8 +249,9 @@ const RegisterCompany = () => { }} > { )} - {"직무정보"} + {"직무정보"} { gap={0} direction={"column"} > - {"명함을 업로드 해주세요!"} + {"명함을 업로드 해주세요!"} - + @@ -206,9 +206,9 @@ const StyleHeaderText = styled.span<{ isDarkMode: boolean }>` font-size: ${typo.Body_24()}; color: ${({ isDarkMode }) => (isDarkMode ? palette.DARK_WHITE : palette.BLACK)}; `; -const StyleDivider = styled.hr` +const StyleDivider = styled.hr<{ isDarkMode: boolean }>` height: 1px; - background-color: ${palette.GRAY200}; + background-color: ${({ isDarkMode }) => (isDarkMode ? palette.GRAY600 : palette.GRAY200)}; border: 0; `; const StyleSectionText = styled.div<{ isDarkMode: boolean }>` From 7ee7cf8dd3afe291248d51717e23147f6787112e Mon Sep 17 00:00:00 2001 From: sscoderati Date: Wed, 17 Jan 2024 23:24:53 +0900 Subject: [PATCH 11/14] =?UTF-8?q?Chore:=20RegisterInput=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=82=AC=ED=95=AD=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - isDarkMode Prop --- src/pages/chatListDetail/ChatListDetail.tsx | 1 + src/pages/profile/ProfileCompanyEdit.tsx | 3 +++ src/pages/profile/ProfileEdit.tsx | 1 + 3 files changed, 5 insertions(+) diff --git a/src/pages/chatListDetail/ChatListDetail.tsx b/src/pages/chatListDetail/ChatListDetail.tsx index 9282eb1..4bea162 100644 --- a/src/pages/chatListDetail/ChatListDetail.tsx +++ b/src/pages/chatListDetail/ChatListDetail.tsx @@ -66,6 +66,7 @@ const ChatListDetail = () => { ref={messageRef} width={250} height={35} + isDarkMode={false} placeholder={"대화 불가능한 상태입니다."} disabled > diff --git a/src/pages/profile/ProfileCompanyEdit.tsx b/src/pages/profile/ProfileCompanyEdit.tsx index b96459c..2982af2 100644 --- a/src/pages/profile/ProfileCompanyEdit.tsx +++ b/src/pages/profile/ProfileCompanyEdit.tsx @@ -146,6 +146,7 @@ const ProfileCompanyEdit = () => { width={343} placeholder={"회사 이름"} defaultValue={data?.companyName} + isDarkMode={isDarkMode} {...companyInfoForm.register("companyName")} />
@@ -166,6 +167,7 @@ const ProfileCompanyEdit = () => { { { width={240} placeholder={"닉네임 (10자 제한)"} defaultValue={data?.nickname} + isDarkMode={isDarkMode} {...userInfoForm.register("nickname")} /> Date: Thu, 18 Jan 2024 01:43:39 +0900 Subject: [PATCH 12/14] =?UTF-8?q?Remove:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - no usuage인 경우 - 주석처리로라도 남아있지 않은 경우 --- src/apis/test.ts | 5 -- .../common/WhiteSelectorButton/index.tsx | 67 ------------------- 2 files changed, 72 deletions(-) delete mode 100644 src/apis/test.ts delete mode 100644 src/components/common/WhiteSelectorButton/index.tsx diff --git a/src/apis/test.ts b/src/apis/test.ts deleted file mode 100644 index a5f9006..0000000 --- a/src/apis/test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import axios from "axios"; - -export const testWithBtn = async (nickname: string) => { - return axios.get(`https://api.coffee-meet.site/api/v1/users/duplicate?nickname=${nickname}`); -}; diff --git a/src/components/common/WhiteSelectorButton/index.tsx b/src/components/common/WhiteSelectorButton/index.tsx deleted file mode 100644 index ac6f144..0000000 --- a/src/components/common/WhiteSelectorButton/index.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { useState } from "react"; -import styled from "@emotion/styled"; -import { palette } from "@/styles/palette"; - -type ToggleButtonProps = { - buttonName: string; - selectedButtonColor: string; - defaultButtonColor?: string; - onClick?: () => void; -}; - -type StyledButtonProps = { - backgroundColor: string; -}; - -const WhiteSelectorButton = ({ - buttonName, - selectedButtonColor, - defaultButtonColor = palette.TERTIARY, - onClick, -}: ToggleButtonProps) => { - const [backgroundColor, setBackgroundColor] = useState(defaultButtonColor); - - const handleButtonClick = () => { - setBackgroundColor((prevColor) => - prevColor === defaultButtonColor ? selectedButtonColor : defaultButtonColor, - ); - if (onClick) { - onClick(); - } - }; - - return ( - - {buttonName} - - ); -}; - -const StyledButton = styled.button` - margin: 0 4px; - height: 36px; - padding: 10px 15px 10px 15px; - font-size: 12px; - cursor: pointer; - border: none; - border-radius: 10px; - background-color: ${(props) => props.backgroundColor}; - transition: background-color 0.3s; - &:hover { - opacity: 0.9; - } - &:focus { - outline: none; - } - color: ${palette.WHITE}; - display: inline-block; - vertical-align: middle; - line-height: 1; - letter-spacing: -1px; - font-weight: 600; -`; - -export default WhiteSelectorButton; From 8de93731f31f80af39bf56ae758592097f8987b5 Mon Sep 17 00:00:00 2001 From: sscoderati Date: Thu, 18 Jan 2024 01:44:30 +0900 Subject: [PATCH 13/14] =?UTF-8?q?Fix:=20=ED=95=98=EB=8B=A8=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EB=B0=94=EC=97=90=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=85=B8=EC=B6=9C=EC=9D=B4=20?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/NavigationBar/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/common/NavigationBar/index.tsx b/src/components/common/NavigationBar/index.tsx index a98f0b0..928431a 100644 --- a/src/components/common/NavigationBar/index.tsx +++ b/src/components/common/NavigationBar/index.tsx @@ -1,11 +1,14 @@ import { IoChatbox } from "react-icons/io5"; import { MdHome } from "react-icons/md"; import { useNavigate } from "react-router-dom"; +import { getMyProfileDataOptions } from "@/libs/react-query/options/getMyProfileData.ts"; import styled from "@emotion/styled"; +import { useQuery } from "@tanstack/react-query"; import Avatar from "@/components/common/Avatar"; import { FlexBox } from "@/components/common/Flexbox"; import { Text } from "@/components/common/Text"; import { palette } from "@/styles/palette"; +import useAuthStore from "@/store/AuthStore.tsx"; import defaultProfileImage from "@/assets/images/defaultProfileImage.png"; type NavigationBarProps = { @@ -14,6 +17,11 @@ type NavigationBarProps = { const NavigationBar = ({ isDarkMode }: NavigationBarProps) => { const navigate = useNavigate(); + const { data } = useQuery({ + ...getMyProfileDataOptions, + enabled: useAuthStore.getState().authTokens?.accessToken !== null, + }); + const moveFromNavigationBar = (path: string) => { navigate(`/${path}`); }; @@ -74,7 +82,7 @@ const NavigationBar = ({ isDarkMode }: NavigationBarProps) => { From 7896097012b55860d9617b2b8f3e16dc7274cd3f Mon Sep 17 00:00:00 2001 From: sscoderati Date: Thu, 18 Jan 2024 01:44:48 +0900 Subject: [PATCH 14/14] =?UTF-8?q?Fix:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=88=98=EC=A0=95=EC=8B=9C=20?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=20=EB=B0=98=EC=98=81=EC=9D=B4=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EC=83=81=ED=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/profile/ProfileEdit.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/profile/ProfileEdit.tsx b/src/pages/profile/ProfileEdit.tsx index 135162b..8b44325 100644 --- a/src/pages/profile/ProfileEdit.tsx +++ b/src/pages/profile/ProfileEdit.tsx @@ -37,8 +37,8 @@ const ProfileEdit = () => { const userInfoForm = useForm({ resolver: zodResolver(UserInfoSchema), }); - const queryClient = useQueryClient(); + const queryClient = useQueryClient(); const data = queryClient.getQueryData(["myProfileData"]); const checkNicknameDuplicated = (nickname: string) => { @@ -76,7 +76,6 @@ const ProfileEdit = () => { type: "success", isDarkMode, }); - await queryClient.invalidateQueries({ queryKey: ["myProfileData"] }); await queryClient.refetchQueries({ queryKey: ["myProfileData"] }); }) .catch(() => { @@ -110,7 +109,6 @@ const ProfileEdit = () => { type: "success", isDarkMode, }); - await queryClient.invalidateQueries({ queryKey: ["myProfileData"] }); await queryClient.refetchQueries({ queryKey: ["myProfileData"] }); navigate("/profile"); }) @@ -146,7 +144,7 @@ const ProfileEdit = () => {