diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-04-14 03:13:02 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-04-14 03:13:02 -0700 |
| commit | 073fc8fe92e60fd4662580e8216600379a0edfae (patch) | |
| tree | 4a78d028fd78af8d30584df24bbfc164e1de9896 /site/src/components | |
| parent | 7b93b8587d93d8f86ac8d8e25c589bba02c20476 (diff) | |
chore: refactor id to game title conversion to shared module
Diffstat (limited to 'site/src/components')
| -rw-r--r-- | site/src/components/NewsFeed.tsx | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/site/src/components/NewsFeed.tsx b/site/src/components/NewsFeed.tsx index 99099be..311fe75 100644 --- a/site/src/components/NewsFeed.tsx +++ b/site/src/components/NewsFeed.tsx @@ -1,3 +1,4 @@ +import { getGameTitle } from "../utils.ts"; export interface NewsData { date: string; @@ -31,7 +32,7 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({ newsItems }) => { return ( <div - key={news.identifier + "-" + news.timestamp} + key={news.identifier + "-" + news.timestamp + "-" + news.content} className="bg-gray-900 border border-gray-800 rounded-lg shadow-lg overflow-hidden" > {/* Header (Game Icon + Info) */} @@ -44,7 +45,7 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({ newsItems }) => { <div className="flex flex-col leading-tight"> <span className="text-sm font-semibold text-gray-200"> - {getGameName(news.identifier)} + {getGameTitle(news.identifier)} </span> <span className="text-xs text-gray-400"> {formattedDate} @@ -122,18 +123,3 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({ newsItems }) => { </div> ); }; -function getGameName(identifier: string): string | null { - if(identifier.startsWith("SOUND_VOLTEX")){ - return "SOUND VOLTEX"; - } - else if(identifier.startsWith("IIDX")){ - return "beatmania IIDX"; - } - else if(identifier.startsWith("CHUNITHM_JP")){ - return "CHUNITHM (JAPAN)"; - } - else if(identifier.startsWith("MAIMAIDX_JP")){ - return "maimai DX (JAPAN)" - } - return null; -} |
