mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 10:15:26 +00:00
colour problem
This commit is contained in:
@@ -50,6 +50,7 @@ interface Server {
|
||||
disabled: boolean;
|
||||
new: boolean;
|
||||
sortorder: number;
|
||||
showcolor: string;
|
||||
}
|
||||
|
||||
interface CachedData {
|
||||
@@ -67,6 +68,15 @@ const NewServerWrapper = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
// Add a styled component for servers with custom colors
|
||||
const ColoredServerWrapper = styled.div<{ customColor: string }>`
|
||||
display: contents;
|
||||
|
||||
a {
|
||||
color: ${props => props.customColor};
|
||||
}
|
||||
`;
|
||||
|
||||
const CACHE_KEY = "server_list_cache";
|
||||
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
|
||||
|
||||
@@ -200,6 +210,15 @@ const Home: React.FC = () => {
|
||||
<Link to={linkTo}>{buttonContent}</Link>
|
||||
);
|
||||
|
||||
// Apply custom color if showcolor is specified
|
||||
if (server.showcolor && server.showcolor.trim() !== '') {
|
||||
content = (
|
||||
<ColoredServerWrapper customColor={server.showcolor}>
|
||||
{content}
|
||||
</ColoredServerWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
return server.new ? (
|
||||
<NewServerWrapper>{content}</NewServerWrapper>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user