Skip to content

Commit 03b2c15

Browse files
committed
refactor gameEmbedID to playableID, add width and height checks
1 parent 90883b5 commit 03b2c15

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

client/src/hooks/useGames.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type ApiGame = {
2424
itchEmbedID: string;
2525
thumbnail: string | null;
2626
event: number | null;
27-
itchGameEmbedID: string;
27+
itchGamePlayableID: string;
2828
itchGameWidth: number;
2929
itchGameHeight: number;
3030
contributors: Contributor[];

client/src/pages/games/[id].tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function IndividualGamePage() {
5252
const gameTitle = game.name;
5353
const gameCover = game.gameCover;
5454
const gameDescription = game.description.split("\n");
55-
const gameEmbedID = game.itchGameEmbedID;
55+
const gamePlayableID = game.itchGamePlayableID;
5656
const gameWidth = game.itchGameWidth;
5757
const gameHeight = game.itchGameHeight;
5858

@@ -89,10 +89,10 @@ export default function IndividualGamePage() {
8989
<main>
9090
<section className="w-full items-center justify-center bg-popover">
9191
<div className="mx-auto flex max-w-7xl justify-center p-0 sm:p-8">
92-
{gameEmbedID ? (
92+
{gamePlayableID && gameWidth && gameHeight ? (
9393
<div className="m-auto flex overflow-auto">
9494
<GameEmbed
95-
embedID={gameEmbedID}
95+
embedID={gamePlayableID}
9696
gameWidth={gameWidth}
9797
gameHeight={gameHeight}
9898
gameImage={gameCover}

client/src/placeholderData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const placeholderGames = [
5656
hostURL: "/",
5757
itchEmbedID: "1",
5858
thumbnail: "/landing_placeholder.png",
59-
itchGameEmbedID: 0,
59+
itchGamePlayableID: 0,
6060
itchGameWidth: 0,
6161
itchGameHeight: 0,
6262
event: 1,
@@ -70,7 +70,7 @@ export const placeholderGames = [
7070
hostURL: "/",
7171
itchEmbedID: "1",
7272
thumbnail: "/landing_placeholder.png",
73-
itchGameEmbedID: 0,
73+
itchGamePlayableID: 0,
7474
itchGameWidth: 0,
7575
itchGameHeight: 0,
7676
event: 1,
@@ -84,7 +84,7 @@ export const placeholderGames = [
8484
hostURL: "/",
8585
itchEmbedID: "1",
8686
thumbnail: "/landing_placeholder.png",
87-
itchGameEmbedID: 0,
87+
itchGamePlayableID: 0,
8888
itchGameWidth: 0,
8989
itchGameHeight: 0,
9090
event: 1,

0 commit comments

Comments
 (0)