From 74e7fd2af20d8470ccabd21ca77fa6a305d1132a Mon Sep 17 00:00:00 2001 From: Harish Vishwakarma Date: Sun, 27 Oct 2024 23:17:09 +0530 Subject: [PATCH] Highlight the new server with yellor color --- src/pages/home/Home.tsx | 52 +++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/src/pages/home/Home.tsx b/src/pages/home/Home.tsx index 189a6d30..704bb171 100644 --- a/src/pages/home/Home.tsx +++ b/src/pages/home/Home.tsx @@ -47,12 +47,27 @@ interface Server { description: string; inviteCode: string; disabled: boolean; + new: boolean; // Add the new field } -interface CachedData { - timestamp: number; - data: Server[]; -} +// Add a styled component for the new text color +const NewServerWrapper = styled.div` + color: yellow; + + // Make all text yellow, including description + * { + color: yellow !important; + } + + a { + color: yellow; + } + + // Target the description specifically if needed + [class*="description"] { + color: yellow !important; + } +`; const CACHE_KEY = "server_list_cache"; const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds @@ -177,19 +192,22 @@ const Home: React.FC = () => { ); - if (server.disabled) { - return ( - - {buttonContent} - - ); - } else { - return ( - - {buttonContent} - - ); - } + const content = server.disabled ? ( + + {buttonContent} + + ) : ( + + {buttonContent} + + ); + + // Wrap with NewServerWrapper if server is new + return server.new ? ( + {content} + ) : ( + content + ); }; if (loading) {