From 7b3db4f2517cfa91813f99029ade12bd4b33d0c9 Mon Sep 17 00:00:00 2001 From: Harish Vishwakarma Date: Mon, 28 Oct 2024 00:55:02 +0530 Subject: [PATCH] Highlight the new server with yellow color (#3) * Highlight the new server with yellor color * Decrease extent of yellow --- src/pages/home/Home.tsx | 43 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/pages/home/Home.tsx b/src/pages/home/Home.tsx index 189a6d30..187fe90e 100644 --- a/src/pages/home/Home.tsx +++ b/src/pages/home/Home.tsx @@ -47,12 +47,18 @@ 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: #fadf4f; + + // Preserve all other styles + a { + color: #fadf4f; + } +`; const CACHE_KEY = "server_list_cache"; const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds @@ -177,19 +183,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) {