Highlight the new server with yellor color

pull/1049/head
Harish Vishwakarma 2024-10-27 23:17:09 +05:30
parent 34601c479e
commit 74e7fd2af2
1 changed files with 35 additions and 17 deletions

View File

@ -47,13 +47,28 @@ 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 = () => {
</CategoryButton>
);
if (server.disabled) {
return (
const content = server.disabled ? (
<DisabledButtonWrapper key={server.id}>
{buttonContent}
</DisabledButtonWrapper>
);
} else {
return (
) : (
<Link to={linkTo} key={server.id}>
{buttonContent}
</Link>
);
}
// Wrap with NewServerWrapper if server is new
return server.new ? (
<NewServerWrapper key={server.id}>{content}</NewServerWrapper>
) : (
content
);
};
if (loading) {