Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/FriendLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Gql } from './LogicConnection'
import type { Game } from '../../../Backend/Steam'
import type { Game } from '../types/Game'

export interface Friend {
id: number
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/GameLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Game } from '../../../Backend/Steam'
import type { Game } from '../types/Game'
import { BACKEND_URL, NETWORK_ERROR_MESSAGE } from './LogicConnection'
import { OrNull, ReadStored, RemoveStored, WriteStored } from './Storage'

Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/MainPageLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Gql } from './LogicConnection'
import { type Game } from '../../../Backend/Steam'
import { type Game } from '../types/Game'
import { IsBoolean, IsInteger, IsString, ReadStored, WriteStored } from '../FrontendLogic/Storage'

export type MainPageGenreSection = 'top10' | 'discounts'
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/ProfileLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Gql } from './LogicConnection'
import type { Profile } from '../../../Backend/logic/ProfileLogicBackend'
import type { Profile } from '../types/Profile'

export interface GameOption {
appid: number
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/UserLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Gql } from './LogicConnection'
import type { User } from '../../../Backend/logic/UserLogicBackend'
import type { User } from '../types/User'
import { IsUser, OrNull, ReadStored, RemoveStored, WriteStored } from './Storage'

const USER_FIELDS = 'id email username token'
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/WishlistLogicFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Game } from '../../../Backend/Steam'
import { type Game } from '../types/Game'
import { Gql } from './LogicConnection'
import { IsString, ReadStored, WriteStored } from './Storage'

Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/components/ActiveGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default function ActiveGameCard({
</Typography>
</Box>
<Divider />
<Box className="activeGameGenres" aria-label="Game genres">
<Box className="activeGameGenres" aria-label="Game genres" role="group">
{game.genre.map((genre) => (
<Chip
className="activeGameGenreChip"
Expand Down
4 changes: 2 additions & 2 deletions Frontend/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export default function Footer() {
flexItem
/>
<footer className="footerSectionFooter">
<h1 id="footerh1">
<p id="footerh1">
<img
className="footerBrandLogo"
src={gameStartLogo}
alt="GameStart"
loading="lazy"
/>
© 2026
</h1>
</p>
</footer>
</div>
)
Expand Down
8 changes: 6 additions & 2 deletions Frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export default function Header() {
</Link>
</div>

<div id="navigationMenue" className={menuOpen ? 'is-open' : undefined}>
<nav
id="navigationMenue"
className={menuOpen ? 'is-open' : undefined}
aria-label="Main"
>
{navigationLinks.map((link) => (
<NavLink
key={link.to}
Expand Down Expand Up @@ -101,7 +105,7 @@ export default function Header() {
Sign In
</NavLink>
)}
</div>
</nav>
</header>
<Divider className="headerDivider" />
{menuOpen && <div className="headerBackdrop" onClick={CloseMenu} />}
Expand Down
4 changes: 2 additions & 2 deletions Frontend/src/components/PassiveGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function PassiveGameCard({ game, rank }: Props) {
className={`passiveGameCard${rank === undefined ? '' : ' rankedPassiveGameCard'}`}
>
{rank !== undefined && (
<span className="passiveGameCardRank" aria-label={`Rank ${rank}`}>
<span className="passiveGameCardRank" aria-label={`Rank ${rank}`} role="rank">
#{rank}
</span>
)}
Expand All @@ -57,7 +57,7 @@ export default function PassiveGameCard({ game, rank }: Props) {
className="passiveGameCardMedia"
component="img"
image={game.image}
alt={game.name}
alt=""
/>
<CardContent className="passiveGameCardContent">
<div
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/components/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ProfileCard({ profile, favouriteGame }: ProfileCardProps
<Card className="profile-card">
<CardContent>
<div className="user-icon">
<Avatar className="user-avatar">
<Avatar className="user-avatar" aria-hidden="true">
{profile.username.charAt(0).toUpperCase()}
</Avatar>
<h2 id="user-name">{profile.username}</h2>
Expand Down
6 changes: 5 additions & 1 deletion Frontend/src/components/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ export default function ReviewCard({
className="app-button"
size="small"
onClick={() => onEdit(review)}
aria-label={`Edit review for ${game?.name} `}
>
Edit
</Button>
<Button
className="reviewCardDelete"
size="small"
onClick={() => onDelete(review)}
aria-label={`Delete review for ${game?.name} `}
>
Delete
</Button>
Expand All @@ -145,7 +147,9 @@ export default function ReviewCard({
{reviewText || (
<p className="reviewCardText reviewCardNoText">No written review</p>
)}
{canExpand && !isExpanded && <div className="reviewCardTextFade" />}
{canExpand && !isExpanded && (
<div className="reviewCardTextFade" aria-hidden="true" />
)}
</div>
) : (
reviewText
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/components/Reviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function Reviews({
</p>
)}
<Divider />
<div className="activeGameReviewList" aria-label="Game reviews">
<div className="activeGameReviewList" aria-label="Game reviews" role="group">
{reviews.length > 0 ? (
reviews.map((review) => (
<ReviewCard
Expand Down
13 changes: 11 additions & 2 deletions Frontend/src/components/SearchPageControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,20 @@ export default function SearchPageControls({
}: SearchPageControlsProps) {
return (
<>
<Paper className="searchbar" component="form" onSubmit={onSearchSubmit}>
<Paper className="searchbar" component="form" onSubmit={onSearchSubmit} role="search">
<InputBase
name="search"
className="searchinput"
placeholder="Search here or use filter"
value={searchValue}
onChange={(event) => onSearchChange(event.target.value)}
inputProps={{ 'aria-label': 'Search games' }}
/>
<IconButton aria-label="clear" className="searchConfirm" onClick={onClearSearch}>
<IconButton
aria-label="Clear search"
className="searchConfirm"
onClick={onClearSearch}
>
<X />
</IconButton>
<IconButton
Expand All @@ -69,6 +75,7 @@ export default function SearchPageControls({
className={`filterbutton${isFilterActive ? ' is-active' : ''}`}
aria-label="Toggle filters"
aria-pressed={isFilterActive}
aria-expanded={isFilterActive}
onClick={onToggleFilters}
>
<Funnel aria-hidden="true" id="funnelicon" />
Expand All @@ -79,6 +86,7 @@ export default function SearchPageControls({
<FormControl size="small">
<InputLabel id="search-sort-label">Sort by</InputLabel>
<Select
name="sort"
labelId="search-sort-label"
value={activeSorting}
onChange={onSortChange}
Expand All @@ -104,6 +112,7 @@ export default function SearchPageControls({
<FormControl size="small">
<InputLabel id="filter-by-label">Filter by genre</InputLabel>
<Select
name="genres"
labelId="filter-by-label"
multiple
value={activeFilters}
Expand Down
2 changes: 2 additions & 0 deletions Frontend/src/components/SearchPageResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function SearchPageResults({
count={pageCount}
page={page}
onChange={(_, value) => onPageChange(value)}
aria-label="Search page result, top"
/>
</div>
{error && (
Expand All @@ -83,6 +84,7 @@ export default function SearchPageResults({
count={pageCount}
page={page}
onChange={HandleBottomPageChange}
aria-label="Search page result, bottom"
/>
</>
)
Expand Down
13 changes: 9 additions & 4 deletions Frontend/src/components/UserReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,15 @@ export default function UserReviews({ userId }: UserReviewsProps) {
)
}

function RenderPagination(scrollToTop: boolean) {
function RenderPagination(scrollToTop: boolean, aria: string) {
if (pageCount <= 1) return null
return (
<Pagination
className="user-reviews-pagination"
count={pageCount}
page={page}
onChange={(_, value) => ChangePage(value, scrollToTop)}
aria-label={aria}
/>
)
}
Expand All @@ -163,15 +164,19 @@ export default function UserReviews({ userId }: UserReviewsProps) {
<p className="user-reviews-message">You have not reviewed any games yet.</p>
) : (
<>
{RenderPagination(false)}
<div className="user-reviews-columns" aria-label="Your reviews">
{RenderPagination(false, 'User reviews, top')}
<div
className="user-reviews-columns"
aria-label="Your reviews"
role="group"
>
{columns.map((column, columnIndex) => (
<div className="user-reviews-column" key={columnIndex}>
{column.map(RenderReview)}
</div>
))}
</div>
{RenderPagination(true)}
{RenderPagination(true, 'User reviews, bottom')}
</>
)}
</CardContent>
Expand Down
6 changes: 5 additions & 1 deletion Frontend/src/components/WishlistGameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ export default function WishlistGameCard({
</div>

{error && (
<p className="wishlistGameCardError app-message app-message--error app-message--inline" role="alert">
<p
className="wishlistGameCardError app-message app-message--error app-message--inline"
role="alert"
>
{error}
</p>
)}
Expand All @@ -82,6 +85,7 @@ export default function WishlistGameCard({
size="small"
disabled={isRemoving}
onClick={HandleRemove}
aria-label={`Remove ${game.name} from wishlist`}
>
Remove
</Button>
Expand Down
6 changes: 6 additions & 0 deletions Frontend/src/css/SearchPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
margin-left: 0.5rem;
}

.searchPageMain {
display: flex;
flex: 1;
flex-direction: column;
}

.searchConfirm.MuiIconButton-root,
.filterbutton.MuiIconButton-root {
color: var(--primary-text-color);
Expand Down
Loading