From 5f0505d7d00810338f11ddaa9c2cd8cf4887fb45 Mon Sep 17 00:00:00 2001
From: Abron Studio <110968521+AbronStudio@users.noreply.github.com>
Date: Wed, 3 Sep 2025 09:39:55 +0330
Subject: [PATCH] Update Home.tsx
---
src/pages/home/Home.tsx | 33 +++++++++++----------------------
1 file changed, 11 insertions(+), 22 deletions(-)
diff --git a/src/pages/home/Home.tsx b/src/pages/home/Home.tsx
index 57660200..439259d6 100644
--- a/src/pages/home/Home.tsx
+++ b/src/pages/home/Home.tsx
@@ -49,13 +49,8 @@ interface Server {
inviteCode: string;
disabled: boolean;
new: boolean;
- sortorder: number;
showcolor: string;
-}
-
-interface CachedData {
- timestamp: number;
- data: Server[];
+ sortorder: number;
}
// Add a styled component for the new text color
@@ -68,12 +63,13 @@ const NewServerWrapper = styled.div`
}
`;
-// Add a styled component for servers with custom colors
-const ColoredServerWrapper = styled.div<{ customColor: string }>`
+// Dynamic color wrapper component
+const ColorWrapper = styled.div<{ color: string }>`
+ color: ${props => props.color};
display: contents;
a {
- color: ${props => props.customColor};
+ color: ${props => props.color};
}
`;
@@ -108,7 +104,7 @@ 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";
// Add cache-busting parameter to prevent browser caching
const urlWithCacheBust = `${csvUrl}&_cb=${Date.now()}`;
@@ -210,20 +206,13 @@ const Home: React.FC = () => {
{buttonContent}
);
- // Apply custom color if showcolor is specified
- if (server.showcolor && server.showcolor.trim() !== '') {
- content = (
-
- {content}
-
- );
+ if (server.showcolor && server.showcolor.trim()) {
+ content = {content};
+ } else if (server.new) {
+ content = {content};
}
- return server.new ? (
- {content}
- ) : (
- content
- );
+ return content;
};
if (loading) {