@@ -3,6 +3,7 @@ import { useRouter } from "next/router";
33import React from "react" ;
44import { SocialIcon } from "react-social-icons" ;
55
6+ import { GameEmbed } from "@/components/ui/GameEmbed" ;
67import { ItchEmbed } from "@/components/ui/ItchEmbed" ;
78import { useGame } from "@/hooks/useGames" ;
89
@@ -51,6 +52,9 @@ export default function IndividualGamePage() {
5152 const gameTitle = game . name ;
5253 const gameCover = game . gameCover ;
5354 const gameDescription = game . description . split ( "\n" ) ;
55+ const gameEmbedID = game . itchGameEmbedID ;
56+ const gameWidth = game . itchGameWidth ;
57+ const gameHeight = game . itchGameHeight ;
5458
5559 const completionLabels : Record < number , string > = {
5660 1 : "WIP" ,
@@ -83,16 +87,27 @@ export default function IndividualGamePage() {
8387 return (
8488 < div className = "min-h-screen bg-background font-sans text-foreground" >
8589 < main >
86- < section className = "w-full bg-popover" >
87- < div className = "mx-auto max-w-7xl p-0 sm:p-8" >
88- < Image
89- src = { gameCover }
90- alt = "Game Cover"
91- width = { 800 }
92- height = { 800 }
93- className = "max-h-[60vh] w-full object-cover sm:mx-auto sm:h-auto sm:max-h-[60vh] sm:rounded-2xl sm:object-contain"
94- priority
95- />
90+ < section className = "w-full items-center justify-center bg-popover" >
91+ < div className = "mx-auto flex max-w-7xl justify-center p-0 sm:p-8" >
92+ { gameEmbedID != "0" ? (
93+ < div className = "m-auto flex overflow-auto" >
94+ < GameEmbed
95+ embedID = { gameEmbedID }
96+ gameWidth = { gameWidth }
97+ gameHeight = { gameHeight }
98+ gameImage = { gameCover }
99+ />
100+ </ div >
101+ ) : (
102+ < Image
103+ src = { gameCover }
104+ alt = "Game Cover"
105+ width = { 800 }
106+ height = { 800 }
107+ className = "max-h-[60vh] w-full object-cover sm:mx-auto sm:h-auto sm:max-h-[60vh] sm:rounded-2xl sm:object-contain"
108+ priority
109+ />
110+ ) }
96111 </ div >
97112 </ section >
98113
@@ -171,9 +186,8 @@ export default function IndividualGamePage() {
171186 </ section >
172187
173188 < section className = "mt-8 flex w-full flex-col items-center gap-6" >
174- { game . itchEmbedID && (
175- < ItchEmbed embedID = { game . itchEmbedID } name = { gameTitle } />
176- ) }
189+ < ItchEmbed embedID = { game . itchEmbedID } name = { gameTitle } />
190+
177191 < h2 className = "font-jersey10 text-5xl text-primary" > ARTWORK</ h2 >
178192
179193 < div className = "mx-auto mb-6 flex h-auto w-full max-w-4xl flex-col items-center gap-4 px-4 sm:flex-row sm:justify-center sm:gap-6 sm:px-6 md:h-60" >
0 commit comments