Skip to content

Commit a346833

Browse files
committed
Restyle
1 parent 0060fc4 commit a346833

File tree

3 files changed

+26
-38
lines changed

3 files changed

+26
-38
lines changed

src/App.css

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,3 @@
66
color: #f6f6f6;
77
background-color: #2f2f2f;
88
}
9-
10-
input,
11-
button {
12-
border-radius: 8px;
13-
border: 1px solid transparent;
14-
padding: 0.6em 1.2em;
15-
font-size: 1em;
16-
font-weight: 500;
17-
font-family: inherit;
18-
color: #ffffff;
19-
background-color: #0f0f0f98;
20-
transition: border-color 0.25s;
21-
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
22-
}

src/App.tsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,27 @@ function App() {
2525
}
2626

2727
return (
28-
<div className="m-0 pt-[5vh] flex flex-col justify-between h-screen text-center">
28+
<div className="text-center">
29+
<p className="text-xs my-2"><span className="font-bold italic">Note:</span> Type effectiveness multipliers may vary in other games outside the core series.</p>
30+
31+
<form
32+
className="flex flex-col justify-center mb-10"
33+
onSubmit={(e) => {
34+
e.preventDefault();
35+
searchPokemon();
36+
}}
37+
>
38+
39+
<div className="flex justify-center gap-3">
40+
<input
41+
id="pokemon-input"
42+
onChange={(e) => setName(e.currentTarget.value.toLowerCase())}
43+
placeholder="Enter a Pokémon name..."
44+
className="cursor-pointer text-lg border-1 rounded-lg py-2 px-4 bg-[#0f0f0f98] focus:outline-none focus:ring-1 focus:ring-red-500"
45+
/>
46+
<button type="submit" className="cursor-pointer text-lg border-1 rounded-lg py-2 px-4 bg-[#0f0f0f98] hover:ring-1 hover:ring-red-500">Find</button>
47+
</div>
48+
</form>
2949
<div>
3050
{pokemonData ? (
3151
<div>
@@ -38,7 +58,7 @@ function App() {
3858
<p className="mt-2">
3959
<strong>Type:</strong> {pokemonData?.types?.map((type: any) => capitalize(type.type.name)).join(", ")}
4060
</p>
41-
<div className="mt-10">
61+
<div>
4262
{pokemonData?.weaknesses ? (
4363
['2x', '0.5x', '0x'].map((multiplier) => (
4464
<CollapsibleSection key={multiplier} title={`${multiplier} ${multiplier === '2x' ? 'Weaknesses' : multiplier === '0.5x' ? 'Resistances' : 'Immunities'}`}>
@@ -67,24 +87,6 @@ function App() {
6787
</div>
6888

6989
{error && <p className="text-red-500">{error}</p>}
70-
71-
<form
72-
className="flex flex-col justify-center gap-2 mt-2"
73-
onSubmit={(e) => {
74-
e.preventDefault();
75-
searchPokemon();
76-
}}
77-
>
78-
<div className="flex justify-center gap-2 mt-2">
79-
<input
80-
id="pokemon-input"
81-
onChange={(e) => setName(e.currentTarget.value.toLowerCase())}
82-
placeholder="Enter a Pokémon name..."
83-
/>
84-
<button type="submit" className="cursor-pointer">Find</button>
85-
</div>
86-
<p className="text-xs italic">Note: Type effectiveness multipliers may vary in other games outside the core series.</p>
87-
</form>
8890
</div>
8991
);
9092
}

src/components/CollapsibleSection.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const CollapsibleSection: React.FC<CollapsibleSectionProps> = ({ title, children
99
const [isOpen, setIsOpen] = useState(false);
1010

1111
return (
12-
<div className="mb-2">
12+
<div className="">
1313
<button
14-
className="text-lg font-bold w-64 mt-5"
14+
className="text-lg font-bold mt-4 w-56 border-1 rounded-lg py-2 px-4 bg-[#0f0f0f98] hover:ring-1 hover:ring-red-500"
1515
onClick={() => setIsOpen(!isOpen)}
1616
>
17-
{title} {isOpen ? "▲" : "▼"}
17+
<p className="flex justify-between">{title} <span>{isOpen ? "▲" : "▼"}</span></p>
1818
</button>
19-
{isOpen && <div className="ml-4 mt-2">{children}</div>}
19+
{isOpen && <div className="">{children}</div>}
2020
</div>
2121
);
2222
};

0 commit comments

Comments
 (0)