diff options
| author | Wolfboy248 <121288977+Wolfboy248@users.noreply.github.com> | 2024-09-04 10:19:24 +0200 |
|---|---|---|
| committer | Wolfboy248 <121288977+Wolfboy248@users.noreply.github.com> | 2024-09-04 10:19:24 +0200 |
| commit | 441e6e4a8e107172d2743afb58071a4edfc853b6 (patch) | |
| tree | c9c82df4f309f6b2bc552ccb585411443bdf2288 /frontend/src/components/GameCategory.tsx | |
| parent | refactor: dont ignore config file, small fix in profile (diff) | |
| download | lphub-441e6e4a8e107172d2743afb58071a4edfc853b6.tar.gz lphub-441e6e4a8e107172d2743afb58071a4edfc853b6.tar.bz2 lphub-441e6e4a8e107172d2743afb58071a4edfc853b6.zip | |
[#189 + #193] Games page fix
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/components/GameCategory.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/frontend/src/components/GameCategory.tsx b/frontend/src/components/GameCategory.tsx new file mode 100644 index 0000000..3291e09 --- /dev/null +++ b/frontend/src/components/GameCategory.tsx | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | import React from 'react'; | ||
| 2 | import { Link } from "react-router-dom"; | ||
| 3 | |||
| 4 | import { Game, GameCategoryPortals } from '../types/Game'; | ||
| 5 | import "../css/Games.css" | ||
| 6 | |||
| 7 | interface GameCategoryProps { | ||
| 8 | game: Game; | ||
| 9 | cat: GameCategoryPortals; | ||
| 10 | } | ||
| 11 | |||
| 12 | const GameCategory: React.FC<GameCategoryProps> = ({cat, game}) => { | ||
| 13 | return ( | ||
| 14 | <Link className="games-page-item-body-item" to={"/games/" + game.id + "?cat=" + cat.category.id}> | ||
| 15 | <div> | ||
| 16 | <span className='games-page-item-body-item-title'>{cat.category.name}</span> | ||
| 17 | <br /> | ||
| 18 | <span className='games-page-item-body-item-num'>{cat.portal_count}</span> | ||
| 19 | </div> | ||
| 20 | </Link> | ||
| 21 | ) | ||
| 22 | } | ||
| 23 | |||
| 24 | export default GameCategory; | ||