diff --git a/src/App.tsx b/src/App.tsx index 60649cf..cdedd55 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -44,7 +44,7 @@ const App = () => { } /> diff --git a/src/components/cardMaker/CardEditPage.tsx b/src/components/cardMaker/CardEditPage.tsx index fb56a99..6ef57df 100644 --- a/src/components/cardMaker/CardEditPage.tsx +++ b/src/components/cardMaker/CardEditPage.tsx @@ -98,7 +98,11 @@ const CardEditPage = () => { - diff --git a/src/components/cardMaker/cardEditPage.module.scss b/src/components/cardMaker/cardEditPage.module.scss index 528ba36..f5fbff4 100644 --- a/src/components/cardMaker/cardEditPage.module.scss +++ b/src/components/cardMaker/cardEditPage.module.scss @@ -101,6 +101,10 @@ border: none; cursor: pointer; font-family: GmarketSansMedium; + + &:disabled { + background-color: #dddddd; + } } .title { diff --git a/src/components/cardMaker/selectPokemon/SelectPokemonLayout.tsx b/src/components/cardMaker/selectPokemon/SelectPokemonLayout.tsx index 876f742..bdcaf28 100644 --- a/src/components/cardMaker/selectPokemon/SelectPokemonLayout.tsx +++ b/src/components/cardMaker/selectPokemon/SelectPokemonLayout.tsx @@ -7,9 +7,13 @@ import { useCallback } from 'react'; interface SelectPokemonLayoutProps { pokemonArray: (PokemonType | null)[]; + range: number; } -const SelectPokemonLayout = ({ pokemonArray }: SelectPokemonLayoutProps) => { +const SelectPokemonLayout = ({ + pokemonArray, + range, +}: SelectPokemonLayoutProps) => { const { setPokemonData, generateRandomNicknames } = useSelectedPokemonForCard(); @@ -23,17 +27,17 @@ const SelectPokemonLayout = ({ pokemonArray }: SelectPokemonLayoutProps) => { return (
- {pokemonArray.map((pokemonData, index) => ( + {Array.from({ length: range }, (_, index) => (
- {pokemonData ? ( + {pokemonArray[index] ? ( { ) : null}
- {pokemonData ? reverseObject(POKEMON_NAME)[pokemonData.name] : ''} + {pokemonArray[index] + ? reverseObject(POKEMON_NAME)[pokemonArray[index]!.name] + : ''} - {pokemonData ? ( - - ) : null} +
))}
diff --git a/src/components/cardMaker/selectPokemon/SelectPokemonLike.tsx b/src/components/cardMaker/selectPokemon/SelectPokemonLike.tsx index 1e7ffcc..b809498 100644 --- a/src/components/cardMaker/selectPokemon/SelectPokemonLike.tsx +++ b/src/components/cardMaker/selectPokemon/SelectPokemonLike.tsx @@ -53,7 +53,10 @@ const SelectPokemonLike = () => { > - + diff --git a/src/components/dex/PokemonDex.tsx b/src/components/dex/PokemonDex.tsx index f23c93d..fafad91 100644 --- a/src/components/dex/PokemonDex.tsx +++ b/src/components/dex/PokemonDex.tsx @@ -3,11 +3,16 @@ import PokemonDexElement from './PokemonDexElement'; import Inner from '../Inner'; import useFilteredPokemonData from '@/hook/useFilteredPokemonData'; import useVisibleDataByScroll from '@/hook/useVisibleDataByScroll'; +import Loading from '../loading/Loading'; const PokemonDex = () => { - const filteredData = useFilteredPokemonData(); + const { filteredData, isLoading } = useFilteredPokemonData(); const visibleData = useVisibleDataByScroll(filteredData); + if (isLoading) { + return ; + } + return (
    diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 37514da..289f5ef 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -108,7 +108,7 @@ const Header = () => { 도감 - +
    카드 제작 diff --git a/src/components/header/MobileNavMenu.tsx b/src/components/header/MobileNavMenu.tsx index 394490d..2476c72 100644 --- a/src/components/header/MobileNavMenu.tsx +++ b/src/components/header/MobileNavMenu.tsx @@ -38,7 +38,7 @@ const MobileNavMenu = () => {
    (isActive ? styles.active : '')} >
    diff --git a/src/components/mypage/MobileMypageAlert.tsx b/src/components/mypage/MobileMypageAlert.tsx index 1c678ec..8f51927 100644 --- a/src/components/mypage/MobileMypageAlert.tsx +++ b/src/components/mypage/MobileMypageAlert.tsx @@ -5,7 +5,7 @@ const MobileMypageAlert = ({ isOpen }: { isOpen: boolean }) => { const navigate = useNavigate(); const onMovetoMakecard = () => { - navigate('/cardEdit'); + navigate('/cardedit'); }; return ( <> diff --git a/src/components/mypage/Mycard.tsx b/src/components/mypage/Mycard.tsx index 89dd458..fa17ea8 100644 --- a/src/components/mypage/Mycard.tsx +++ b/src/components/mypage/Mycard.tsx @@ -86,7 +86,7 @@ const Mycard = () => { const onMoveMakeCard = () => { if (windowWidth <= 768) { setIsAlert((prev) => !prev); - } else navigate('/cardEdit'); + } else navigate('/cardedit'); }; const onModalToggle = (card?: Card) => { diff --git a/src/components/plate/FilterPlates.tsx b/src/components/plate/FilterPlates.tsx index 83376d3..800d3a0 100644 --- a/src/components/plate/FilterPlates.tsx +++ b/src/components/plate/FilterPlates.tsx @@ -4,15 +4,17 @@ import useSelectedStore from '@/store/useSelectedStore'; import PlateHideButton from './PlateHideButton'; import { useState } from 'react'; import { AnimatePresence, motion } from 'framer-motion'; +import useCalculateInnerWidth from '@/hook/useCalculateInnerWidth'; const FilterPlates = () => { const koreanTypes = Object.values(POKEMON_TYPES); const [isOpen, setIsOpen] = useState(false); const { selectedPlate, setSelectedPlate } = useSelectedStore(); + const innerWidth = useCalculateInnerWidth(); const variants = { - open: { height: '200px' }, - closed: { height: 0 }, + open: { height: '200px', opacity: 1 }, + closed: { height: 0, opacity: 0 }, }; const renderTypes = (types: string[]) => @@ -44,13 +46,12 @@ const FilterPlates = () => { return (
    - {isOpen ? ( + {isOpen && (
    @@ -62,8 +63,6 @@ const FilterPlates = () => {
    - ) : ( -
    )}
    diff --git a/src/hook/useFilteredPokemonData.ts b/src/hook/useFilteredPokemonData.ts index 92cf750..84cfe5e 100644 --- a/src/hook/useFilteredPokemonData.ts +++ b/src/hook/useFilteredPokemonData.ts @@ -8,12 +8,12 @@ import useSelectedStore from '@/store/useSelectedStore'; import useSearchInputText from '@/store/useSearchInputText'; const useFilteredPokemonData = () => { - const { data: allPokemonData } = useGetAllPokemon(1017); + const { data: allPokemonData, isLoading } = useGetAllPokemon(1017); const { selectedPlate } = useSelectedStore(); const { inputText } = useSearchInputText(); const reversedPokemonNameObject = reverseObject(POKEMON_NAME); - return useMemo(() => { + const filteredData = useMemo(() => { if (!allPokemonData) return []; return allPokemonData.filter((data: PokemonType) => { @@ -21,7 +21,7 @@ const useFilteredPokemonData = () => { return reversedPokemonNameObject[data?.name]?.includes(inputText); } if (!selectedPlate.length) { - return data; + return true; } const { types } = data; return selectedPlate.every((plate: string) => @@ -32,6 +32,8 @@ const useFilteredPokemonData = () => { }); // eslint-disable-next-line react-hooks/exhaustive-deps }, [allPokemonData, inputText, selectedPlate]); + + return { filteredData, isLoading }; }; export default useFilteredPokemonData;