-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93066e4
commit 1ae590f
Showing
14 changed files
with
243 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import { ColorSchemeToggle } from "@/components/ColorSchemeToggle" | ||
import { Container } from "@mantine/core" | ||
import { Container, Flex, Title } from "@mantine/core" | ||
import { SearchBar } from "@/components/SearchBar" | ||
import { PokemonList } from "@/components/PokemonList" | ||
import { NavBar } from "@/components/NavBar" | ||
|
||
export default function Home() { | ||
return ( | ||
<Container fluid className="overflow-hidden"> | ||
<ColorSchemeToggle /> | ||
<SearchBar /> | ||
<PokemonList /> | ||
<Container fluid className="h-screen overflow-hidden"> | ||
<NavBar /> | ||
<Flex | ||
className="h-full" | ||
justify="center" | ||
align="center" | ||
direction="column" | ||
> | ||
<Title order={1}>PokeData</Title> | ||
<SearchBar /> | ||
</Flex> | ||
</Container> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client" | ||
import { Container } from "@mantine/core" | ||
import { NavBar } from "@/components/NavBar" | ||
import { PokemonList } from "@/components/PokemonList" | ||
|
||
export default function PokemonName() { | ||
return ( | ||
<Container fluid className="overflow-hidden w-full md:w-3/4 lg:w-1/2"> | ||
<NavBar /> | ||
<PokemonList /> | ||
</Container> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"use client" | ||
import { Badge, NavLink } from "@mantine/core" | ||
import { | ||
IconNotebook, | ||
IconSearch, | ||
} from "@tabler/icons-react" | ||
import { useDisclosure } from "@mantine/hooks" | ||
import { Drawer, Burger, Container } from "@mantine/core" | ||
import { ColorSchemeToggle } from "./ColorSchemeToggle" | ||
import { useRouter } from "next/navigation" | ||
|
||
export const NavBar = () => { | ||
const [opened, { open, close }] = useDisclosure(false) | ||
const router = useRouter() | ||
return ( | ||
<> | ||
<Drawer opened={opened} onClose={close} title="Menu"> | ||
<NavLink | ||
label="Search" | ||
leftSection={<IconSearch size="1rem" stroke={1.5} />} | ||
onClick={() => router.push("/")} | ||
/> | ||
<NavLink | ||
label="Pokedex" | ||
leftSection={<IconNotebook size="1rem" stroke={1.5} />} | ||
onClick={() => router.push("/pokedex")} | ||
/> | ||
<ColorSchemeToggle /> | ||
</Drawer> | ||
<Container fluid h={50}> | ||
<Burger onClick={open} aria-label="Toggle navigation" className="absolute left-4 top-4"></Burger> | ||
</Container> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Text, Image, Stack, Title, Group, Table } from "@mantine/core" | ||
|
||
interface PokemonCPRangeProps { | ||
pokemon: Record<string, any> | ||
} | ||
|
||
export const PokemonCPRange: React.FC<PokemonCPRangeProps> = ({ | ||
pokemon: { cp_range }, | ||
}) => { | ||
const renderCP = cp_range?.map((cp: { level: number; range: string }) => ( | ||
<Table.Tr key={cp.level}> | ||
<Table.Td>{cp.level}</Table.Td> | ||
<Table.Td align="right">{cp.range}</Table.Td> | ||
</Table.Tr> | ||
)) | ||
|
||
return ( | ||
<Table > | ||
<Table.Thead> | ||
<Table.Tr> | ||
<Table.Th>Level</Table.Th> | ||
<Table.Th className="flex justify-end items-end">CP</Table.Th> | ||
</Table.Tr> | ||
</Table.Thead> | ||
<Table.Tbody >{renderCP}</Table.Tbody> | ||
</Table> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.