added a showcolor column for special servers

pull/1154/head
Harish Vishwakarma 2025-08-01 23:27:34 +05:30
parent 2475a36e50
commit cddfb44982
1 changed files with 18 additions and 5 deletions

View File

@ -49,6 +49,7 @@ interface Server {
inviteCode: string;
disabled: boolean;
new: boolean;
showcolor: string;
sortorder: number;
}
@ -62,6 +63,16 @@ const NewServerWrapper = styled.div`
}
`;
// Dynamic color wrapper component
const ColorWrapper = styled.div<{ color: string }>`
color: ${props => props.color};
display: contents;
a {
color: ${props => props.color};
}
`;
const CACHE_KEY = "server_list_cache";
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
@ -195,11 +206,13 @@ const Home: React.FC = () => {
<Link to={linkTo}>{buttonContent}</Link>
);
return server.new ? (
<NewServerWrapper>{content}</NewServerWrapper>
) : (
content
);
if (server.showcolor && server.showcolor.trim()) {
content = <ColorWrapper color={server.showcolor}>{content}</ColorWrapper>;
} else if (server.new) {
content = <NewServerWrapper>{content}</NewServerWrapper>;
}
return content;
};
if (loading) {