Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ondřej Bazala
PV247
Commits
c0602245
Commit
c0602245
authored
Dec 05, 2021
by
Ondrej Bazala
Browse files
Added package and main tsx for Encylopedia page
parent
db476722
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/App.tsx
View file @
c0602245
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
]);
...
...
src/pages/Encyclopedia.tsx
deleted
100644 → 0
View file @
db476722
import
{
Typography
}
from
'
antd
'
;
import
usePageTitle
from
'
../hooks/usePageTitle
'
;
const
Encyclopedia
=
()
=>
{
usePageTitle
(
'
Encyclopedia
'
);
return
<
Typography
>
Encyclopedia
</
Typography
>;
};
export
default
Encyclopedia
;
src/pages/encyclopedia/Encyclopedia.tsx
0 → 100644
View file @
c0602245
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
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment