From 073fc8fe92e60fd4662580e8216600379a0edfae Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 14 Apr 2025 03:13:02 -0700 Subject: chore: refactor id to game title conversion to shared module --- site/src/components/NewsFeed.tsx | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'site/src/components') 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 = ({ newsItems }) => { return (
{/* Header (Game Icon + Info) */} @@ -44,7 +45,7 @@ export const NewsFeed: React.FC = ({ newsItems }) => {
- {getGameName(news.identifier)} + {getGameTitle(news.identifier)} {formattedDate} @@ -122,18 +123,3 @@ export const NewsFeed: React.FC = ({ newsItems }) => {
); }; -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; -} -- cgit v1.2.3