refactor: move filter bar to GameList and fix button styling

- Moved filter button bar from App.jsx to GameList.jsx for better separation of concerns.
- Updated GameList to accept filter/setFilter props and render the filter bar internally.
- Moved .new-game-button styles to global CSS for consistent styling.
- Ensured filter button styles remain in GameList.module.css.
- Improves modularity and UI consistency.
This commit is contained in:
Frank Schwenk
2025-06-06 12:22:55 +02:00
parent 8384d08393
commit b44b013f58
4 changed files with 158 additions and 25 deletions

View File

@@ -38,9 +38,114 @@
cursor: pointer;
touch-action: manipulation;
}
.filter-buttons {
display: flex;
gap: 8px;
margin: 24px 0 16px 0;
}
.filter-button {
flex: 1;
background: #333;
color: #fff;
border: none;
border-radius: 0;
font-size: 1.2rem;
padding: 18px 0;
cursor: pointer;
font-weight: 500;
transition: background 0.2s, color 0.2s;
}
.filter-button.active {
background: #4CAF50;
color: #fff;
}
.games-container {
width: 100%;
display: flex;
flex-direction: column;
gap: 16px;
margin-top: 24px;
}
.game-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1.5rem;
border-radius: 0.5rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
transition: transform 0.1s ease, background-color 0.2s ease;
cursor: pointer;
}
.game-item.active {
background: #1e4620;
}
.game-item.completed {
background: #333;
opacity: 0.85;
}
.game-info {
flex: 1;
display: flex;
align-items: center;
gap: 2rem;
}
.game-type {
font-weight: bold;
font-size: 1.5rem;
min-width: 8rem;
color: #fff;
}
.player-names {
color: #fff;
font-size: 1.5rem;
min-width: 16rem;
}
.game-scores {
font-size: 2rem;
font-weight: bold;
min-width: 6rem;
text-align: center;
color: #fff;
}
.delete-button {
width: 3rem;
height: 3rem;
border: none;
background: #ff4444;
color: white;
border-radius: 50%;
font-size: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
margin-left: 1rem;
transition: background-color 0.2s;
position: relative;
}
.delete-button::before {
content: '\1F5D1'; /* 🗑️ */
font-size: 1.5rem;
}
.delete-button:hover {
background: #cc0000;
}
.delete-button:active {
transform: scale(0.95);
}
.empty-state {
text-align: center;
padding: 2rem;
color: #666;
font-size: 1.5rem;
}
.page-header {
font-size: 2rem;
font-weight: 700;
color: #fff;
background: #181818;
padding: 24px 0 16px 0;
margin-bottom: 8px;
text-align: left;
width: 100%;
letter-spacing: 0.5px;
}