mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-10 02:25:27 +00:00
added a showcolor column for special servers
This commit is contained in:
@@ -49,6 +49,7 @@ interface Server {
|
|||||||
inviteCode: string;
|
inviteCode: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
new: boolean;
|
new: boolean;
|
||||||
|
showcolor: string;
|
||||||
sortorder: number;
|
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_KEY = "server_list_cache";
|
||||||
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
|
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
|
||||||
|
|
||||||
@@ -195,11 +206,13 @@ const Home: React.FC = () => {
|
|||||||
<Link to={linkTo}>{buttonContent}</Link>
|
<Link to={linkTo}>{buttonContent}</Link>
|
||||||
);
|
);
|
||||||
|
|
||||||
return server.new ? (
|
if (server.showcolor && server.showcolor.trim()) {
|
||||||
<NewServerWrapper>{content}</NewServerWrapper>
|
content = <ColorWrapper color={server.showcolor}>{content}</ColorWrapper>;
|
||||||
) : (
|
} else if (server.new) {
|
||||||
content
|
content = <NewServerWrapper>{content}</NewServerWrapper>;
|
||||||
);
|
}
|
||||||
|
|
||||||
|
return content;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|||||||
Reference in New Issue
Block a user