colour problem
parent
573f158f26
commit
587ecddb13
|
|
@ -50,6 +50,7 @@ interface Server {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
new: boolean;
|
new: boolean;
|
||||||
sortorder: number;
|
sortorder: number;
|
||||||
|
showcolor: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CachedData {
|
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_KEY = "server_list_cache";
|
||||||
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
|
const CACHE_DURATION = 1 * 60 * 1000; // 1 minutes in milliseconds
|
||||||
|
|
||||||
|
|
@ -200,6 +210,15 @@ const Home: React.FC = () => {
|
||||||
<Link to={linkTo}>{buttonContent}</Link>
|
<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 ? (
|
return server.new ? (
|
||||||
<NewServerWrapper>{content}</NewServerWrapper>
|
<NewServerWrapper>{content}</NewServerWrapper>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue