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/MultiSelector/index.tsx b/src/components/common/MultiSelector/index.tsx index fcd87e6..0008473 100644 --- a/src/components/common/MultiSelector/index.tsx +++ b/src/components/common/MultiSelector/index.tsx @@ -106,7 +106,7 @@ const StyledItem = styled.button<{ isDarkMode: boolean; isSelected: boolean }>` props.isDarkMode ? props.isSelected ? palette.SECONDARY - : palette.WHITE + : palette.GRAY900 : props.isSelected ? palette.BLUE : palette.TERTIARY}; 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) => { diff --git a/src/components/common/RegisterInput/index.tsx b/src/components/common/RegisterInput/index.tsx index 87a4947..2681569 100644 --- a/src/components/common/RegisterInput/index.tsx +++ b/src/components/common/RegisterInput/index.tsx @@ -9,19 +9,21 @@ interface InputProps extends ComponentProps<"input"> { height?: number; placeholder: string; type?: string; + isDarkMode: boolean; } /** - * @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 */ 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 +48,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()}; 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; 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/loginPending/LoginPending.tsx b/src/pages/loginPending/LoginPending.tsx index 0d09f80..16f5cea 100644 --- a/src/pages/loginPending/LoginPending.tsx +++ b/src/pages/loginPending/LoginPending.tsx @@ -33,7 +33,7 @@ const LoginPending = () => { setUserId(userId); if (!isRegistered) { - navigate("/register/user", { state: { userId: userId } }); + navigate("/register/user"); } if (isRegistered) { 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 = () => { { { 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 = () => {
{ event.preventDefault(); handleEmailCertification(companyInfoForm.getValues("companyEmail")); @@ -226,8 +249,9 @@ const RegisterCompany = () => { }} > { )} - {"직무정보"} + {"직무정보"} { gap={0} direction={"column"} > - {"명함을 업로드 해주세요!"} + {"명함을 업로드 해주세요!"}