mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 18:15:28 +00:00
a
This commit is contained in:
@@ -49,6 +49,7 @@ interface Server {
|
||||
inviteCode: string;
|
||||
disabled: boolean;
|
||||
new: boolean;
|
||||
showcolor: string;
|
||||
sortorder: number;
|
||||
}
|
||||
|
||||
@@ -67,6 +68,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
|
||||
|
||||
@@ -112,8 +123,8 @@ const Home: React.FC = () => {
|
||||
const fetchAndCacheData = async () => {
|
||||
try {
|
||||
const csvUrl =
|
||||
"https://docs.google.com/spreadsheets/d/1kNF50scEUJVJ9KD-0_ibX43vJiOzdHrmgauLoSoBy34/export?format=csv&gid=0";
|
||||
|
||||
//"https://docs.google.com/spreadsheets/d/e/2PACX-1vRY41D-NgTE6bC3kTN3dRpisI-DoeHG8Eg7n31xb1CdydWjOLaphqYckkTiaG9oIQSWP92h3NE-7cpF/pub?gid=0&single=true&output=csv";
|
||||
"https://docs.google.com/spreadsheets/d/1kNF50scEUJVJ9KD-0_ibX43vJiOzdHrmgauLoSoBy34/edit?single=true&output=csv&gid=0#gid=0";
|
||||
// Add cache-busting parameter to prevent browser caching
|
||||
const urlWithCacheBust = `${csvUrl}&_cb=${Date.now()}`;
|
||||
|
||||
@@ -225,11 +236,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) {
|
||||
|
||||
Reference in New Issue
Block a user