diff --git a/src/App.tsx b/src/App.tsx index b4b412c..8e6d358 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,7 +9,6 @@ import { MyProfile, MyProfileBoard, MyProfileEdit, MyProfileThunder } from './pa import { Thunder, ThunderChat, ThunderId, ThunderPost } from './pages/thunder'; import Landing from './pages/Home/Landing.tsx'; import ProfileId from './pages/profile/ProfileId.tsx'; -import Terms from './pages/terms/Terms.tsx'; import ImageOverview from './pages/Image/ImageOverview.tsx'; function App() { @@ -62,8 +61,6 @@ function App() { } /> - } /> - } /> } /> diff --git a/src/api/util/instance.ts b/src/api/util/instance.ts index 8913fd8..7a642ae 100644 --- a/src/api/util/instance.ts +++ b/src/api/util/instance.ts @@ -84,8 +84,10 @@ export async function refreshAccessToken(option?: string): Promise void; - title1: string; - title2: string; - children: React.ReactNode; + title1?: string; + title2?: string; + children?: React.ReactNode; } // ModalCenter 를 위한 컴포넌트. @@ -16,7 +16,7 @@ const ModalCenter: React.FC = ({ isOpen, title1, title2, child return ReactDOM.createPortal(
-
+
{title1}
{title2}
{children}
diff --git a/src/components/landing/FirstSection.tsx b/src/components/landing/FirstSection.tsx index c4256ac..7b4704c 100644 --- a/src/components/landing/FirstSection.tsx +++ b/src/components/landing/FirstSection.tsx @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'; interface FirstSectionProps { isVisible: boolean; setIsImageLoaded: (loaded: boolean) => void; - spicy: number | null; + spicy: number | null | undefined; } const FirstSection: React.FC = ({ isVisible, setIsImageLoaded, spicy }) => ( diff --git a/src/components/landing/FoodSection.tsx b/src/components/landing/FoodSection.tsx index f7038a1..38855a4 100644 --- a/src/components/landing/FoodSection.tsx +++ b/src/components/landing/FoodSection.tsx @@ -1,14 +1,12 @@ import { Link } from 'react-router-dom'; import { IoIosArrowForward } from 'react-icons/io'; import FoodsCarousel from './FoodsCarousel'; -import { Dispatch, SetStateAction } from 'react'; interface FoodSectionProps { spicy: number | null; - setConfirmFlavor: Dispatch>; } -const FoodSection: React.FC = ({ spicy, setConfirmFlavor }) => { +const FoodSection: React.FC = ({ spicy }) => { return (
@@ -17,7 +15,7 @@ const FoodSection: React.FC = ({ spicy, setConfirmFlavor }) => 더보기
- + {!spicy && (
diff --git a/src/components/landing/FoodsCarousel.tsx b/src/components/landing/FoodsCarousel.tsx index c402e12..dc30282 100644 --- a/src/components/landing/FoodsCarousel.tsx +++ b/src/components/landing/FoodsCarousel.tsx @@ -2,7 +2,7 @@ import 'swiper/css'; import 'swiper/css/pagination'; import ImageWithPlaceholder from './ImageWithPlaceHolder'; import { Link } from 'react-router-dom'; -import { Dispatch, SetStateAction, useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { FoodsCarouselList } from '../../data/FoodsCarouselList'; import { Swiper, SwiperSlide } from 'swiper/react'; import { FoodsList } from '../../types/types'; @@ -11,10 +11,9 @@ import { authInstance } from '../../api/util/instance'; interface FoodsCarouselProps { spicy: number | null; - setConfirmFlavor: Dispatch>; } -const FoodsCarousel: React.FC = ({ spicy, setConfirmFlavor }) => { +const FoodsCarousel: React.FC = ({ spicy }) => { const [userFoods, setUserFoods] = useState(FoodsCarouselList); const { setFoodsList } = useFoodsListStore(); @@ -38,7 +37,6 @@ const FoodsCarousel: React.FC = ({ spicy, setConfirmFlavor } }) .catch((err) => { console.error('Error fetching foods:', err); - setConfirmFlavor(false); }); } }, [spicy]); diff --git a/src/components/myprofile/FTILink.tsx b/src/components/myprofile/FTILink.tsx new file mode 100644 index 0000000..fc4a676 --- /dev/null +++ b/src/components/myprofile/FTILink.tsx @@ -0,0 +1,17 @@ +import { Link } from 'react-router-dom'; + +interface FTILinkProps { + ftiType: string | null; +} + +export const FTILink: React.FC = ({ ftiType }) => { + return ftiType ? ( +

{ftiType}

+ ) : ( + + FTI 설정하기 + + ); +}; diff --git a/src/components/myprofile/LoadingSpinner.tsx b/src/components/myprofile/LoadingSpinner.tsx new file mode 100644 index 0000000..fb836d4 --- /dev/null +++ b/src/components/myprofile/LoadingSpinner.tsx @@ -0,0 +1,10 @@ +import { motion } from 'framer-motion'; + +export const LoadingSpinner = () => ( + +
+ +); diff --git a/src/components/myprofile/ProfileForm.tsx b/src/components/myprofile/ProfileForm.tsx new file mode 100644 index 0000000..8b4b8cb --- /dev/null +++ b/src/components/myprofile/ProfileForm.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import Button from '../../components/common/Button'; +import { UseFormRegister } from 'react-hook-form'; + +interface ProfileFormProps { + register: UseFormRegister; + duplicateNickname: string; + handleNicknameBlur: (e: React.FocusEvent) => void; + isLoading: boolean; +} + +export const ProfileForm: React.FC = ({ + register, + duplicateNickname, + handleNicknameBlur, + isLoading, +}) => { + return ( +
+ + + {duplicateNickname &&

{duplicateNickname}

} + + + +
+ ); +}; diff --git a/src/components/myprofile/ProfileImageInput.tsx b/src/components/myprofile/ProfileImageInput.tsx new file mode 100644 index 0000000..e9b9b42 --- /dev/null +++ b/src/components/myprofile/ProfileImageInput.tsx @@ -0,0 +1,15 @@ +import React from 'react'; + +interface ProfileImageInputProps { + handleImageChange: (e: React.ChangeEvent) => void; +} + +export const ProfileImageInput: React.FC = ({ handleImageChange }) => ( + <> + +