Skip to content

Commit

Permalink
refactor: use Grid instead of classical div (#1059)
Browse files Browse the repository at this point in the history
* refactor: use Grid instead of classical div

* refactor: remove useless div

* refactor: remove useless div

* refactor: remove useless divs

* refactor: remove useless divs
  • Loading branch information
jy95 authored Dec 1, 2024
1 parent 0770437 commit ef97191
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/app/[locale]/backlog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function BacklogViewer() {
headerAlign: 'center',
renderCell: ({ value }) => (
<Tooltip title={value} aria-label={value}>
<div>{value}</div>
{value}
</Tooltip>
),
width: 270
Expand All @@ -49,7 +49,7 @@ export default function BacklogViewer() {
headerAlign: 'center',
renderCell: ({ value }) => (
<Tooltip title={value || ""} aria-label={value || ""}>
<div>{value || ""}</div>
{value || ""}
</Tooltip>
),
width: 270
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/games/dlcs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function GamesGalleryList() {
}

return (
<div>
<>
{
data.map(game =>
<Accordion key={game.name}>
Expand Down Expand Up @@ -82,7 +82,7 @@ function GamesGalleryList() {
</Accordion>
)
}
</div>
</>
)
}

Expand Down
15 changes: 7 additions & 8 deletions src/app/[locale]/games/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import type { CardGame } from "@/redux/sharedDefintion";

export default function GamesGalleryGrid() {
return (
<div>
<>
<GamesFilters />
<GamesGalleryGridInner />
</div>
</>
);
}

Expand Down Expand Up @@ -69,19 +69,18 @@ function GamesGalleryGridInner() {
>
{allGames.map(renderRow)}
</Grid>
<div style={{
justifyContent: "center",
display: "flex",
marginTop: "15px"
}}>
<Grid
container
justifyContent="center"
>
<LoadingButton
loading={isFetching}
disabled={ page >= (data?.total_pages || 1) }
onClick={() => dispatch(nextPage())}
>
<span>{t('loadMore')}</span>
</LoadingButton>
</div>
</Grid>
</>
);
}
4 changes: 2 additions & 2 deletions src/app/[locale]/games/series/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function GamesGalleryList() {
}

return (
<div>
<>
{
data.map(serie =>
<Accordion key={serie.name}>
Expand Down Expand Up @@ -82,7 +82,7 @@ function GamesGalleryList() {
</Accordion>
)
}
</div>
</>
)
}

Expand Down
50 changes: 24 additions & 26 deletions src/app/[locale]/tests/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,29 @@ export default function TestsPage() {
}

return (
<div>
<Grid
container
spacing={1}
rowSpacing={1}
>
{
data
.items
.map(game =>
<Grid
key={game.id}
size={{
xs: 12,
sm: 6,
md: 3,
// 5 items for this screen size
lg: 2.4
}}
>
<CardEntry game={game}/>
</Grid>
)
}
</Grid>
</div>
<Grid
container
spacing={1}
rowSpacing={1}
>
{
data
.items
.map(game =>
<Grid
key={game.id}
size={{
xs: 12,
sm: 6,
md: 3,
// 5 items for this screen size
lg: 2.4
}}
>
<CardEntry game={game}/>
</Grid>
)
}
</Grid>
)
}

0 comments on commit ef97191

Please sign in to comment.