Skip to content

Commit 97579ed

Browse files
committed
news placeholder if no media
1 parent 9769edf commit 97579ed

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/lib/types/Games.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export const Games: Game[] = [
4949
'matek',
5050
'CyberAgent'
5151
],
52+
media: [
53+
'/blogs/example/ex.png',
54+
'/blogs/example/ex.png',
55+
'/blogs/example/ex.png',
56+
'/blogs/frostrial/clothes.png'
57+
],
5258
state: GameState['In Development'],
5359
sboxIdent: 'fish.blocks_and_bullets'
5460
},
@@ -83,12 +89,6 @@ export const Games: Game[] = [
8389
title: 'In This House',
8490
summary:
8591
'Spooky Robathon with 3 levels and 3 monsters trying to kick you out. 1st Place winner of the Mighty Brick Game Jam.',
86-
media: [
87-
'/blogs/example/ex.png',
88-
'/blogs/example/ex.png',
89-
'/blogs/example/ex.png',
90-
'/blogs/frostrial/clothes.png'
91-
],
9292
contributors: ['ubre', 'Grodbert', 'ceitine', 'gio', 'rndtrash', 'Luke', 'CyberAgent'],
9393
date: new Date(2023, 10, 20),
9494
state: GameState['Dead Till Revival'],

src/lib/types/News.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface NewsPost {
2323
Title: string;
2424
Summary: string;
2525
Author: BackendUser;
26-
Media: string;
26+
Media: string | undefined;
2727
Sections: NewsSection[];
2828
Package: string;
2929
}
@@ -52,7 +52,7 @@ export const BlogAsNews = function (blog: App.BlogPost): NewsEntry {
5252
export const NewsAsNews = function (news: NewsPost): NewsEntry {
5353
return {
5454
url: `https://sbox.game${news.Url}`,
55-
thumbnail: news.Media,
55+
thumbnail: news.Media ?? '/home/news-placeholder.png',
5656
date: new Date(news.Created),
5757
title: news.Title,
5858
summary: news.Summary,

static/home/news-placeholder.png

3.62 KB
Loading

0 commit comments

Comments
 (0)