From e13ebe1616ba794f505db51fa330631f0c50aaff Mon Sep 17 00:00:00 2001 From: carmennt Date: Tue, 17 Nov 2026 12:48:13 +0100 Subject: [PATCH 1/8] feat: restucture files --- Frontend/App.tsx | 16 +++++++-------- .../ActiveGameCard}/ActiveGameCard.css | 0 .../{ => ActiveGameCard}/ActiveGameCard.tsx | 14 ++++++------- .../src/{css => components/Footer}/Footer.css | 0 .../src/components/{ => Footer}/Footer.tsx | 0 .../src/{css => components/Header}/Header.css | 0 .../src/components/{ => Header}/Header.tsx | 0 .../PageHeading}/PageHeading.css | 0 .../{ => PageHeading}/PageHeading.tsx | 0 .../PassiveGameCard}/PassiveGameCard.css | 0 .../{ => PassiveGameCard}/PassiveGameCard.tsx | 0 .../ProfileEditor}/EditProfile.css | 0 .../{ => ProfileEditor}/ProfileEditor.tsx | 0 .../RecentReviews}/RecentReviews.css | 0 .../{ => RecentReviews}/RecentReviews.tsx | 0 .../{ => ReviewCard}/ReviewCard.tsx | 0 .../ReviewComposer}/ReviewComposer.css | 0 .../{ => ReviewComposer}/ReviewComposer.tsx | 0 .../{css => components/Reviews}/Reviews.css | 0 .../src/components/{ => Reviews}/Reviews.tsx | 6 +++--- .../UserReviews}/UserReviews.css | 0 .../{ => UserReviews}/UserReviews.tsx | 8 ++++---- Frontend/src/css/CreateAccountPage.css | 15 -------------- Frontend/src/css/LoginPage.css | 15 -------------- .../FriendsPage}/FriendsPage.css | 0 .../pages/{ => FriendsPage}/FriendsPage.tsx | 20 +++++++++---------- .../src/{css => pages/GamePage}/GamePage.css | 0 .../src/pages/{ => GamePage}/GamePage.tsx | 12 +++++------ .../src/{css => pages/MainPage}/MainPage.css | 0 .../src/pages/{ => MainPage}/MainPage.tsx | 20 +++++++++---------- .../ProfilePage}/ProfilePage.css | 0 .../pages/{ => ProfilePage}/ProfilePage.tsx | 18 ++++++++--------- .../{css => pages/SearchPage}/SearchPage.css | 0 .../src/pages/{ => SearchPage}/SearchPage.tsx | 16 +++++++-------- .../src/pages/{ => SignIn&SignUp}/SignIn.tsx | 10 +++++----- .../SignIn&SignUp}/SignInUpCard.css | 0 .../src/pages/{ => SignIn&SignUp}/SignUp.tsx | 10 +++++----- .../WishlistPage}/WishlistGameCard.css | 0 .../WishlistPage}/WishlistPage.css | 0 .../pages/{ => WishlistPage}/WishlistPage.tsx | 14 ++++++------- Frontend/src/tests/FriendsPage.test.tsx | 2 +- Frontend/src/tests/GamePage.test.tsx | 2 +- Frontend/src/tests/MainPage.test.tsx | 2 +- Frontend/src/tests/PageHeading.test.tsx | 2 +- Frontend/src/tests/SearchPage.test.tsx | 2 +- 45 files changed, 87 insertions(+), 117 deletions(-) rename Frontend/src/{css => components/ActiveGameCard}/ActiveGameCard.css (100%) rename Frontend/src/components/{ => ActiveGameCard}/ActiveGameCard.tsx (96%) rename Frontend/src/{css => components/Footer}/Footer.css (100%) rename Frontend/src/components/{ => Footer}/Footer.tsx (100%) rename Frontend/src/{css => components/Header}/Header.css (100%) rename Frontend/src/components/{ => Header}/Header.tsx (100%) rename Frontend/src/{css => components/PageHeading}/PageHeading.css (100%) rename Frontend/src/components/{ => PageHeading}/PageHeading.tsx (100%) rename Frontend/src/{css => components/PassiveGameCard}/PassiveGameCard.css (100%) rename Frontend/src/components/{ => PassiveGameCard}/PassiveGameCard.tsx (100%) rename Frontend/src/{css => components/ProfileEditor}/EditProfile.css (100%) rename Frontend/src/components/{ => ProfileEditor}/ProfileEditor.tsx (100%) rename Frontend/src/{css => components/RecentReviews}/RecentReviews.css (100%) rename Frontend/src/components/{ => RecentReviews}/RecentReviews.tsx (100%) rename Frontend/src/components/{ => ReviewCard}/ReviewCard.tsx (100%) rename Frontend/src/{css => components/ReviewComposer}/ReviewComposer.css (100%) rename Frontend/src/components/{ => ReviewComposer}/ReviewComposer.tsx (100%) rename Frontend/src/{css => components/Reviews}/Reviews.css (100%) rename Frontend/src/components/{ => Reviews}/Reviews.tsx (97%) rename Frontend/src/{css => components/UserReviews}/UserReviews.css (100%) rename Frontend/src/components/{ => UserReviews}/UserReviews.tsx (96%) delete mode 100644 Frontend/src/css/CreateAccountPage.css delete mode 100644 Frontend/src/css/LoginPage.css rename Frontend/src/{css => pages/FriendsPage}/FriendsPage.css (100%) rename Frontend/src/pages/{ => FriendsPage}/FriendsPage.tsx (95%) rename Frontend/src/{css => pages/GamePage}/GamePage.css (100%) rename Frontend/src/pages/{ => GamePage}/GamePage.tsx (90%) rename Frontend/src/{css => pages/MainPage}/MainPage.css (100%) rename Frontend/src/pages/{ => MainPage}/MainPage.tsx (91%) rename Frontend/src/{css => pages/ProfilePage}/ProfilePage.css (100%) rename Frontend/src/pages/{ => ProfilePage}/ProfilePage.tsx (89%) rename Frontend/src/{css => pages/SearchPage}/SearchPage.css (100%) rename Frontend/src/pages/{ => SearchPage}/SearchPage.tsx (89%) rename Frontend/src/pages/{ => SignIn&SignUp}/SignIn.tsx (94%) rename Frontend/src/{css => pages/SignIn&SignUp}/SignInUpCard.css (100%) rename Frontend/src/pages/{ => SignIn&SignUp}/SignUp.tsx (96%) rename Frontend/src/{css => pages/WishlistPage}/WishlistGameCard.css (100%) rename Frontend/src/{css => pages/WishlistPage}/WishlistPage.css (100%) rename Frontend/src/pages/{ => WishlistPage}/WishlistPage.tsx (95%) diff --git a/Frontend/App.tsx b/Frontend/App.tsx index 9d786dc..a83d330 100644 --- a/Frontend/App.tsx +++ b/Frontend/App.tsx @@ -1,12 +1,12 @@ import { HashRouter, Routes, Route } from 'react-router-dom' -import MainPage from './src/pages/MainPage' -import GamePage from './src/pages/GamePage' -import { SearchPage } from './src/pages/SearchPage' -import SignUpPage from './src/pages/SignUp' -import SignInPage from './src/pages/SignIn' -import WishlistPage from './src/pages/WishlistPage' -import ProfilePage from './src/pages/ProfilePage' -import FriendsPage from './src/pages/FriendsPage' +import MainPage from './src/pages/MainPage/MainPage' +import GamePage from './src/pages/GamePage/GamePage' +import { SearchPage } from './src/pages/SearchPage/SearchPage' +import SignUpPage from './src/pages/SignIn&SignUp/SignUp' +import SignInPage from './src/pages/SignIn&SignUp/SignIn' +import WishlistPage from './src/pages/WishlistPage/WishlistPage' +import ProfilePage from './src/pages/ProfilePage/ProfilePage' +import FriendsPage from './src/pages/FriendsPage/FriendsPage' import ScrollManager from './src/components/ScrollManager' function App() { diff --git a/Frontend/src/css/ActiveGameCard.css b/Frontend/src/components/ActiveGameCard/ActiveGameCard.css similarity index 100% rename from Frontend/src/css/ActiveGameCard.css rename to Frontend/src/components/ActiveGameCard/ActiveGameCard.css diff --git a/Frontend/src/components/ActiveGameCard.tsx b/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx similarity index 96% rename from Frontend/src/components/ActiveGameCard.tsx rename to Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx index daffab6..90cabf6 100644 --- a/Frontend/src/components/ActiveGameCard.tsx +++ b/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx @@ -1,22 +1,22 @@ import { Box, Button, Card, CardContent, CardMedia, Chip, Divider, Typography } from '@mui/material' import '../css/ActiveGameCard.css' -import type { GameData } from '../types/Game' -import { GetSavedUser } from '../FrontendLogic/UserLogicFrontend' +import type { GameData } from '../../types/Game' +import { GetSavedUser } from '../../FrontendLogic/UserLogicFrontend' import { useState, useEffect } from 'react' import { RemoveFromWishlistFrontend, AddToWishlistFrontend, FetchWishlistFrontend -} from '../FrontendLogic/WishlistLogicFrontend' +} from '../../FrontendLogic/WishlistLogicFrontend' import { CreateReview, DeleteReview, GetReviewsForGame, UpdateReview -} from '../FrontendLogic/ReviewLogicFrontend' -import type { Review } from '../types/Review' -import Reviews from './Reviews' -import { UseAuth } from '../context/AuthContext' +} from '../../FrontendLogic/ReviewLogicFrontend' +import type { Review } from '../../types/Review' +import Reviews from '../Reviews' +import { UseAuth } from '../../context/AuthContext' type ActiveGameCardProps = { game: GameData diff --git a/Frontend/src/css/Footer.css b/Frontend/src/components/Footer/Footer.css similarity index 100% rename from Frontend/src/css/Footer.css rename to Frontend/src/components/Footer/Footer.css diff --git a/Frontend/src/components/Footer.tsx b/Frontend/src/components/Footer/Footer.tsx similarity index 100% rename from Frontend/src/components/Footer.tsx rename to Frontend/src/components/Footer/Footer.tsx diff --git a/Frontend/src/css/Header.css b/Frontend/src/components/Header/Header.css similarity index 100% rename from Frontend/src/css/Header.css rename to Frontend/src/components/Header/Header.css diff --git a/Frontend/src/components/Header.tsx b/Frontend/src/components/Header/Header.tsx similarity index 100% rename from Frontend/src/components/Header.tsx rename to Frontend/src/components/Header/Header.tsx diff --git a/Frontend/src/css/PageHeading.css b/Frontend/src/components/PageHeading/PageHeading.css similarity index 100% rename from Frontend/src/css/PageHeading.css rename to Frontend/src/components/PageHeading/PageHeading.css diff --git a/Frontend/src/components/PageHeading.tsx b/Frontend/src/components/PageHeading/PageHeading.tsx similarity index 100% rename from Frontend/src/components/PageHeading.tsx rename to Frontend/src/components/PageHeading/PageHeading.tsx diff --git a/Frontend/src/css/PassiveGameCard.css b/Frontend/src/components/PassiveGameCard/PassiveGameCard.css similarity index 100% rename from Frontend/src/css/PassiveGameCard.css rename to Frontend/src/components/PassiveGameCard/PassiveGameCard.css diff --git a/Frontend/src/components/PassiveGameCard.tsx b/Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx similarity index 100% rename from Frontend/src/components/PassiveGameCard.tsx rename to Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx diff --git a/Frontend/src/css/EditProfile.css b/Frontend/src/components/ProfileEditor/EditProfile.css similarity index 100% rename from Frontend/src/css/EditProfile.css rename to Frontend/src/components/ProfileEditor/EditProfile.css diff --git a/Frontend/src/components/ProfileEditor.tsx b/Frontend/src/components/ProfileEditor/ProfileEditor.tsx similarity index 100% rename from Frontend/src/components/ProfileEditor.tsx rename to Frontend/src/components/ProfileEditor/ProfileEditor.tsx diff --git a/Frontend/src/css/RecentReviews.css b/Frontend/src/components/RecentReviews/RecentReviews.css similarity index 100% rename from Frontend/src/css/RecentReviews.css rename to Frontend/src/components/RecentReviews/RecentReviews.css diff --git a/Frontend/src/components/RecentReviews.tsx b/Frontend/src/components/RecentReviews/RecentReviews.tsx similarity index 100% rename from Frontend/src/components/RecentReviews.tsx rename to Frontend/src/components/RecentReviews/RecentReviews.tsx diff --git a/Frontend/src/components/ReviewCard.tsx b/Frontend/src/components/ReviewCard/ReviewCard.tsx similarity index 100% rename from Frontend/src/components/ReviewCard.tsx rename to Frontend/src/components/ReviewCard/ReviewCard.tsx diff --git a/Frontend/src/css/ReviewComposer.css b/Frontend/src/components/ReviewComposer/ReviewComposer.css similarity index 100% rename from Frontend/src/css/ReviewComposer.css rename to Frontend/src/components/ReviewComposer/ReviewComposer.css diff --git a/Frontend/src/components/ReviewComposer.tsx b/Frontend/src/components/ReviewComposer/ReviewComposer.tsx similarity index 100% rename from Frontend/src/components/ReviewComposer.tsx rename to Frontend/src/components/ReviewComposer/ReviewComposer.tsx diff --git a/Frontend/src/css/Reviews.css b/Frontend/src/components/Reviews/Reviews.css similarity index 100% rename from Frontend/src/css/Reviews.css rename to Frontend/src/components/Reviews/Reviews.css diff --git a/Frontend/src/components/Reviews.tsx b/Frontend/src/components/Reviews/Reviews.tsx similarity index 97% rename from Frontend/src/components/Reviews.tsx rename to Frontend/src/components/Reviews/Reviews.tsx index 0bffd3d..bbf401f 100644 --- a/Frontend/src/components/Reviews.tsx +++ b/Frontend/src/components/Reviews/Reviews.tsx @@ -3,9 +3,9 @@ import Button from '@mui/material/Button' import CardContent from '@mui/material/CardContent' import Divider from '@mui/material/Divider' import Typography from '@mui/material/Typography' -import ReviewCard from './ReviewCard' -import ReviewComposer from './ReviewComposer' -import type { Review } from '../types/Review' +import ReviewCard from '../ReviewCard/ReviewCard' +import ReviewComposer from '../ReviewComposer/ReviewComposer' +import type { Review } from '../../types/Review' function GetAverageRating(reviews: Review[]): number | null { if (reviews.length === 0) return null diff --git a/Frontend/src/css/UserReviews.css b/Frontend/src/components/UserReviews/UserReviews.css similarity index 100% rename from Frontend/src/css/UserReviews.css rename to Frontend/src/components/UserReviews/UserReviews.css diff --git a/Frontend/src/components/UserReviews.tsx b/Frontend/src/components/UserReviews/UserReviews.tsx similarity index 96% rename from Frontend/src/components/UserReviews.tsx rename to Frontend/src/components/UserReviews/UserReviews.tsx index 471701c..2ee220c 100644 --- a/Frontend/src/components/UserReviews.tsx +++ b/Frontend/src/components/UserReviews/UserReviews.tsx @@ -4,8 +4,8 @@ import CardContent from '@mui/material/CardContent' import Divider from '@mui/material/Divider' import Pagination from '@mui/material/Pagination' import useMediaQuery from '@mui/material/useMediaQuery' -import ReviewCard from './ReviewCard' -import ReviewComposer from './ReviewComposer' +import ReviewCard from '../ReviewCard/ReviewCard' +import ReviewComposer from '../ReviewComposer/ReviewComposer' import '../css/UserReviews.css' import { DeleteReview, @@ -13,8 +13,8 @@ import { UpdateReview, USER_REVIEWS_PER_PAGE, type UserReviewPage -} from '../FrontendLogic/ReviewLogicFrontend' -import type { Review } from '../types/Review' +} from '../../FrontendLogic/ReviewLogicFrontend' +import type { Review } from '../../types/Review' type UserReviewsProps = { userId: number diff --git a/Frontend/src/css/CreateAccountPage.css b/Frontend/src/css/CreateAccountPage.css deleted file mode 100644 index 763ecba..0000000 --- a/Frontend/src/css/CreateAccountPage.css +++ /dev/null @@ -1,15 +0,0 @@ -#createAccountPageTitle { - justify-items: center; -} - -#formBox { - display: flex; - flex-direction: column; - align-items: center; - justify-self: center; - gap: 30px; - width: 40%; - border: 1px solid black; - border-radius: 12px; - padding: 24px; -} diff --git a/Frontend/src/css/LoginPage.css b/Frontend/src/css/LoginPage.css deleted file mode 100644 index 653b0cf..0000000 --- a/Frontend/src/css/LoginPage.css +++ /dev/null @@ -1,15 +0,0 @@ -#loginPageTitle { - justify-items: center; -} - -#loginBox { - display: flex; - flex-direction: column; - align-items: center; - justify-self: center; - gap: 30px; - width: 40%; - border: 1px solid black; - border-radius: 12px; - padding: 24px; -} diff --git a/Frontend/src/css/FriendsPage.css b/Frontend/src/pages/FriendsPage/FriendsPage.css similarity index 100% rename from Frontend/src/css/FriendsPage.css rename to Frontend/src/pages/FriendsPage/FriendsPage.css diff --git a/Frontend/src/pages/FriendsPage.tsx b/Frontend/src/pages/FriendsPage/FriendsPage.tsx similarity index 95% rename from Frontend/src/pages/FriendsPage.tsx rename to Frontend/src/pages/FriendsPage/FriendsPage.tsx index 14a97d9..452f297 100644 --- a/Frontend/src/pages/FriendsPage.tsx +++ b/Frontend/src/pages/FriendsPage/FriendsPage.tsx @@ -1,6 +1,6 @@ -import Footer from '../components/Footer' -import Header from '../components/Header' -import PageHeading from '../components/PageHeading' +import Footer from '../../components/Footer/Footer' +import Header from '../../components/Header' +import PageHeading from '../../components/PageHeading/PageHeading' import { Autocomplete, Button, @@ -13,19 +13,19 @@ import { } from '@mui/material' import { useEffect, useMemo, useState } from 'react' import '../css/FriendsPage.css' -import WishlistGameCard from '../components/WishlistGameCard' -import type { Game } from '../../../Backend/Steam' +import WishlistGameCard from '../../components/WishlistGameCard' +import type { Game } from '../../../../Backend/Steam' import { AddFriend, GetFriends, GetFriendWishlist, GetMyFriendId, type Friend -} from '../FrontendLogic/FriendLogicFrontend' -import { UseAuth } from '../context/AuthContext' -import ProfileCard from '../components/ProfileCard' -import type { Profile } from '../../../Backend/logic/ProfileLogicBackend' -import type { GameOption } from '../FrontendLogic/ProfileLogicFrontend' +} from '../../FrontendLogic/FriendLogicFrontend' +import { UseAuth } from '../../context/AuthContext' +import ProfileCard from '../../components/ProfileCard' +import type { Profile } from '../../../../Backend/logic/ProfileLogicBackend' +import type { GameOption } from '../../FrontendLogic/ProfileLogicFrontend' const GAMES_PER_PAGE = 5 const NO_GAMES: Game[] = [] diff --git a/Frontend/src/css/GamePage.css b/Frontend/src/pages/GamePage/GamePage.css similarity index 100% rename from Frontend/src/css/GamePage.css rename to Frontend/src/pages/GamePage/GamePage.css diff --git a/Frontend/src/pages/GamePage.tsx b/Frontend/src/pages/GamePage/GamePage.tsx similarity index 90% rename from Frontend/src/pages/GamePage.tsx rename to Frontend/src/pages/GamePage/GamePage.tsx index 8a1fa81..5c539c1 100644 --- a/Frontend/src/pages/GamePage.tsx +++ b/Frontend/src/pages/GamePage/GamePage.tsx @@ -1,12 +1,12 @@ import '../css/GamePage.css' -import Header from '../components/Header' -import Footer from '../components/Footer' -import ActiveGameCard from '../components/ActiveGameCard' +import Header from '../../components/Header/Header.tsx' +import Footer from '../../components/Footer/Footer.tsx' +import ActiveGameCard from '../../components/ActiveGameCard/ActiveGameCard.tsx' import { useParams } from 'react-router-dom' -import PageHeading from '../components/PageHeading' +import PageHeading from '../../components/PageHeading/PageHeading' import { useEffect, useState } from 'react' -import { GetGameById } from '../FrontendLogic/GameLogicFrontend' -import type { Game } from '../../../Backend/Steam' +import { GetGameById } from '../../FrontendLogic/GameLogicFrontend' +import type { Game } from '../../../../Backend/Steam' export default function GamePage() { const { gameId } = useParams() diff --git a/Frontend/src/css/MainPage.css b/Frontend/src/pages/MainPage/MainPage.css similarity index 100% rename from Frontend/src/css/MainPage.css rename to Frontend/src/pages/MainPage/MainPage.css diff --git a/Frontend/src/pages/MainPage.tsx b/Frontend/src/pages/MainPage/MainPage.tsx similarity index 91% rename from Frontend/src/pages/MainPage.tsx rename to Frontend/src/pages/MainPage/MainPage.tsx index 1474617..726f834 100644 --- a/Frontend/src/pages/MainPage.tsx +++ b/Frontend/src/pages/MainPage/MainPage.tsx @@ -1,22 +1,22 @@ import '../css/MainPage.css' -import Header from '../components/Header' -import Footer from '../components/Footer' +import Header from '../../components/Header' +import Footer from '../../components/Footer/Footer' import { LoadTop3Games, LoadTopGamesByGenre, LoadDiscountedGames -} from '../FrontendLogic/MainPageLogicFrontend' -import { FetchGenres } from '../FrontendLogic/SearchPageLogicFrontend' +} from '../../FrontendLogic/MainPageLogicFrontend' +import { FetchGenres } from '../../FrontendLogic/SearchPageLogicFrontend' import { Link } from 'react-router-dom' import { useEffect, useState } from 'react' import { Button } from '@mui/material' import maskot_gamestart from '../assets/maskot_gamestart.webp' -import RecentReviews from '../components/RecentReviews' -import { GetRecentReviews } from '../FrontendLogic/ReviewLogicFrontend' -import type { Review } from '../types/Review' -import type { PageGame } from '../types/Game' -import { GenreGamesSection, ToPageGame } from '../components/GenreGamesSection' -import TopGames from '../components/TopGames' +import RecentReviews from '../../components/RecentReviews' +import { GetRecentReviews } from '../../FrontendLogic/ReviewLogicFrontend' +import type { Review } from '../../types/Review' +import type { PageGame } from '../../types/Game' +import { GenreGamesSection, ToPageGame } from '../../components/GenreGamesSection' +import TopGames from '../../components/TopGames' export default function MainPage() { const [featuredGames, setFeaturedGames] = useState([]) diff --git a/Frontend/src/css/ProfilePage.css b/Frontend/src/pages/ProfilePage/ProfilePage.css similarity index 100% rename from Frontend/src/css/ProfilePage.css rename to Frontend/src/pages/ProfilePage/ProfilePage.css diff --git a/Frontend/src/pages/ProfilePage.tsx b/Frontend/src/pages/ProfilePage/ProfilePage.tsx similarity index 89% rename from Frontend/src/pages/ProfilePage.tsx rename to Frontend/src/pages/ProfilePage/ProfilePage.tsx index 7f75e1c..be9c54a 100644 --- a/Frontend/src/pages/ProfilePage.tsx +++ b/Frontend/src/pages/ProfilePage/ProfilePage.tsx @@ -1,19 +1,19 @@ -import Footer from '../components/Footer' -import Header from '../components/Header' +import Footer from '../../components/Footer/Footer.tsx' +import Header from '../../components/Header.tsx' import '../css/ProfilePage.css' -import PageHeading from '../components/PageHeading' -import ProfileCard from '../components/ProfileCard.tsx' +import PageHeading from '../../components/PageHeading/PageHeading.tsx' +import ProfileCard from '../../components/ProfileCard.tsx' import { useEffect, useState, type ReactNode } from 'react' -import { UseAuth } from '../context/AuthContext.tsx' +import { UseAuth } from '../../context/AuthContext.tsx' import { FetchGameOptions, FetchProfileFrontend, UpdateProfileFrontend, type GameOption -} from '../FrontendLogic/ProfileLogicFrontend.ts' -import type { Profile } from '../../../Backend/logic/ProfileLogicBackend.ts' -import ProfileEditor from '../components/ProfileEditor.tsx' -import UserReviews from '../components/UserReviews.tsx' +} from '../../FrontendLogic/ProfileLogicFrontend.ts' +import type { Profile } from '../../../../Backend/logic/ProfileLogicBackend.ts' +import ProfileEditor from '../../components/ProfileEditor.tsx' +import UserReviews from '../../components/UserReviews/UserReviews.tsx' import { Button, Card, CardContent } from '@mui/material' function ProfileMessageCard({ diff --git a/Frontend/src/css/SearchPage.css b/Frontend/src/pages/SearchPage/SearchPage.css similarity index 100% rename from Frontend/src/css/SearchPage.css rename to Frontend/src/pages/SearchPage/SearchPage.css diff --git a/Frontend/src/pages/SearchPage.tsx b/Frontend/src/pages/SearchPage/SearchPage.tsx similarity index 89% rename from Frontend/src/pages/SearchPage.tsx rename to Frontend/src/pages/SearchPage/SearchPage.tsx index a0d180f..781494d 100644 --- a/Frontend/src/pages/SearchPage.tsx +++ b/Frontend/src/pages/SearchPage/SearchPage.tsx @@ -1,11 +1,11 @@ import '../css/SearchPage.css' -import Header from '../components/Header' -import Footer from '../components/Footer' -import PageHeading from '../components/PageHeading' -import SearchPageControls, { type SortOption } from '../components/SearchPageControls' -import SearchPageResults from '../components/SearchPageResults' -import { useDebouncedValue } from '../hooks/useDebouncedValue' -import { useSearchPageResults } from '../hooks/useSearchPageResults' +import Header from '../../components/Header' +import Footer from '../../components/Footer/Footer' +import PageHeading from '../../components/PageHeading/PageHeading' +import SearchPageControls, { type SortOption } from '../../components/SearchPageControls' +import SearchPageResults from '../../components/SearchPageResults' +import { useDebouncedValue } from '../../hooks/useDebouncedValue' +import { useSearchPageResults } from '../../hooks/useSearchPageResults' import { useState, useEffect } from 'react' import type { SelectChangeEvent } from '@mui/material' import { @@ -19,7 +19,7 @@ import { SavePageSearchpage, SaveFilterMenuOpenSearchpage, GetFilterMenuOpenSearchpage -} from '../FrontendLogic/SearchPageLogicFrontend' +} from '../../FrontendLogic/SearchPageLogicFrontend' const DEFAULT_SORT: SortOption = 'title-asc' const SORT_OPTIONS: SortOption[] = [ diff --git a/Frontend/src/pages/SignIn.tsx b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx similarity index 94% rename from Frontend/src/pages/SignIn.tsx rename to Frontend/src/pages/SignIn&SignUp/SignIn.tsx index 89440bf..80876ff 100644 --- a/Frontend/src/pages/SignIn.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx @@ -14,12 +14,12 @@ import { Card } from '@mui/material' import { NavLink } from 'react-router-dom' -import Header from '../components/Header' -import Footer from '../components/Footer' +import Header from '../../components/Header/Header.tsx' +import Footer from '../../components/Footer/Footer.tsx' import { useNavigate } from 'react-router-dom' -import PageHeading from '../components/PageHeading' -import { SigninUser } from '../FrontendLogic/UserLogicFrontend' -import { UseAuth } from '../context/AuthContext' +import PageHeading from '../../components/PageHeading/PageHeading.tsx' +import { SigninUser } from '../../FrontendLogic/UserLogicFrontend' +import { UseAuth } from '../../context/AuthContext' import '../css/SignInUpCard.css' export default function SignInPage() { diff --git a/Frontend/src/css/SignInUpCard.css b/Frontend/src/pages/SignIn&SignUp/SignInUpCard.css similarity index 100% rename from Frontend/src/css/SignInUpCard.css rename to Frontend/src/pages/SignIn&SignUp/SignInUpCard.css diff --git a/Frontend/src/pages/SignUp.tsx b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx similarity index 96% rename from Frontend/src/pages/SignUp.tsx rename to Frontend/src/pages/SignIn&SignUp/SignUp.tsx index eacf822..f1d33cc 100644 --- a/Frontend/src/pages/SignUp.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx @@ -12,11 +12,11 @@ import { Card } from '@mui/material' import { useNavigate } from 'react-router-dom' -import Header from '../components/Header' -import Footer from '../components/Footer' -import PageHeading from '../components/PageHeading' -import { SignupUser } from '../FrontendLogic/UserLogicFrontend' -import { UseAuth } from '../context/AuthContext' +import Header from '../../components/Header/Header.tsx' +import Footer from '../../components/Footer/Footer.tsx' +import PageHeading from '../../components/PageHeading/PageHeading.tsx' +import { SignupUser } from '../../FrontendLogic/UserLogicFrontend' +import { UseAuth } from '../../context/AuthContext' import '../css/SignInUpCard.css' export default function SignUpPage() { diff --git a/Frontend/src/css/WishlistGameCard.css b/Frontend/src/pages/WishlistPage/WishlistGameCard.css similarity index 100% rename from Frontend/src/css/WishlistGameCard.css rename to Frontend/src/pages/WishlistPage/WishlistGameCard.css diff --git a/Frontend/src/css/WishlistPage.css b/Frontend/src/pages/WishlistPage/WishlistPage.css similarity index 100% rename from Frontend/src/css/WishlistPage.css rename to Frontend/src/pages/WishlistPage/WishlistPage.css diff --git a/Frontend/src/pages/WishlistPage.tsx b/Frontend/src/pages/WishlistPage/WishlistPage.tsx similarity index 95% rename from Frontend/src/pages/WishlistPage.tsx rename to Frontend/src/pages/WishlistPage/WishlistPage.tsx index 795dbcb..26283c2 100644 --- a/Frontend/src/pages/WishlistPage.tsx +++ b/Frontend/src/pages/WishlistPage/WishlistPage.tsx @@ -1,19 +1,19 @@ import '../css/WishlistPage.css' -import Header from '../components/Header' -import Footer from '../components/Footer' -import WishlistGameCard from '../components/WishlistGameCard' +import Header from '../../components/Header/Header' +import Footer from '../../components/Footer/Footer' +import WishlistGameCard from '../../components/WishlistGameCard' import { FormControl, Select, MenuItem, InputLabel, Pagination, Card } from '@mui/material' import type { SelectChangeEvent } from '@mui/material' import { useState, useEffect, useMemo } from 'react' -import type { Game } from '../../../Backend/Steam' +import type { Game } from '../../../../Backend/Steam' -import PageHeading from '../components/PageHeading' +import PageHeading from '../../components/PageHeading/PageHeading' import { FetchWishlistFrontend, SaveSortOptionWishlist, GetSortOptionWishlist -} from '../FrontendLogic/WishlistLogicFrontend' -import { UseAuth } from '../context/AuthContext' +} from '../../FrontendLogic/WishlistLogicFrontend' +import { UseAuth } from '../../context/AuthContext' type SortOption = 'discount-desc' | 'discount-asc' | 'price-asc' | 'price-desc' | 'title-asc' const SORT_OPTIONS: SortOption[] = [ diff --git a/Frontend/src/tests/FriendsPage.test.tsx b/Frontend/src/tests/FriendsPage.test.tsx index 553771a..3adacca 100644 --- a/Frontend/src/tests/FriendsPage.test.tsx +++ b/Frontend/src/tests/FriendsPage.test.tsx @@ -81,7 +81,7 @@ vi.mock('@mui/material', async (importOriginal) => { } }) -import FriendPage from '../pages/FriendsPage' +import FriendPage from '../pages/FriendsPage/FriendsPage' const SELECTED_FRIEND_KEY = 'selectedFriendId' diff --git a/Frontend/src/tests/GamePage.test.tsx b/Frontend/src/tests/GamePage.test.tsx index 77cd025..c52aeb3 100644 --- a/Frontend/src/tests/GamePage.test.tsx +++ b/Frontend/src/tests/GamePage.test.tsx @@ -23,7 +23,7 @@ vi.mock('../components/Footer', () => ({ default: () =>
Footer
})) -import GamePage from '../pages/GamePage' +import GamePage from '../pages/GamePage/GamePage' function MakeGame(appid: number): Game { return { diff --git a/Frontend/src/tests/MainPage.test.tsx b/Frontend/src/tests/MainPage.test.tsx index e335d4f..fac15d7 100644 --- a/Frontend/src/tests/MainPage.test.tsx +++ b/Frontend/src/tests/MainPage.test.tsx @@ -64,7 +64,7 @@ vi.mock('@mui/material', async (importOriginal) => { } }) -import MainPage from '../pages/MainPage' +import MainPage from '../pages/MainPage/MainPage' function MakeGame(appid: number, genre: string, discount = '0', price = '9.99'): Game { return { diff --git a/Frontend/src/tests/PageHeading.test.tsx b/Frontend/src/tests/PageHeading.test.tsx index 351c9b6..e999c36 100644 --- a/Frontend/src/tests/PageHeading.test.tsx +++ b/Frontend/src/tests/PageHeading.test.tsx @@ -2,7 +2,7 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it } from 'vitest' import { Link, MemoryRouter, Route, Routes } from 'react-router-dom' -import PageHeading from '../components/PageHeading' +import PageHeading from '../components/PageHeading/PageHeading' describe('PageHeading', () => { afterEach(() => { diff --git a/Frontend/src/tests/SearchPage.test.tsx b/Frontend/src/tests/SearchPage.test.tsx index c8a84f7..7c63af1 100644 --- a/Frontend/src/tests/SearchPage.test.tsx +++ b/Frontend/src/tests/SearchPage.test.tsx @@ -81,7 +81,7 @@ vi.mock('../components/PassiveGameCard', async () => { } }) -import { SearchPage } from '../pages/SearchPage' +import { SearchPage } from '../pages/SearchPage/SearchPage' function MakeGame(appid: number, overrides: Partial = {}): Game { return { From aaea52a3d8c80c57e89b1a48627267698a8e6042 Mon Sep 17 00:00:00 2001 From: carmennt Date: Tue, 17 Nov 2026 13:07:12 +0100 Subject: [PATCH 2/8] feat: document title Adding document titles for better screenreader accessibility. --- Frontend/src/hooks/useDocumentTitle.ts | 7 ++++++ .../src/pages/FriendsPage/FriendsPage.tsx | 16 +++++++----- Frontend/src/pages/GamePage/GamePage.tsx | 25 +++++++++++-------- Frontend/src/pages/MainPage/MainPage.tsx | 3 +++ .../src/pages/ProfilePage/ProfilePage.tsx | 5 +++- Frontend/src/pages/SearchPage/SearchPage.tsx | 5 +++- Frontend/src/pages/SignIn&SignUp/SignIn.tsx | 3 +++ Frontend/src/pages/SignIn&SignUp/SignUp.tsx | 3 +++ .../src/pages/WishlistPage/WishlistPage.tsx | 3 +++ 9 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 Frontend/src/hooks/useDocumentTitle.ts diff --git a/Frontend/src/hooks/useDocumentTitle.ts b/Frontend/src/hooks/useDocumentTitle.ts new file mode 100644 index 0000000..837bf17 --- /dev/null +++ b/Frontend/src/hooks/useDocumentTitle.ts @@ -0,0 +1,7 @@ +import { useEffect } from 'react' + +export function useDocumentTitle(title: string) { + useEffect(() => { + document.title = `${title}` + }, [title]) +} \ No newline at end of file diff --git a/Frontend/src/pages/FriendsPage/FriendsPage.tsx b/Frontend/src/pages/FriendsPage/FriendsPage.tsx index 452f297..a46f9aa 100644 --- a/Frontend/src/pages/FriendsPage/FriendsPage.tsx +++ b/Frontend/src/pages/FriendsPage/FriendsPage.tsx @@ -1,5 +1,6 @@ import Footer from '../../components/Footer/Footer' import Header from '../../components/Header' +import { useDocumentTitle } from '../../hooks/useDocumentTitle' import PageHeading from '../../components/PageHeading/PageHeading' import { Autocomplete, @@ -41,13 +42,13 @@ type PanelState = { export default function FriendPage() { const { user } = UseAuth() - + const [friendCode, setFriendCode] = useState('') const [addError, setAddError] = useState(null) const [isAdding, setIsAdding] = useState(false) - + const SELECTED_FRIEND_KEY = 'selectedFriendId' - + const [friendsState, setFriendsState] = useState<{ userId: number | null friends: Friend[] @@ -59,14 +60,17 @@ export default function FriendPage() { }) const [selectedFriendId, setSelectedFriendId] = useState(() => sessionStorage.getItem(SELECTED_FRIEND_KEY) - ) +) const [wishlistState, setWishlistState] = useState<{ key: string | null - games: Game[] - error: string | null + games: Game[] + error: string | null }>({ key: null, games: [], error: null }) + const [page, setPage] = useState(1) const [reloadKey, setReloadKey] = useState(0) + + useDocumentTitle('Friends') useEffect(() => { if (!user) return undefined diff --git a/Frontend/src/pages/GamePage/GamePage.tsx b/Frontend/src/pages/GamePage/GamePage.tsx index 5c539c1..b96ecad 100644 --- a/Frontend/src/pages/GamePage/GamePage.tsx +++ b/Frontend/src/pages/GamePage/GamePage.tsx @@ -1,6 +1,7 @@ import '../css/GamePage.css' import Header from '../../components/Header/Header.tsx' import Footer from '../../components/Footer/Footer.tsx' +import { useDocumentTitle } from '../../hooks/useDocumentTitle.ts' import ActiveGameCard from '../../components/ActiveGameCard/ActiveGameCard.tsx' import { useParams } from 'react-router-dom' import PageHeading from '../../components/PageHeading/PageHeading' @@ -16,18 +17,18 @@ export default function GamePage() { game: Game | null error: string | null } | null>(null) - + const isValidAppId = Number.isSafeInteger(appid) && appid > 0 - + useEffect(() => { if (!isValidAppId) return - + let cancelled = false - + GetGameById(appid) .then((loadedGame) => { if (!cancelled) setLoadedGame({ appid, game: loadedGame, error: null }) - }) + }) .catch((err: unknown) => { if (!cancelled) { setLoadedGame({ @@ -37,25 +38,27 @@ export default function GamePage() { }) } }) - return () => { cancelled = true } }, [appid, isValidAppId]) - + const isLoading = isValidAppId && loadedGame?.appid !== appid const game = loadedGame?.appid === appid ? loadedGame.game : null const error = loadedGame?.appid === appid ? loadedGame.error : null - + const price = game ? Number(game.price) : 0 const salePercent = game ? Number(game.discount) : 0 const originalPrice = game ? Number(game.initialprice) : 0 const genres = game ? game.genre - .split(',') - .map((genre) => genre.trim()) - .filter(Boolean) + .split(',') + .map((genre) => genre.trim()) + .filter(Boolean) : [] + + useDocumentTitle(game?.name + 'game page') + return (
diff --git a/Frontend/src/pages/MainPage/MainPage.tsx b/Frontend/src/pages/MainPage/MainPage.tsx index 726f834..fcf82f3 100644 --- a/Frontend/src/pages/MainPage/MainPage.tsx +++ b/Frontend/src/pages/MainPage/MainPage.tsx @@ -1,6 +1,7 @@ import '../css/MainPage.css' import Header from '../../components/Header' import Footer from '../../components/Footer/Footer' +import { useDocumentTitle } from '../../hooks/useDocumentTitle' import { LoadTop3Games, LoadTopGamesByGenre, @@ -29,6 +30,8 @@ export default function MainPage() { const [reviewsError, setReviewsError] = useState(null) const [recentReviews, setRecentReviews] = useState([]) const [isLoadingReviews, setIsLoadingReviews] = useState(true) + + useDocumentTitle('Home') useEffect(() => { let cancelled = false diff --git a/Frontend/src/pages/ProfilePage/ProfilePage.tsx b/Frontend/src/pages/ProfilePage/ProfilePage.tsx index be9c54a..be0d526 100644 --- a/Frontend/src/pages/ProfilePage/ProfilePage.tsx +++ b/Frontend/src/pages/ProfilePage/ProfilePage.tsx @@ -1,5 +1,6 @@ import Footer from '../../components/Footer/Footer.tsx' import Header from '../../components/Header.tsx' +import { useDocumentTitle } from '../../hooks/useDocumentTitle.ts' import '../css/ProfilePage.css' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import ProfileCard from '../../components/ProfileCard.tsx' @@ -40,11 +41,13 @@ function ProfileMessageCard({ export default function ProfilePage() { const { user } = UseAuth() const userId = user?.id - + const [profile, setProfile] = useState(null) const [gameOptions, setGameOptions] = useState([]) const [error, setError] = useState(null) const [isEditing, setIsEditing] = useState(false) + + useDocumentTitle('Profile') useEffect(() => { if (userId === undefined) return diff --git a/Frontend/src/pages/SearchPage/SearchPage.tsx b/Frontend/src/pages/SearchPage/SearchPage.tsx index 781494d..8e5f18d 100644 --- a/Frontend/src/pages/SearchPage/SearchPage.tsx +++ b/Frontend/src/pages/SearchPage/SearchPage.tsx @@ -1,6 +1,7 @@ import '../css/SearchPage.css' import Header from '../../components/Header' import Footer from '../../components/Footer/Footer' +import { useDocumentTitle } from '../../hooks/useDocumentTitle' import PageHeading from '../../components/PageHeading/PageHeading' import SearchPageControls, { type SortOption } from '../../components/SearchPageControls' import SearchPageResults from '../../components/SearchPageResults' @@ -51,7 +52,9 @@ export function SearchPage() { genres: appliedFilters, sort: appliedSorting }) - + + useDocumentTitle('Search') + const ToggleActive = () => { const hasSelection = activeFilters.length > 0 || activeSorting !== DEFAULT_SORT if (hasSelection) setPage(1) diff --git a/Frontend/src/pages/SignIn&SignUp/SignIn.tsx b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx index 80876ff..035dd36 100644 --- a/Frontend/src/pages/SignIn&SignUp/SignIn.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx @@ -16,6 +16,7 @@ import { import { NavLink } from 'react-router-dom' import Header from '../../components/Header/Header.tsx' import Footer from '../../components/Footer/Footer.tsx' +import { useDocumentTitle } from '../../hooks/useDocumentTitle.ts' import { useNavigate } from 'react-router-dom' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import { SigninUser } from '../../FrontendLogic/UserLogicFrontend' @@ -32,6 +33,8 @@ export default function SignInPage() { const { login } = UseAuth() const Navigate = useNavigate() + useDocumentTitle('Sign in') + const HandleSubmit = async (event: React.SubmitEvent) => { event.preventDefault() SetFormError('') diff --git a/Frontend/src/pages/SignIn&SignUp/SignUp.tsx b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx index f1d33cc..8fe6605 100644 --- a/Frontend/src/pages/SignIn&SignUp/SignUp.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx @@ -14,6 +14,7 @@ import { import { useNavigate } from 'react-router-dom' import Header from '../../components/Header/Header.tsx' import Footer from '../../components/Footer/Footer.tsx' +import { useDocumentTitle } from '../../hooks/useDocumentTitle.ts' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import { SignupUser } from '../../FrontendLogic/UserLogicFrontend' import { UseAuth } from '../../context/AuthContext' @@ -33,6 +34,8 @@ export default function SignUpPage() { const { login } = UseAuth() const Navigate = useNavigate() + useDocumentTitle('Sign up') + const ValidateInputs = ( username: string, email: string, diff --git a/Frontend/src/pages/WishlistPage/WishlistPage.tsx b/Frontend/src/pages/WishlistPage/WishlistPage.tsx index 26283c2..a7173c8 100644 --- a/Frontend/src/pages/WishlistPage/WishlistPage.tsx +++ b/Frontend/src/pages/WishlistPage/WishlistPage.tsx @@ -1,6 +1,7 @@ import '../css/WishlistPage.css' import Header from '../../components/Header/Header' import Footer from '../../components/Footer/Footer' +import { useDocumentTitle } from '../../hooks/useDocumentTitle' import WishlistGameCard from '../../components/WishlistGameCard' import { FormControl, Select, MenuItem, InputLabel, Pagination, Card } from '@mui/material' import type { SelectChangeEvent } from '@mui/material' @@ -38,6 +39,8 @@ export default function WishlistPage() { }>({ user: null, games: [], error: null }) const [page, setPage] = useState(1) + useDocumentTitle('Wishlist') + // Loades the games useEffect(() => { if (user == null) return undefined From 38bb2a7cb3533e43df987d79c7466ae17f7838b2 Mon Sep 17 00:00:00 2001 From: catjoha04-byte Date: Tue, 17 Nov 2026 13:24:59 +0100 Subject: [PATCH 3/8] refactor: separate component style into own their own css --- .../ActiveGameCard/ActiveGameCard.css | 73 +------- .../src/components/ReviewCard/ReviewCard.css | 156 ++++++++++++++++ .../ReviewComposer/ReviewComposer.css | 7 - Frontend/src/components/Reviews/Reviews.css | 174 +++++------------- .../components/UserReviews/UserReviews.css | 7 + .../WishlistGameCard}/WishlistGameCard.css | 0 .../WishlistGameCard.tsx | 8 +- 7 files changed, 220 insertions(+), 205 deletions(-) create mode 100644 Frontend/src/components/ReviewCard/ReviewCard.css rename Frontend/src/{pages/WishlistPage => components/WishlistGameCard}/WishlistGameCard.css (100%) rename Frontend/src/components/{ => WishlistGameCard}/WishlistGameCard.tsx (91%) diff --git a/Frontend/src/components/ActiveGameCard/ActiveGameCard.css b/Frontend/src/components/ActiveGameCard/ActiveGameCard.css index 659d7bd..a2efe63 100644 --- a/Frontend/src/components/ActiveGameCard/ActiveGameCard.css +++ b/Frontend/src/components/ActiveGameCard/ActiveGameCard.css @@ -62,21 +62,13 @@ min-height: 0; } -.activeGameInfoContent.MuiCardContent-root, -.activeGameReviewsContent.MuiCardContent-root { +.activeGameInfoContent.MuiCardContent-root { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; } -.activeGameReviewsContent.MuiCardContent-root { - box-sizing: border-box; - flex: 1 1 0; - height: 100%; - min-height: 0; -} - .activeGameInfoHeader { display: flex; align-items: center; @@ -173,56 +165,6 @@ color: var(--primary-text-color); } -.activeGameReviewsHeader { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; -} - -.activeGameReviewsHeader .MuiTypography-root { - color: var(--primary-text-color); -} - -.activeGameScore { - margin: 0; - white-space: nowrap; -} - -.activeGameReviewsContent .reviewComposerToggle.MuiButton-root { - align-self: flex-start; - background-color: var(--primary-background-color); - color: var(--primary-text-color); - text-transform: none; -} - -.reviewComposerHint { - margin: -0.5rem 0 0; - color: var(--primary-text-color); - font-size: 0.9rem; -} - -.activeGameReviewList { - display: flex; - flex: 1 1 0; - flex-direction: column; - min-height: clamp(6rem, 28vh, 20rem); - gap: 0.65rem; - overflow-y: auto; - scrollbar-gutter: stable; -} - -.activeGameReviewList > .reviewCard { - flex: 0 0 auto; - box-shadow: none; -} - -.activeGameNoReviews { - margin: 0; - color: var(--primary-text-color); -} - -.activeGameReviewsContent .MuiDivider-root, .activeGameInfoContent .MuiDivider-root { width: 100%; border-color: rgb(0 0 0 / 20%); @@ -239,20 +181,9 @@ gap: 1rem; } - .activeGameInfoContent.MuiCardContent-root, - .activeGameReviewsContent.MuiCardContent-root { + .activeGameInfoContent.MuiCardContent-root { padding: 1.125rem; } - - .activeGameReviewsContent.MuiCardContent-root { - height: auto; - } - - .activeGameReviewList { - flex: 0 1 auto; - min-height: 0; - max-height: min(36rem, 70vh); - } } @media (max-width: 26rem) { diff --git a/Frontend/src/components/ReviewCard/ReviewCard.css b/Frontend/src/components/ReviewCard/ReviewCard.css new file mode 100644 index 0000000..c27349d --- /dev/null +++ b/Frontend/src/components/ReviewCard/ReviewCard.css @@ -0,0 +1,156 @@ +.reviewCard { + display: flex; + flex-direction: column; + min-width: 0; + padding: 0.85rem; + border: 1px solid var(--primary-component-color); + border-radius: 0.75rem; + background-color: var(--primary-background-color); + box-shadow: var(--card-shadow); +} + +.reviewCardHeader { + display: flex; + flex-direction: column; + min-width: 0; +} + +.reviewCardGame, +.reviewCardReviewer { + overflow-wrap: anywhere; +} + +.reviewCardGame { + font-size: 1.05rem; + font-weight: 700; +} + +.reviewCardReviewer { + margin-top: 0.2rem; + color: var(--primary-text-color); + font-size: 0.85rem; +} + +.reviewCardActions { + display: flex; + flex-wrap: wrap; + gap: 0.4rem; + margin-top: 0.4rem; +} + +.reviewCardActions .MuiButton-root { + min-width: 0; + padding: 0.15rem 0.6rem; + border: 1px solid var(--primary-component-color); + border-radius: 0.4rem; + color: var(--primary-text-color); + font-size: 0.8rem; + font-weight: 700; + line-height: 1.4; + text-transform: none; +} + +.reviewCardActions .app-button.MuiButton-root { + background-color: var(--primary-component-color); +} + +.reviewCardActions .reviewCardDelete.MuiButton-root { + background-color: var(--secondary-component-color); +} + +.reviewCardActions .MuiButton-root:hover { + background-color: var(--primary-accent-color); +} + +.reviewCardRating { + display: flex; + align-items: center; + gap: 0.35rem; + white-space: nowrap; +} + +.reviewCardGame + .reviewCardRating { + margin-top: 0.3rem; +} + +.reviewCardRating .MuiRating-root { + color: var(--primary-accent-color); +} + +.reviewCardRating .MuiTypography-root { + font-weight: 700; +} + +.reviewCardText { + margin: 0.65rem 0 0; + line-height: 1.45; + overflow-wrap: anywhere; +} + +.reviewCardTextBox { + position: relative; + margin-top: 0.65rem; +} + +.reviewCardTextBox .reviewCardText { + margin: 0; +} + +.reviewCardTextBoxCollapsed { + height: calc(1.45em * 2); + overflow: hidden; +} + +.reviewCardNoText { + color: var(--primary-text-color); + font-style: italic; + opacity: 0.55; +} + +.reviewCardCollapsible .reviewCardGame { + overflow: hidden; + overflow-wrap: normal; + text-overflow: ellipsis; + white-space: nowrap; +} + +.reviewCardTextFade { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1.45em; + background: linear-gradient( + to bottom, + transparent, + color-mix(in srgb, var(--primary-background-color) 90%, transparent) + ); + pointer-events: none; +} + +.reviewCardExpandable { + cursor: pointer; +} + +.reviewCardExpandable .reviewCardTextBox:focus-visible { + outline: 2px solid var(--primary-accent-color); + outline-offset: 3px; +} + +.reviewCardExpanded { + border-color: var(--primary-accent-color); +} + +.reviewCard-link { + width: fit-content; + margin-top: 0.75rem; + color: var(--primary-text-color); + font-weight: 700; + text-decoration-thickness: 1px; + text-underline-offset: 0.2em; +} + +.reviewCard-link:focus-visible { + outline: 2px solid var(--primary-accent-color); + outline-offset: 3px; +} diff --git a/Frontend/src/components/ReviewComposer/ReviewComposer.css b/Frontend/src/components/ReviewComposer/ReviewComposer.css index b3b12ba..5aa2f24 100644 --- a/Frontend/src/components/ReviewComposer/ReviewComposer.css +++ b/Frontend/src/components/ReviewComposer/ReviewComposer.css @@ -40,10 +40,3 @@ flex-wrap: wrap; gap: 0.5rem; } - -.reviewComposerError { - margin: 0; - color: var(--primary-text-color); - font-weight: 700; - overflow-wrap: anywhere; -} diff --git a/Frontend/src/components/Reviews/Reviews.css b/Frontend/src/components/Reviews/Reviews.css index c27349d..de5a440 100644 --- a/Frontend/src/components/Reviews/Reviews.css +++ b/Frontend/src/components/Reviews/Reviews.css @@ -1,156 +1,84 @@ -.reviewCard { +.activeGameReviewsContent.MuiCardContent-root { display: flex; + box-sizing: border-box; + flex: 1 1 0; flex-direction: column; - min-width: 0; - padding: 0.85rem; - border: 1px solid var(--primary-component-color); - border-radius: 0.75rem; - background-color: var(--primary-background-color); - box-shadow: var(--card-shadow); + gap: 1rem; + height: 100%; + min-height: 0; + padding: 1.25rem; } -.reviewCardHeader { +.activeGameReviewsHeader { display: flex; - flex-direction: column; - min-width: 0; -} - -.reviewCardGame, -.reviewCardReviewer { - overflow-wrap: anywhere; -} - -.reviewCardGame { - font-size: 1.05rem; - font-weight: 700; + align-items: center; + justify-content: space-between; + gap: 1rem; } -.reviewCardReviewer { - margin-top: 0.2rem; +.activeGameReviewsHeader .MuiTypography-root { color: var(--primary-text-color); - font-size: 0.85rem; } -.reviewCardActions { - display: flex; - flex-wrap: wrap; - gap: 0.4rem; - margin-top: 0.4rem; +.activeGameScore { + margin: 0; + white-space: nowrap; } -.reviewCardActions .MuiButton-root { - min-width: 0; - padding: 0.15rem 0.6rem; - border: 1px solid var(--primary-component-color); - border-radius: 0.4rem; +.activeGameReviewsContent .reviewComposerToggle.MuiButton-root { + align-self: flex-start; + background-color: var(--primary-background-color); color: var(--primary-text-color); - font-size: 0.8rem; - font-weight: 700; - line-height: 1.4; text-transform: none; } -.reviewCardActions .app-button.MuiButton-root { - background-color: var(--primary-component-color); -} - -.reviewCardActions .reviewCardDelete.MuiButton-root { - background-color: var(--secondary-component-color); -} - -.reviewCardActions .MuiButton-root:hover { - background-color: var(--primary-accent-color); -} - -.reviewCardRating { - display: flex; - align-items: center; - gap: 0.35rem; - white-space: nowrap; -} - -.reviewCardGame + .reviewCardRating { - margin-top: 0.3rem; -} - -.reviewCardRating .MuiRating-root { - color: var(--primary-accent-color); +.reviewComposerHint { + margin: -0.5rem 0 0; + color: var(--primary-text-color); + font-size: 0.9rem; } -.reviewCardRating .MuiTypography-root { +.reviewComposerError { + margin: 0; + color: var(--primary-text-color); font-weight: 700; -} - -.reviewCardText { - margin: 0.65rem 0 0; - line-height: 1.45; overflow-wrap: anywhere; } -.reviewCardTextBox { - position: relative; - margin-top: 0.65rem; +.activeGameReviewsContent .MuiDivider-root { + width: 100%; + border-color: rgb(0 0 0 / 20%); } -.reviewCardTextBox .reviewCardText { - margin: 0; +.activeGameReviewList { + display: flex; + flex: 1 1 0; + flex-direction: column; + min-height: clamp(6rem, 28vh, 20rem); + gap: 0.65rem; + overflow-y: auto; + scrollbar-gutter: stable; } -.reviewCardTextBoxCollapsed { - height: calc(1.45em * 2); - overflow: hidden; +.activeGameReviewList > .reviewCard { + flex: 0 0 auto; + box-shadow: none; } -.reviewCardNoText { +.activeGameNoReviews { + margin: 0; color: var(--primary-text-color); - font-style: italic; - opacity: 0.55; } -.reviewCardCollapsible .reviewCardGame { - overflow: hidden; - overflow-wrap: normal; - text-overflow: ellipsis; - white-space: nowrap; -} - -.reviewCardTextFade { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height: 1.45em; - background: linear-gradient( - to bottom, - transparent, - color-mix(in srgb, var(--primary-background-color) 90%, transparent) - ); - pointer-events: none; -} - -.reviewCardExpandable { - cursor: pointer; -} - -.reviewCardExpandable .reviewCardTextBox:focus-visible { - outline: 2px solid var(--primary-accent-color); - outline-offset: 3px; -} - -.reviewCardExpanded { - border-color: var(--primary-accent-color); -} - -.reviewCard-link { - width: fit-content; - margin-top: 0.75rem; - color: var(--primary-text-color); - font-weight: 700; - text-decoration-thickness: 1px; - text-underline-offset: 0.2em; -} +@media (max-width: 64rem) { + .activeGameReviewsContent.MuiCardContent-root { + height: auto; + padding: 1.125rem; + } -.reviewCard-link:focus-visible { - outline: 2px solid var(--primary-accent-color); - outline-offset: 3px; + .activeGameReviewList { + flex: 0 1 auto; + min-height: 0; + max-height: min(36rem, 70vh); + } } diff --git a/Frontend/src/components/UserReviews/UserReviews.css b/Frontend/src/components/UserReviews/UserReviews.css index 79e391b..28948da 100644 --- a/Frontend/src/components/UserReviews/UserReviews.css +++ b/Frontend/src/components/UserReviews/UserReviews.css @@ -30,3 +30,10 @@ gap: 1rem; min-width: 0; } + +.reviewComposerError { + margin: 0; + color: var(--primary-text-color); + font-weight: 700; + overflow-wrap: anywhere; +} diff --git a/Frontend/src/pages/WishlistPage/WishlistGameCard.css b/Frontend/src/components/WishlistGameCard/WishlistGameCard.css similarity index 100% rename from Frontend/src/pages/WishlistPage/WishlistGameCard.css rename to Frontend/src/components/WishlistGameCard/WishlistGameCard.css diff --git a/Frontend/src/components/WishlistGameCard.tsx b/Frontend/src/components/WishlistGameCard/WishlistGameCard.tsx similarity index 91% rename from Frontend/src/components/WishlistGameCard.tsx rename to Frontend/src/components/WishlistGameCard/WishlistGameCard.tsx index ce323b9..805ba5c 100644 --- a/Frontend/src/components/WishlistGameCard.tsx +++ b/Frontend/src/components/WishlistGameCard/WishlistGameCard.tsx @@ -1,8 +1,8 @@ import { Card, CardMedia, Chip, Button } from '@mui/material' -import '../css/WishlistGameCard.css' -import type { PassiveGameData } from '../types/Game' -import { RemoveFromWishlistFrontend } from '../FrontendLogic/WishlistLogicFrontend' -import { GetSavedUser } from '../FrontendLogic/UserLogicFrontend' +import './WishlistGameCard.css' +import type { PassiveGameData } from '../../types/Game' +import { RemoveFromWishlistFrontend } from '../../FrontendLogic/WishlistLogicFrontend' +import { GetSavedUser } from '../../FrontendLogic/UserLogicFrontend' import { useState } from 'react' import { Link } from 'react-router-dom' From 206398beaa79d8deba19b3c80b1f351b90b63406 Mon Sep 17 00:00:00 2001 From: catjoha04-byte Date: Tue, 17 Nov 2026 13:25:56 +0100 Subject: [PATCH 4/8] fix: update file import paths --- .../src/components/ActiveGameCard/ActiveGameCard.tsx | 4 ++-- Frontend/src/components/Footer/Footer.tsx | 4 ++-- Frontend/src/components/GenreGamesSection.tsx | 2 +- Frontend/src/components/Header/Header.tsx | 6 +++--- Frontend/src/components/PageHeading/PageHeading.tsx | 2 +- .../src/components/PassiveGameCard/PassiveGameCard.tsx | 4 ++-- .../src/components/ProfileEditor/ProfileEditor.tsx | 10 +++++----- .../src/components/RecentReviews/RecentReviews.tsx | 8 ++++---- Frontend/src/components/ReviewCard/ReviewCard.tsx | 4 ++-- .../src/components/ReviewComposer/ReviewComposer.tsx | 2 +- Frontend/src/components/Reviews/Reviews.tsx | 1 + Frontend/src/components/SearchPageResults.tsx | 2 +- Frontend/src/components/TopGames.tsx | 2 +- Frontend/src/components/UserReviews/UserReviews.tsx | 2 +- Frontend/src/pages/FriendsPage/FriendsPage.tsx | 6 +++--- Frontend/src/pages/GamePage/GamePage.tsx | 2 +- Frontend/src/pages/MainPage/MainPage.tsx | 8 ++++---- Frontend/src/pages/ProfilePage/ProfilePage.tsx | 6 +++--- Frontend/src/pages/SearchPage/SearchPage.tsx | 4 ++-- Frontend/src/pages/SignIn&SignUp/SignIn.tsx | 2 +- Frontend/src/pages/SignIn&SignUp/SignUp.tsx | 2 +- Frontend/src/pages/WishlistPage/WishlistPage.tsx | 4 ++-- 22 files changed, 44 insertions(+), 43 deletions(-) diff --git a/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx b/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx index 90cabf6..35b15c2 100644 --- a/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx +++ b/Frontend/src/components/ActiveGameCard/ActiveGameCard.tsx @@ -1,5 +1,5 @@ import { Box, Button, Card, CardContent, CardMedia, Chip, Divider, Typography } from '@mui/material' -import '../css/ActiveGameCard.css' +import './ActiveGameCard.css' import type { GameData } from '../../types/Game' import { GetSavedUser } from '../../FrontendLogic/UserLogicFrontend' import { useState, useEffect } from 'react' @@ -15,7 +15,7 @@ import { UpdateReview } from '../../FrontendLogic/ReviewLogicFrontend' import type { Review } from '../../types/Review' -import Reviews from '../Reviews' +import Reviews from '../Reviews/Reviews' import { UseAuth } from '../../context/AuthContext' type ActiveGameCardProps = { diff --git a/Frontend/src/components/Footer/Footer.tsx b/Frontend/src/components/Footer/Footer.tsx index 2d855ad..1042b37 100644 --- a/Frontend/src/components/Footer/Footer.tsx +++ b/Frontend/src/components/Footer/Footer.tsx @@ -1,5 +1,5 @@ -import '../css/Footer.css' -import gameStartLogo from '../assets/LogoGameStartTransparent.webp' +import './Footer.css' +import gameStartLogo from '../../assets/LogoGameStartTransparent.webp' import { Divider } from '@mui/material' export default function Footer() { diff --git a/Frontend/src/components/GenreGamesSection.tsx b/Frontend/src/components/GenreGamesSection.tsx index 83d1417..a369524 100644 --- a/Frontend/src/components/GenreGamesSection.tsx +++ b/Frontend/src/components/GenreGamesSection.tsx @@ -8,7 +8,7 @@ import { import { type CSSProperties, useEffect, useState } from 'react' import { Autocomplete, Button, TextField, useMediaQuery, Card } from '@mui/material' import type { PageGame } from '../types/Game' -import PassiveGameCard from './PassiveGameCard' +import PassiveGameCard from './PassiveGameCard/PassiveGameCard' import { Link } from 'react-router-dom' const NO_GAMES: PageGame[] = [] diff --git a/Frontend/src/components/Header/Header.tsx b/Frontend/src/components/Header/Header.tsx index eba5666..be6cc05 100644 --- a/Frontend/src/components/Header/Header.tsx +++ b/Frontend/src/components/Header/Header.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { Link, NavLink, useLocation } from 'react-router-dom' -import '../css/Header.css' +import './Header.css' import { House, UserRound, @@ -12,9 +12,9 @@ import { Menu, X } from 'lucide-react' -import gameStartLogo from '../assets/LogoGameStartTransparent.webp' +import gameStartLogo from '../../assets/LogoGameStartTransparent.webp' import Divider from '@mui/material/Divider' -import { UseAuth } from '../context/AuthContext' +import { UseAuth } from '../../context/AuthContext' export default function Header() { const { user, logout } = UseAuth() diff --git a/Frontend/src/components/PageHeading/PageHeading.tsx b/Frontend/src/components/PageHeading/PageHeading.tsx index e88d771..52170fb 100644 --- a/Frontend/src/components/PageHeading/PageHeading.tsx +++ b/Frontend/src/components/PageHeading/PageHeading.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { ArrowLeft } from 'lucide-react' import { useNavigate } from 'react-router-dom' -import '../css/PageHeading.css' +import './PageHeading.css' type PageHeadingProps = { title: string diff --git a/Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx b/Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx index 697fc64..7e65127 100644 --- a/Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx +++ b/Frontend/src/components/PassiveGameCard/PassiveGameCard.tsx @@ -1,4 +1,4 @@ -import '../css/PassiveGameCard.css' +import './PassiveGameCard.css' import Card from '@mui/material/Card' import CardContent from '@mui/material/CardContent' import CardMedia from '@mui/material/CardMedia' @@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography' import CardActionArea from '@mui/material/CardActionArea' import { Link } from 'react-router-dom' import { useLayoutEffect, useRef, useState } from 'react' -import type { PassiveGameData } from '../types/Game' +import type { PassiveGameData } from '../../types/Game' type Props = { game: PassiveGameData diff --git a/Frontend/src/components/ProfileEditor/ProfileEditor.tsx b/Frontend/src/components/ProfileEditor/ProfileEditor.tsx index f6780a1..bbda504 100644 --- a/Frontend/src/components/ProfileEditor/ProfileEditor.tsx +++ b/Frontend/src/components/ProfileEditor/ProfileEditor.tsx @@ -10,11 +10,11 @@ import { MenuItem, TextField } from '@mui/material' -import { FetchGameOptions, type GameOption } from '../FrontendLogic/ProfileLogicFrontend' -import { useDebouncedValue } from '../hooks/useDebouncedValue' -import type { Profile } from '../../../Backend/logic/ProfileLogicBackend' -import { SETUP_OPTIONS } from '../types/SetupOptions' -import '../css/EditProfile.css' +import { FetchGameOptions, type GameOption } from '../../FrontendLogic/ProfileLogicFrontend' +import { useDebouncedValue } from '../../hooks/useDebouncedValue' +import type { Profile } from '../../../../Backend/logic/ProfileLogicBackend' +import { SETUP_OPTIONS } from '../../types/SetupOptions' +import './EditProfile.css' const GAME_OPTIONS_PAGE_SIZE = 20 diff --git a/Frontend/src/components/RecentReviews/RecentReviews.tsx b/Frontend/src/components/RecentReviews/RecentReviews.tsx index 86cd6fd..c8c6bbb 100644 --- a/Frontend/src/components/RecentReviews/RecentReviews.tsx +++ b/Frontend/src/components/RecentReviews/RecentReviews.tsx @@ -1,13 +1,13 @@ import { useLayoutEffect, useRef, useState } from 'react' import useMediaQuery from '@mui/material/useMediaQuery' -import ReviewCard from './ReviewCard' +import ReviewCard from '../ReviewCard/ReviewCard' import { Card } from '@mui/material' -import '../css/RecentReviews.css' +import './RecentReviews.css' import { GetSavedRecentReviewCount, SaveRecentReviewCount -} from '../FrontendLogic/MainPageLogicFrontend' -import type { Review } from '../types/Review' +} from '../../FrontendLogic/MainPageLogicFrontend' +import type { Review } from '../../types/Review' type RecentReviewsProps = { reviews: Review[] diff --git a/Frontend/src/components/ReviewCard/ReviewCard.tsx b/Frontend/src/components/ReviewCard/ReviewCard.tsx index 62f20b1..da842fa 100644 --- a/Frontend/src/components/ReviewCard/ReviewCard.tsx +++ b/Frontend/src/components/ReviewCard/ReviewCard.tsx @@ -3,8 +3,8 @@ import { Link } from 'react-router-dom' import Button from '@mui/material/Button' import Rating from '@mui/material/Rating' import Typography from '@mui/material/Typography' -import '../css/Reviews.css' -import type { Review } from '../types/Review' +import './ReviewCard.css' +import type { Review } from '../../types/Review' type ReviewCardProps = { review: Review diff --git a/Frontend/src/components/ReviewComposer/ReviewComposer.tsx b/Frontend/src/components/ReviewComposer/ReviewComposer.tsx index 77a097f..f502afe 100644 --- a/Frontend/src/components/ReviewComposer/ReviewComposer.tsx +++ b/Frontend/src/components/ReviewComposer/ReviewComposer.tsx @@ -3,7 +3,7 @@ import Button from '@mui/material/Button' import Rating from '@mui/material/Rating' import TextField from '@mui/material/TextField' import Typography from '@mui/material/Typography' -import '../css/ReviewComposer.css' +import './ReviewComposer.css' type ReviewComposerProps = { isEditing: boolean diff --git a/Frontend/src/components/Reviews/Reviews.tsx b/Frontend/src/components/Reviews/Reviews.tsx index bbf401f..1647fc8 100644 --- a/Frontend/src/components/Reviews/Reviews.tsx +++ b/Frontend/src/components/Reviews/Reviews.tsx @@ -6,6 +6,7 @@ import Typography from '@mui/material/Typography' import ReviewCard from '../ReviewCard/ReviewCard' import ReviewComposer from '../ReviewComposer/ReviewComposer' import type { Review } from '../../types/Review' +import './Reviews.css' function GetAverageRating(reviews: Review[]): number | null { if (reviews.length === 0) return null diff --git a/Frontend/src/components/SearchPageResults.tsx b/Frontend/src/components/SearchPageResults.tsx index acc40f1..e0aebe7 100644 --- a/Frontend/src/components/SearchPageResults.tsx +++ b/Frontend/src/components/SearchPageResults.tsx @@ -1,7 +1,7 @@ import { memo } from 'react' import { Pagination } from '@mui/material' import type { Game } from '../../../Backend/Steam' -import PassiveGameCard from './PassiveGameCard' +import PassiveGameCard from './PassiveGameCard/PassiveGameCard' const SearchResultsGrid = memo(function SearchResultsGrid({ games }: { games: Game[] }) { return ( diff --git a/Frontend/src/components/TopGames.tsx b/Frontend/src/components/TopGames.tsx index 379efec..d7a06d6 100644 --- a/Frontend/src/components/TopGames.tsx +++ b/Frontend/src/components/TopGames.tsx @@ -1,6 +1,6 @@ import { Card } from '@mui/material' import type { PageGame } from '../types/Game' -import PassiveGameCard from './PassiveGameCard' +import PassiveGameCard from './PassiveGameCard/PassiveGameCard' interface TopGamesProps { loading: boolean diff --git a/Frontend/src/components/UserReviews/UserReviews.tsx b/Frontend/src/components/UserReviews/UserReviews.tsx index 2ee220c..fb78594 100644 --- a/Frontend/src/components/UserReviews/UserReviews.tsx +++ b/Frontend/src/components/UserReviews/UserReviews.tsx @@ -6,7 +6,7 @@ import Pagination from '@mui/material/Pagination' import useMediaQuery from '@mui/material/useMediaQuery' import ReviewCard from '../ReviewCard/ReviewCard' import ReviewComposer from '../ReviewComposer/ReviewComposer' -import '../css/UserReviews.css' +import './UserReviews.css' import { DeleteReview, GetReviewsByUser, diff --git a/Frontend/src/pages/FriendsPage/FriendsPage.tsx b/Frontend/src/pages/FriendsPage/FriendsPage.tsx index 452f297..174d175 100644 --- a/Frontend/src/pages/FriendsPage/FriendsPage.tsx +++ b/Frontend/src/pages/FriendsPage/FriendsPage.tsx @@ -1,5 +1,5 @@ import Footer from '../../components/Footer/Footer' -import Header from '../../components/Header' +import Header from '../../components/Header/Header' import PageHeading from '../../components/PageHeading/PageHeading' import { Autocomplete, @@ -12,8 +12,8 @@ import { TextField } from '@mui/material' import { useEffect, useMemo, useState } from 'react' -import '../css/FriendsPage.css' -import WishlistGameCard from '../../components/WishlistGameCard' +import './FriendsPage.css' +import WishlistGameCard from '../../components/WishlistGameCard/WishlistGameCard' import type { Game } from '../../../../Backend/Steam' import { AddFriend, diff --git a/Frontend/src/pages/GamePage/GamePage.tsx b/Frontend/src/pages/GamePage/GamePage.tsx index 5c539c1..50fe3ab 100644 --- a/Frontend/src/pages/GamePage/GamePage.tsx +++ b/Frontend/src/pages/GamePage/GamePage.tsx @@ -1,4 +1,4 @@ -import '../css/GamePage.css' +import './GamePage.css' import Header from '../../components/Header/Header.tsx' import Footer from '../../components/Footer/Footer.tsx' import ActiveGameCard from '../../components/ActiveGameCard/ActiveGameCard.tsx' diff --git a/Frontend/src/pages/MainPage/MainPage.tsx b/Frontend/src/pages/MainPage/MainPage.tsx index 726f834..f6607d9 100644 --- a/Frontend/src/pages/MainPage/MainPage.tsx +++ b/Frontend/src/pages/MainPage/MainPage.tsx @@ -1,5 +1,5 @@ -import '../css/MainPage.css' -import Header from '../../components/Header' +import './MainPage.css' +import Header from '../../components/Header/Header' import Footer from '../../components/Footer/Footer' import { LoadTop3Games, @@ -10,8 +10,8 @@ import { FetchGenres } from '../../FrontendLogic/SearchPageLogicFrontend' import { Link } from 'react-router-dom' import { useEffect, useState } from 'react' import { Button } from '@mui/material' -import maskot_gamestart from '../assets/maskot_gamestart.webp' -import RecentReviews from '../../components/RecentReviews' +import maskot_gamestart from '../../assets/maskot_gamestart.webp' +import RecentReviews from '../../components/RecentReviews/RecentReviews' import { GetRecentReviews } from '../../FrontendLogic/ReviewLogicFrontend' import type { Review } from '../../types/Review' import type { PageGame } from '../../types/Game' diff --git a/Frontend/src/pages/ProfilePage/ProfilePage.tsx b/Frontend/src/pages/ProfilePage/ProfilePage.tsx index be9c54a..c1a31a3 100644 --- a/Frontend/src/pages/ProfilePage/ProfilePage.tsx +++ b/Frontend/src/pages/ProfilePage/ProfilePage.tsx @@ -1,6 +1,6 @@ import Footer from '../../components/Footer/Footer.tsx' -import Header from '../../components/Header.tsx' -import '../css/ProfilePage.css' +import Header from '../../components/Header/Header.tsx' +import './ProfilePage.css' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import ProfileCard from '../../components/ProfileCard.tsx' import { useEffect, useState, type ReactNode } from 'react' @@ -12,7 +12,7 @@ import { type GameOption } from '../../FrontendLogic/ProfileLogicFrontend.ts' import type { Profile } from '../../../../Backend/logic/ProfileLogicBackend.ts' -import ProfileEditor from '../../components/ProfileEditor.tsx' +import ProfileEditor from '../../components/ProfileEditor/ProfileEditor.tsx' import UserReviews from '../../components/UserReviews/UserReviews.tsx' import { Button, Card, CardContent } from '@mui/material' diff --git a/Frontend/src/pages/SearchPage/SearchPage.tsx b/Frontend/src/pages/SearchPage/SearchPage.tsx index 781494d..d2a5583 100644 --- a/Frontend/src/pages/SearchPage/SearchPage.tsx +++ b/Frontend/src/pages/SearchPage/SearchPage.tsx @@ -1,5 +1,5 @@ -import '../css/SearchPage.css' -import Header from '../../components/Header' +import './SearchPage.css' +import Header from '../../components/Header/Header' import Footer from '../../components/Footer/Footer' import PageHeading from '../../components/PageHeading/PageHeading' import SearchPageControls, { type SortOption } from '../../components/SearchPageControls' diff --git a/Frontend/src/pages/SignIn&SignUp/SignIn.tsx b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx index 80876ff..915b639 100644 --- a/Frontend/src/pages/SignIn&SignUp/SignIn.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignIn.tsx @@ -20,7 +20,7 @@ import { useNavigate } from 'react-router-dom' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import { SigninUser } from '../../FrontendLogic/UserLogicFrontend' import { UseAuth } from '../../context/AuthContext' -import '../css/SignInUpCard.css' +import './SignInUpCard.css' export default function SignInPage() { const [EmailError, SetEmailError] = React.useState(false) diff --git a/Frontend/src/pages/SignIn&SignUp/SignUp.tsx b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx index f1d33cc..48addc8 100644 --- a/Frontend/src/pages/SignIn&SignUp/SignUp.tsx +++ b/Frontend/src/pages/SignIn&SignUp/SignUp.tsx @@ -17,7 +17,7 @@ import Footer from '../../components/Footer/Footer.tsx' import PageHeading from '../../components/PageHeading/PageHeading.tsx' import { SignupUser } from '../../FrontendLogic/UserLogicFrontend' import { UseAuth } from '../../context/AuthContext' -import '../css/SignInUpCard.css' +import './SignInUpCard.css' export default function SignUpPage() { const [UsernameError, SetUsernameError] = React.useState(false) diff --git a/Frontend/src/pages/WishlistPage/WishlistPage.tsx b/Frontend/src/pages/WishlistPage/WishlistPage.tsx index 26283c2..77ddcc7 100644 --- a/Frontend/src/pages/WishlistPage/WishlistPage.tsx +++ b/Frontend/src/pages/WishlistPage/WishlistPage.tsx @@ -1,7 +1,7 @@ -import '../css/WishlistPage.css' +import './WishlistPage.css' import Header from '../../components/Header/Header' import Footer from '../../components/Footer/Footer' -import WishlistGameCard from '../../components/WishlistGameCard' +import WishlistGameCard from '../../components/WishlistGameCard/WishlistGameCard' import { FormControl, Select, MenuItem, InputLabel, Pagination, Card } from '@mui/material' import type { SelectChangeEvent } from '@mui/material' import { useState, useEffect, useMemo } from 'react' From 8157778d1404d4a3575ca286d67aeb57601eb5fe Mon Sep 17 00:00:00 2001 From: catjoha04-byte Date: Tue, 17 Nov 2026 13:26:10 +0100 Subject: [PATCH 5/8] test: update file import and mock paths --- Frontend/src/tests/ActiveGameCard.test.tsx | 2 +- Frontend/src/tests/FriendsPage.test.tsx | 8 ++++---- Frontend/src/tests/GamePage.test.tsx | 6 +++--- Frontend/src/tests/PassiveGameCard.test.tsx | 2 +- Frontend/src/tests/RecentReviews.test.tsx | 2 +- Frontend/src/tests/ReviewCard.test.tsx | 2 +- Frontend/src/tests/SearchPage.test.tsx | 8 ++++---- Frontend/src/tests/UserReviews.test.tsx | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Frontend/src/tests/ActiveGameCard.test.tsx b/Frontend/src/tests/ActiveGameCard.test.tsx index 4b3a02a..8cf9589 100644 --- a/Frontend/src/tests/ActiveGameCard.test.tsx +++ b/Frontend/src/tests/ActiveGameCard.test.tsx @@ -18,7 +18,7 @@ vi.mock('../FrontendLogic/ReviewLogicFrontend', () => ({ GetReviewsForGame: vi.fn().mockResolvedValue([]) })) -import ActiveGameCard from '../components/ActiveGameCard' +import ActiveGameCard from '../components/ActiveGameCard/ActiveGameCard' const testGame: GameData = { id: 570, diff --git a/Frontend/src/tests/FriendsPage.test.tsx b/Frontend/src/tests/FriendsPage.test.tsx index 3adacca..e479dd9 100644 --- a/Frontend/src/tests/FriendsPage.test.tsx +++ b/Frontend/src/tests/FriendsPage.test.tsx @@ -21,9 +21,9 @@ vi.mock('../FrontendLogic/FriendLogicFrontend', () => ({ GetMyFriendId })) vi.mock('../context/AuthContext', () => ({ UseAuth })) -vi.mock('../components/Header', () => ({ default: () =>
})) -vi.mock('../components/Footer', () => ({ default: () =>