From 086b3aaed18c0f3cf401ebfe48134cbcf3cee749 Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 13:07:55 +0100 Subject: [PATCH 1/8] refactor: implemented simple .css into .tsx --- frontend/src/App.tsx | 2 +- frontend/src/components/GameListItem.tsx | 42 +++++++++++++++++++ .../GameListItem/GameListItem.module.css | 36 ---------------- .../components/GameListItem/GameListItem.tsx | 40 ------------------ .../src/components/{Header => }/Header.tsx | 18 ++++---- .../src/components/Header/Header.module.css | 39 ----------------- frontend/src/components/Layout.tsx | 7 ++++ .../src/components/Layout/Layout.module.css | 5 --- frontend/src/components/Layout/Layout.tsx | 6 --- frontend/src/pages/GameDetails.tsx | 4 +- .../src/pages/{GamesGrid => }/GamesGrid.tsx | 18 ++++---- .../src/pages/GamesGrid/GamesGrid.module.css | 7 ---- frontend/src/pages/MyRatings.tsx | 2 +- 13 files changed, 73 insertions(+), 153 deletions(-) create mode 100644 frontend/src/components/GameListItem.tsx delete mode 100644 frontend/src/components/GameListItem/GameListItem.module.css delete mode 100644 frontend/src/components/GameListItem/GameListItem.tsx rename frontend/src/components/{Header => }/Header.tsx (77%) delete mode 100644 frontend/src/components/Header/Header.module.css create mode 100644 frontend/src/components/Layout.tsx delete mode 100644 frontend/src/components/Layout/Layout.module.css delete mode 100644 frontend/src/components/Layout/Layout.tsx rename frontend/src/pages/{GamesGrid => }/GamesGrid.tsx (94%) delete mode 100644 frontend/src/pages/GamesGrid/GamesGrid.module.css diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index cc94a32..b430de1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,6 +1,6 @@ import "bootstrap/dist/css/bootstrap.min.css"; import { BrowserRouter, Route, Routes } from "react-router-dom"; -import GamesGrid from "./pages/GamesGrid/GamesGrid"; +import GamesGrid from "./pages/GamesGrid"; import GameDetails from "./pages/GameDetails"; import MyRatings from "./pages/MyRatings"; diff --git a/frontend/src/components/GameListItem.tsx b/frontend/src/components/GameListItem.tsx new file mode 100644 index 0000000..e109f32 --- /dev/null +++ b/frontend/src/components/GameListItem.tsx @@ -0,0 +1,42 @@ +import { Image } from "react-bootstrap"; +import { Link } from "react-router-dom"; +import StarRating from "./StarRating"; + +interface GameListItemProps { + id: string; + title: string; + year: number | null; + tags: string; + rating: number | null; + image: string; + striped: boolean; +} + +export default function GameListItem({ + id, + title, + year, + tags, + rating, + image, + striped, +}: GameListItemProps) { + return ( + + {title} +
+

{title}

+

{year ?? "—"}

+

{tags || "—"}

+ +
+ + ); +} diff --git a/frontend/src/components/GameListItem/GameListItem.module.css b/frontend/src/components/GameListItem/GameListItem.module.css deleted file mode 100644 index 7c5a6c5..0000000 --- a/frontend/src/components/GameListItem/GameListItem.module.css +++ /dev/null @@ -1,36 +0,0 @@ -.row { - display: flex; - align-items: center; - flex: 1 1 0; - min-height: var(--row-min-height); - gap: 1.5rem; - padding: 0 1.5rem; - color: inherit; - text-decoration: none; -} - -.odd { - background-color: var(--color-stripe-odd); -} - -.even { - background-color: var(--color-stripe-even); -} - -.image { - width: 95px; - height: 95px; - object-fit: cover; - background-color: #ddd; - flex-shrink: 0; -} - -.info p { - margin: 0; -} - -.title { - margin: 0 0 0.25rem; - font-size: 1.1rem; - font-weight: 700; -} diff --git a/frontend/src/components/GameListItem/GameListItem.tsx b/frontend/src/components/GameListItem/GameListItem.tsx deleted file mode 100644 index 9c6953a..0000000 --- a/frontend/src/components/GameListItem/GameListItem.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Image } from "react-bootstrap"; -import { Link } from "react-router-dom"; -import styles from "./GameListItem.module.css"; -import StarRating from "../StarRating"; - -interface GameListItemProps { - id: string; - title: string; - year: number | null; - tags: string; - rating: number | null; - image: string; - striped: boolean; -} - -export default function GameListItem({ - id, - title, - year, - tags, - rating, - image, - striped, -}: GameListItemProps) { - return ( - - {title} -
-

{title}

-

{year ?? "—"}

-

{tags || "—"}

- {/*

{rating != null ? `${Number.isInteger(rating) ? rating.toFixed(0) : rating.toFixed(1)}/10` : "Not yet rated"}

*/} - -
- - ); -} diff --git a/frontend/src/components/Header/Header.tsx b/frontend/src/components/Header.tsx similarity index 77% rename from frontend/src/components/Header/Header.tsx rename to frontend/src/components/Header.tsx index fe38b96..74bbb22 100644 --- a/frontend/src/components/Header/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -8,9 +8,8 @@ import { useNavigate, useSearchParams, } from "react-router-dom"; -import { GRID_QUERY_STORAGE_KEY } from "../../constants/storageKeys"; -import styles from "./Header.module.css"; -import { useIsMobile } from "../../constants/global"; +import { GRID_QUERY_STORAGE_KEY } from "../constants/storageKeys"; +import { useIsMobile } from "../constants/global"; export default function Header() { const navigate = useNavigate(); @@ -54,14 +53,17 @@ export default function Header() { } return ( -
- +
+ { isMobile ? : "Working Title" } -
- + + - + { isMobile ? :"My Ratings" }
diff --git a/frontend/src/components/Header/Header.module.css b/frontend/src/components/Header/Header.module.css deleted file mode 100644 index 30c4aeb..0000000 --- a/frontend/src/components/Header/Header.module.css +++ /dev/null @@ -1,39 +0,0 @@ -.header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; - height: var(--header-height); - padding: 0 1.5rem; - background-color: var(--color-brand); -} - -.brand, -.link { - font-weight: 700; - color: var(--color-text); - white-space: nowrap; - text-decoration: none; -} - -.search { - flex: 1; - max-width: 420px; -} - -.search :global(.input-group) { - border-radius: 999px; - overflow: hidden; -} - -.search :global(.form-control) { - border: none; -} - -.search :global(.form-control:focus) { - box-shadow: none; -} - -.search :global(.btn) { - border: none; -} diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx new file mode 100644 index 0000000..7b18c12 --- /dev/null +++ b/frontend/src/components/Layout.tsx @@ -0,0 +1,7 @@ +import type { ReactNode } from "react"; + +export default function Layout({ children }: { children: ReactNode }) { + return
+ {children} +
; +} diff --git a/frontend/src/components/Layout/Layout.module.css b/frontend/src/components/Layout/Layout.module.css deleted file mode 100644 index 52611a0..0000000 --- a/frontend/src/components/Layout/Layout.module.css +++ /dev/null @@ -1,5 +0,0 @@ -.shell { - width: 100%; - max-width: var(--content-width); - margin: 0 auto; -} diff --git a/frontend/src/components/Layout/Layout.tsx b/frontend/src/components/Layout/Layout.tsx deleted file mode 100644 index ced9683..0000000 --- a/frontend/src/components/Layout/Layout.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import type { ReactNode } from "react"; -import styles from "./Layout.module.css"; - -export default function Layout({ children }: { children: ReactNode }) { - return
{children}
; -} diff --git a/frontend/src/pages/GameDetails.tsx b/frontend/src/pages/GameDetails.tsx index c25ff40..c5869d6 100644 --- a/frontend/src/pages/GameDetails.tsx +++ b/frontend/src/pages/GameDetails.tsx @@ -4,8 +4,8 @@ import { useParams } from "react-router-dom"; import { gql } from "@apollo/client"; import { useMutation, useQuery } from "@apollo/client/react"; import { uri as graphqlUri } from "../apolloClient"; -import Header from "../components/Header/Header"; -import Layout from "../components/Layout/Layout"; +import Header from "../components/Header"; +import Layout from "../components/Layout"; import StarRating from "../components/StarRating"; import { getUserId } from "../utils/userId"; import { useIsMobile } from "../constants/global"; diff --git a/frontend/src/pages/GamesGrid/GamesGrid.tsx b/frontend/src/pages/GamesGrid.tsx similarity index 94% rename from frontend/src/pages/GamesGrid/GamesGrid.tsx rename to frontend/src/pages/GamesGrid.tsx index 69db842..6359375 100644 --- a/frontend/src/pages/GamesGrid/GamesGrid.tsx +++ b/frontend/src/pages/GamesGrid.tsx @@ -2,22 +2,21 @@ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; import { gql } from "@apollo/client"; import { useQuery } from "@apollo/client/react"; import { useSearchParams } from "react-router-dom"; -import Header from "../../components/Header/Header"; -import Layout from "../../components/Layout/Layout"; -import Toolbar from "../../components/Toolbar/Toolbar"; -import GameListItem from "../../components/GameListItem/GameListItem"; +import Header from "../components/Header"; +import Layout from "../components/Layout"; +import Toolbar from "../components/Toolbar/Toolbar"; +import GameListItem from "../components/GameListItem"; import { GRID_PAGE_STORAGE_KEY, GRID_QUERY_STORAGE_KEY, -} from "../../constants/storageKeys"; +} from "../constants/storageKeys"; import { DEFAULT_SORT, hasActiveFilters, type GameFilters, type SortField, type SortState, -} from "../../types/gameQuery"; -import styles from "./GamesGrid.module.css"; +} from "../types/gameQuery"; const GET_GAMES = gql` query GetGames( @@ -255,7 +254,10 @@ export default function GamesGrid() { sort={sort} onSortChange={updateSort} /> -
+

{!loading && `${totalCount} game${totalCount === 1 ? "" : "s"} found`}

diff --git a/frontend/src/pages/GamesGrid/GamesGrid.module.css b/frontend/src/pages/GamesGrid/GamesGrid.module.css deleted file mode 100644 index 2daf25e..0000000 --- a/frontend/src/pages/GamesGrid/GamesGrid.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.list { - display: flex; - flex-direction: column; - height: calc(100vh - var(--header-height) - var(--toolbar-height)); - overflow: hidden; -} - diff --git a/frontend/src/pages/MyRatings.tsx b/frontend/src/pages/MyRatings.tsx index 82efe80..24497d7 100644 --- a/frontend/src/pages/MyRatings.tsx +++ b/frontend/src/pages/MyRatings.tsx @@ -1,7 +1,7 @@ import { useMemo } from "react"; import { gql } from "@apollo/client"; import { useQuery } from "@apollo/client/react"; -import Header from "../components/Header/Header"; +import Header from "../components/Header"; import { getUserId } from "../utils/userId"; import Card from "react-bootstrap/esm/Card"; import StarRating from "../components/StarRating"; From 749b0cd9a0055d85955eee542339af75ea3ed77b Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 13:18:05 +0100 Subject: [PATCH 2/8] fix: #61 - details reload the page --- frontend/src/pages/MyRatings.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/MyRatings.tsx b/frontend/src/pages/MyRatings.tsx index 24497d7..4dbdf31 100644 --- a/frontend/src/pages/MyRatings.tsx +++ b/frontend/src/pages/MyRatings.tsx @@ -6,6 +6,7 @@ import { getUserId } from "../utils/userId"; import Card from "react-bootstrap/esm/Card"; import StarRating from "../components/StarRating"; import { useIsMobile } from "../constants/global"; +import { Link } from "react-router-dom"; const GET_MY_REVIEWS = gql` query GetMyReviews($userId: String!) { @@ -109,9 +110,9 @@ export default function MyRatings() {
{ratings.map(({ game, score }) => (
- - +
))}
From 1bcf1e570a412149398fe9f04908393541d50920 Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 13:31:30 +0100 Subject: [PATCH 3/8] fix: #48 - star size on mobile in MyRatings --- frontend/src/pages/MyRatings.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/MyRatings.tsx b/frontend/src/pages/MyRatings.tsx index 4dbdf31..b7e1102 100644 --- a/frontend/src/pages/MyRatings.tsx +++ b/frontend/src/pages/MyRatings.tsx @@ -107,7 +107,7 @@ export default function MyRatings() {

You haven’t rated any games yet.

)} {!error && ( -
+
{ratings.map(({ game, score }) => (
{game.name}
- +
From b2a0e507a674d3ec93acdbbdeac990f09db0ea4b Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 13:54:06 +0100 Subject: [PATCH 4/8] fix: #48 - stars in game details on mobile --- frontend/src/pages/GameDetails.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/GameDetails.tsx b/frontend/src/pages/GameDetails.tsx index c5869d6..80210c8 100644 --- a/frontend/src/pages/GameDetails.tsx +++ b/frontend/src/pages/GameDetails.tsx @@ -116,6 +116,7 @@ export default function GameDetails() { const { id } = useParams<{ id: string }>(); const isMobile = useIsMobile(); const userId = useMemo(() => getUserId(), []); + const imageSize: number = isMobile ? 150 : 220; const { data, loading, error } = useQuery(GET_GAME, { variables: { id }, @@ -207,21 +208,21 @@ export default function GameDetails() {

{game.name}

- + {game.name}

NTNU Rating

- +

Your Rating

- +
From 6a9fa0a55824e92d9bdf0dc78ecbef1b3bf580c7 Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 14:05:28 +0100 Subject: [PATCH 5/8] fix: #63 - added border color grey for unchecked check items in Toolbar.css. --- frontend/src/components/Toolbar/Toolbar.module.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/Toolbar/Toolbar.module.css b/frontend/src/components/Toolbar/Toolbar.module.css index 52d9fb7..901e1a4 100644 --- a/frontend/src/components/Toolbar/Toolbar.module.css +++ b/frontend/src/components/Toolbar/Toolbar.module.css @@ -133,6 +133,10 @@ white-space: nowrap; } +.checkOption :global(.form-check-input:not(:checked)) { + border-color: grey; +} + .panelRow { display: flex; flex-wrap: wrap; From 97732efbcfb37efde36b34afaaee9fd4a1d00d4b Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 14:20:09 +0100 Subject: [PATCH 6/8] fix: #55 - added missing lazy loads to images --- frontend/src/components/GameListItem.tsx | 4 +++- frontend/src/pages/GameDetails.tsx | 1 + frontend/src/pages/MyRatings.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/GameListItem.tsx b/frontend/src/components/GameListItem.tsx index e109f32..51e9be9 100644 --- a/frontend/src/components/GameListItem.tsx +++ b/frontend/src/components/GameListItem.tsx @@ -30,7 +30,9 @@ export default function GameListItem({ {title} + alt={title} + loading="lazy" + />

{title}

{year ?? "—"}

diff --git a/frontend/src/pages/GameDetails.tsx b/frontend/src/pages/GameDetails.tsx index 80210c8..f5c67ce 100644 --- a/frontend/src/pages/GameDetails.tsx +++ b/frontend/src/pages/GameDetails.tsx @@ -214,6 +214,7 @@ export default function GameDetails() { style={{ width: ` ${imageSize}px`, height: ` ${imageSize}px`, backgroundColor: `var(--color-stripe-odd)` }} src={game.imageUrl ?? ""} alt={game.name} + loading="lazy" />
diff --git a/frontend/src/pages/MyRatings.tsx b/frontend/src/pages/MyRatings.tsx index b7e1102..5ed0f19 100644 --- a/frontend/src/pages/MyRatings.tsx +++ b/frontend/src/pages/MyRatings.tsx @@ -123,6 +123,7 @@ export default function MyRatings() { height: "11rem", objectFit: "cover", }} + loading="lazy" /> {game.name} From 46192af53c89600f83b26a378ba6cdd544c03c5a Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 14:35:16 +0100 Subject: [PATCH 7/8] fix: #68 - aria-label for icons on header --- frontend/src/components/Header.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 74bbb22..5e99558 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -57,7 +57,7 @@ export default function Header() { style={{ backgroundColor: "var(--color-brand)", height: "var(--header-height)" }} > - { isMobile ? : "Working Title" } + { isMobile ? : "Working Title" }
@@ -84,7 +84,7 @@ export default function Header() {
- { isMobile ? :"My Ratings" } + { isMobile ? :"My Ratings" }
); From a430a2698357dbbffcea3d0b1df54e428dd383ea Mon Sep 17 00:00:00 2001 From: Ayse Zeynep Aydin Date: Sun, 8 Nov 2026 14:43:20 +0100 Subject: [PATCH 8/8] fix: #56 - aria-labelledby is aria-label now --- frontend/src/pages/MyRatings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/MyRatings.tsx b/frontend/src/pages/MyRatings.tsx index 5ed0f19..999bd44 100644 --- a/frontend/src/pages/MyRatings.tsx +++ b/frontend/src/pages/MyRatings.tsx @@ -86,7 +86,7 @@ export default function MyRatings() {