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 { import {
BrowserRouter, BrowserRouter,
Link, Link,
...@@ -7,18 +7,17 @@ import { ...@@ -7,18 +7,17 @@ import {
useHistory useHistory
} from 'react-router-dom'; } from 'react-router-dom';
import { import {
HomeOutlined, BookOutlined,
RocketOutlined,
DollarOutlined, DollarOutlined,
FundOutlined,
HomeOutlined,
LogoutOutlined, LogoutOutlined,
BookOutlined, RocketOutlined
FundOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import './App.css'; import './App.css';
const { Content } = Layout;
import { useMemo } from 'react'; import { useMemo } from 'react';
import Encyclopedia from './pages/Encyclopedia'; import Encyclopedia from './pages/encyclopedia/Encyclopedia';
import Home from './pages/Home/Home'; import Home from './pages/Home/Home';
import Leaderboard from './pages/Leaderboard/Leaderboard'; import Leaderboard from './pages/Leaderboard/Leaderboard';
import Store from './pages/Store/Store'; import Store from './pages/Store/Store';
...@@ -35,6 +34,8 @@ import GamePage from './pages/Game/GamePage'; ...@@ -35,6 +34,8 @@ import GamePage from './pages/Game/GamePage';
import { NotFoundPage } from './pages/NotFoundPage'; import { NotFoundPage } from './pages/NotFoundPage';
import { Forbidden } from './pages/Forbidden'; import { Forbidden } from './pages/Forbidden';
const { Content } = Layout;
const TopMenu = () => { const TopMenu = () => {
const { user } = useLoggedInUser(); const { user } = useLoggedInUser();
const isLoggedIn = useMemo(() => user !== undefined, [user]); 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;
Supports Markdown
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