@@ -223,7 +223,7 @@ const EvolutionChain = ({
key={pokemonData.id}
className={styles.evolves__pre__evolution}
>
-
@@ -261,7 +261,7 @@ const EvolutionChain = ({
className={styles.evolves__pre__evolution__box}
>
-
@@ -278,7 +278,7 @@ const EvolutionChain = ({
width={141}
height={141}
/>
-
+
diff --git a/src/components/list/PokemonList.module.scss b/src/components/dex/PokemonDex.module.scss
similarity index 87%
rename from src/components/list/PokemonList.module.scss
rename to src/components/dex/PokemonDex.module.scss
index 52fe0ef..21f5253 100644
--- a/src/components/list/PokemonList.module.scss
+++ b/src/components/dex/PokemonDex.module.scss
@@ -11,15 +11,10 @@
flex-direction: column;
padding: 10px 0;
border-radius: 17px;
- border: 2px solid #000;
+ border: 2px solid #e8e8e8;
cursor: pointer;
background-color: #fff;
-
- &:hover {
- cursor: pointer;
- transition: transform 0.1s ease;
- transform: scale(1.02);
- }
+ cursor: pointer;
.pokemon_number {
width: 57px;
diff --git a/src/components/list/PokemonList.tsx b/src/components/dex/PokemonDex.tsx
similarity index 68%
rename from src/components/list/PokemonList.tsx
rename to src/components/dex/PokemonDex.tsx
index 9304feb..f23c93d 100644
--- a/src/components/list/PokemonList.tsx
+++ b/src/components/dex/PokemonDex.tsx
@@ -1,10 +1,10 @@
-import styles from './PokemonList.module.scss';
-import PokemonListElement from './PokemonListElement';
+import styles from './PokemonDex.module.scss';
+import PokemonDexElement from './PokemonDexElement';
import Inner from '../Inner';
import useFilteredPokemonData from '@/hook/useFilteredPokemonData';
import useVisibleDataByScroll from '@/hook/useVisibleDataByScroll';
-const PokemonList = () => {
+const PokemonDex = () => {
const filteredData = useFilteredPokemonData();
const visibleData = useVisibleDataByScroll(filteredData);
@@ -13,7 +13,7 @@ const PokemonList = () => {
{visibleData.length
? visibleData.map((data) => (
-
+
))
: null}
@@ -21,4 +21,4 @@ const PokemonList = () => {
);
};
-export default PokemonList;
+export default PokemonDex;
diff --git a/src/components/list/PokemonListElement.tsx b/src/components/dex/PokemonDexElement.tsx
similarity index 78%
rename from src/components/list/PokemonListElement.tsx
rename to src/components/dex/PokemonDexElement.tsx
index 7a84e5d..e50fa1c 100644
--- a/src/components/list/PokemonListElement.tsx
+++ b/src/components/dex/PokemonDexElement.tsx
@@ -1,20 +1,20 @@
import { useNavigate } from 'react-router-dom';
-import styles from './PokemonList.module.scss';
+import styles from './PokemonDex.module.scss';
import { reverseObject } from '@/lib/util/reverseObject';
import { POKEMON_NAME } from '@/lib/pokemonName';
import { POKEMON_TYPES } from '@/lib/constants';
import Plate from '../plate/Plate';
import { PokemonType, TypesType } from '@/lib/type';
-import PokemonListElementLayout from './PokemonListElementLayout';
+import PokemonDexElementLayout from './PokemonDexElementLayout';
-interface PokemonListElementProp {
+interface PokemonDexElementProp {
data: PokemonType;
}
-const PokemonListElement = ({ data }: PokemonListElementProp) => {
+const PokemonDexElement = ({ data }: PokemonDexElementProp) => {
const navigate = useNavigate();
return (
-
{
navigate(`/pokemon/${data.id}`);
@@ -42,8 +42,8 @@ const PokemonListElement = ({ data }: PokemonListElementProp) => {
/>
))}
-
+
);
};
-export default PokemonListElement;
+export default PokemonDexElement;
diff --git a/src/components/list/PokemonListElementLayout.tsx b/src/components/dex/PokemonDexElementLayout.tsx
similarity index 52%
rename from src/components/list/PokemonListElementLayout.tsx
rename to src/components/dex/PokemonDexElementLayout.tsx
index f3198f1..558fc77 100644
--- a/src/components/list/PokemonListElementLayout.tsx
+++ b/src/components/dex/PokemonDexElementLayout.tsx
@@ -1,22 +1,28 @@
import { ReactNode } from 'react';
-import styles from './PokemonList.module.scss';
+import styles from './PokemonDex.module.scss';
import { PokemonType } from '@/lib/type';
+import { motion } from 'framer-motion';
-interface PokemonListElementLayoutProp {
+interface PokemonDexElementLayoutProp {
children: ReactNode;
data: PokemonType;
onClick?: () => void;
className?: string;
}
-const PokemonListElementLayout = ({
+const PokemonDexElementLayout = ({
children,
data,
onClick,
className,
-}: PokemonListElementLayoutProp) => {
+}: PokemonDexElementLayoutProp) => {
return (
-
@@ -24,8 +30,8 @@ const PokemonListElementLayout = ({
{`No.${data.id}`}
{children}
-
+
);
};
-export default PokemonListElementLayout;
+export default PokemonDexElementLayout;
diff --git a/src/pages/card/card.tsx b/src/pages/card/card.tsx
index 2b956e3..914cafe 100644
--- a/src/pages/card/card.tsx
+++ b/src/pages/card/card.tsx
@@ -1,9 +1,9 @@
-import CardPage from '@/components/cardEdit/CardPage';
+import CardEditPage from '@/components/cardMaker/CardEditPage';
const Card = () => {
return (
);
};
diff --git a/src/pages/dex/Dex.tsx b/src/pages/dex/Dex.tsx
index 4b74ea7..68269e5 100644
--- a/src/pages/dex/Dex.tsx
+++ b/src/pages/dex/Dex.tsx
@@ -1,11 +1,11 @@
-import PokemonList from '@/components/list/PokemonList';
+import PokemonDex from '@/components/dex/PokemonDex';
import FilterPlates from '@/components/plate/FilterPlates';
const Dex = () => {
return (
);
};
diff --git a/src/store/useSelectedPokemonForCard.ts b/src/store/useSelectedPokemonForCard.ts
index 761eeb8..efb002f 100644
--- a/src/store/useSelectedPokemonForCard.ts
+++ b/src/store/useSelectedPokemonForCard.ts
@@ -1,3 +1,6 @@
+// useSelectedPokemonForCard.ts
+
+import { POKEMON_NICKNAME1, POKEMON_NICKNAME2 } from '@/lib/constants';
import { PokemonType } from '@/lib/type';
import { create } from 'zustand';
@@ -10,6 +13,7 @@ interface useSelectedPokemonForCard {
setPokemonNickName1: (nickName: string) => void;
pokemonNickName2: string | null;
setPokemonNickName2: (nickName: string) => void;
+ generateRandomNicknames: () => void; // New function for generating random nicknames
}
const useSelectedPokemonForCard = create
((set) => ({
@@ -21,5 +25,14 @@ const useSelectedPokemonForCard = create((set) => ({
setPokemonNickName1: (nickName) => set({ pokemonNickName1: nickName }),
pokemonNickName2: null,
setPokemonNickName2: (nickName) => set({ pokemonNickName2: nickName }),
+
+ generateRandomNicknames: () => {
+ const randomIndex1 = Math.floor(Math.random() * POKEMON_NICKNAME1.length);
+ const randomIndex2 = Math.floor(Math.random() * POKEMON_NICKNAME2.length);
+
+ set({ pokemonNickName1: POKEMON_NICKNAME1[randomIndex1] });
+ set({ pokemonNickName2: POKEMON_NICKNAME2[randomIndex2] });
+ },
}));
+
export default useSelectedPokemonForCard;