-
{game.title}
+
{game.title}{game.subtitle ? `, ${game.subtitle}` : null}
+
+ {game.type == "extension" ?
Extension
:
Jeu de base
}
+
{game.players}
+
{game.duration}
+
{game.ages}
+
diff --git a/src/pages/Home.css b/src/pages/Home.css
index 652c1bc..8d1073a 100644
--- a/src/pages/Home.css
+++ b/src/pages/Home.css
@@ -24,6 +24,10 @@ body {
.search {
margin: 20px;
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ justify-content: center;
}
.search-input {
@@ -70,6 +74,9 @@ body {
}
.game-right {
+ display: flex;
+ flex-direction: column;
+ gap: 15px;
width: 55vw;
margin-right: 10vw;
}
@@ -81,6 +88,41 @@ body {
gap: 15px;
}
+.tags {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ gap: 5px;
+}
+
+.tag {
+ background-color: #b4d666;
+ padding: 7px 10px;
+ border-radius: 15px;
+ margin: 0;
+}
+
+.basegame {
+ background-color: #66d6bf;
+}
+
+.extension {
+ background-color: #e99731;
+}
+
+.players {
+ background-color: #fae294;
+}
+
+.duration {
+ background-color: #c892c4;
+}
+
+.ages {
+ background-color: #92c8b5;
+}
+
.helpers {
justify-content: center;
align-items: center;
@@ -139,6 +181,10 @@ body {
font-size: 17px;
}
+ .tags{
+ flex-direction: column;
+ }
+
.helpers {
flex-direction: column;
}
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
index b9b76c8..da2fa44 100644
--- a/src/pages/Home.jsx
+++ b/src/pages/Home.jsx
@@ -48,6 +48,7 @@ export default function Home() {
function handleSearchChange(event) {
setName(event.target.value);
+ setCurrentPage(1);
};
const filteredGames = games.filter((game) =>
@@ -64,6 +65,10 @@ export default function Home() {
}
}
+ function resetSearch() {
+ setName("");
+ }
+
const currentGames = filteredGames.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage);
if (userloading) {
@@ -84,6 +89,7 @@ export default function Home() {