Commit c0602245 authored by Ondrej Bazala's avatar Ondrej Bazala
Browse files

Added package and main tsx for Encylopedia page

parent db476722
import { Button, Menu, Layout } from 'antd';
import { Button, Layout, Menu } from 'antd';
import {
BrowserRouter,
Link,
......@@ -7,18 +7,17 @@ import {
useHistory
} from 'react-router-dom';
import {
HomeOutlined,
RocketOutlined,
BookOutlined,
DollarOutlined,
FundOutlined,
HomeOutlined,
LogoutOutlined,
BookOutlined,
FundOutlined
RocketOutlined
} from '@ant-design/icons';
import './App.css';
const { Content } = Layout;
import { useMemo } from 'react';
import Encyclopedia from './pages/Encyclopedia';
import Encyclopedia from './pages/encyclopedia/Encyclopedia';
import Home from './pages/Home/Home';
import Leaderboard from './pages/Leaderboard/Leaderboard';
import Store from './pages/Store/Store';
......@@ -35,6 +34,8 @@ import GamePage from './pages/Game/GamePage';
import { NotFoundPage } from './pages/NotFoundPage';
import { Forbidden } from './pages/Forbidden';
const { Content } = Layout;
const TopMenu = () => {
const { user } = useLoggedInUser();
const isLoggedIn = useMemo(() => user !== undefined, [user]);
......
import { Typography } from 'antd';
import usePageTitle from '../hooks/usePageTitle';
const Encyclopedia = () => {
usePageTitle('Encyclopedia');
return <Typography>Encyclopedia</Typography>;
};
export default Encyclopedia;
import { useMemo, useState } from 'react';
import usePageTitle from '../../hooks/usePageTitle';
import { Pokemon } from '../../utils/pokemonFetcher';
import { pokemons as allPokemons } from '../../data/pokemons';
import Filter from './Filter';
import PokemonCards from './PokemonCards';
const Encyclopedia = () => {
usePageTitle('Encyclopedia');
const pokemons = useMemo<Pokemon[]>(() => allPokemons, []);
const [filteredPokemons, setFilteredPokemons] = useState<Pokemon[]>(pokemons);
return (
<>
<Filter pokemons={pokemons} updateVisiblePokemons={setFilteredPokemons} />
<PokemonCards pokemons={filteredPokemons} />
</>
);
};
export default Encyclopedia;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment