diff --git a/web/src/components/Guide/GuideCard.tsx b/web/src/components/Guide/GuideCard.tsx index 67556a1480ad3292b138695f449d15e3ecb142f1..2b3555ce74c589b012f7c923c416f2a509fbb156 100644 --- a/web/src/components/Guide/GuideCard.tsx +++ b/web/src/components/Guide/GuideCard.tsx @@ -10,12 +10,13 @@ export interface GuideCardProps{ gameId:string postId:string guidesLoc:string + headerUrl?:string } -export const GuideCard: React.FC<GuideCardProps> = ({ title,username,createdAt,content,status,gameId,postId,guidesLoc }) => ( +export const GuideCard: React.FC<GuideCardProps> = ({ title,username,createdAt,content,status,gameId,postId,guidesLoc,headerUrl }) => ( <Link href={`/${gameId}/${guidesLoc}/${postId}`}> <div className="card w-full bg-base-100 shadow-xl"> - <figure><img src="https://dafunda.com/wp-content/uploads/2021/03/CSGO-steam-terhapus.jpg" alt="Shoes" /></figure> + <figure><img src={headerUrl} alt="Header" /></figure> <div className="card-body"> <div> {status === "PUBLISHED"?( diff --git a/web/src/pages/[game]/guides/index.tsx b/web/src/pages/[game]/guides/index.tsx index 7dc3397005c0ae456712a1e0388189fb517396f8..f305c723dcd3b0133eacd054bf31f9f722e1295e 100644 --- a/web/src/pages/[game]/guides/index.tsx +++ b/web/src/pages/[game]/guides/index.tsx @@ -61,7 +61,7 @@ const Guides: NextPage = () => { <div className="grid xl:grid-cols-3 grid-flow-row gap-8 content-center justify-center items-center my-6"> {data?.map((guide) => { return ( - <GuideCard key={guide.id} title={guide.title} username={guide.author.name ?? ''} createdAt={guide.createdAt} content={guide.content ?? ''} status={guide.status} gameId={gameId as string} postId={guide.id} guidesLoc="guides"></GuideCard> + <GuideCard key={guide.id} title={guide.title} username={guide.author.name ?? ''} createdAt={guide.createdAt} content={guide.content ?? ''} status={guide.status} gameId={gameId as string} postId={guide.id} guidesLoc="guides" headerUrl={guide.header?.url as string}></GuideCard> ) })} </div> diff --git a/web/src/pages/[game]/your-guides/index.tsx b/web/src/pages/[game]/your-guides/index.tsx index ecbcdfdc9ccfb702685d28d35779a114894f37c1..f3263594a859ae34e3782511fed69abcf5220faa 100644 --- a/web/src/pages/[game]/your-guides/index.tsx +++ b/web/src/pages/[game]/your-guides/index.tsx @@ -25,7 +25,7 @@ const Guides: NextPage = () => { <div className="grid xl:grid-cols-3 grid-flow-row gap-8 content-center justify-center items-center my-6"> {data?.map((guide) => { return ( - <GuideCard key={guide.id} title={guide.title} username={guide.author.name ?? ''} createdAt={guide.createdAt} content={guide.content ?? ''} status={guide.status} gameId={id as string} postId={guide.id} guidesLoc="your-guides"></GuideCard> + <GuideCard key={guide.id} title={guide.title} username={guide.author.name ?? ''} createdAt={guide.createdAt} content={guide.content ?? ''} status={guide.status} gameId={id as string} postId={guide.id} guidesLoc="your-guides" headerUrl={guide.header?.url as string}></GuideCard> ) })} </div>