From 3d66582a3a2ea3b540033769fd2078b4111329ea Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Thu, 19 Dec 2024 10:40:11 +0800 Subject: [PATCH] feat: components with custom background use transparent background --- src/components/CycleTransferStatsClient.tsx | 8 +++++++- src/components/GroupSwitch.tsx | 12 +++++++++++- src/components/LanguageSwitcher.tsx | 9 ++++++++- src/components/ServerCard.tsx | 11 +++++++++++ src/components/ServerCardInline.tsx | 10 ++++++++++ src/components/ServerOverview.tsx | 20 ++++++++++++++++++-- src/components/ServiceTrackerClient.tsx | 8 +++++++- src/components/TabSwitch.tsx | 12 +++++++++++- src/components/ThemeSwitcher.tsx | 8 +++++++- src/pages/Server.tsx | 16 ++++++++++++++++ 10 files changed, 106 insertions(+), 8 deletions(-) diff --git a/src/components/CycleTransferStatsClient.tsx b/src/components/CycleTransferStatsClient.tsx index 93ab996..aa4f66a 100644 --- a/src/components/CycleTransferStatsClient.tsx +++ b/src/components/CycleTransferStatsClient.tsx @@ -29,11 +29,17 @@ export const CycleTransferStatsClient: React.FC = className, }) => { const { t } = useTranslation() + const customBackgroundImage = + // @ts-expect-error ShowNetTransfer is a global variable + (window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined return (
{serverStats.map(({ serverId, serverName, transfer, nextUpdate }) => { diff --git a/src/components/GroupSwitch.tsx b/src/components/GroupSwitch.tsx index 2dd8e3a..1a10c40 100644 --- a/src/components/GroupSwitch.tsx +++ b/src/components/GroupSwitch.tsx @@ -10,9 +10,19 @@ export default function GroupSwitch({ currentTab: string setCurrentTab: (tab: string) => void }) { + const customBackgroundImage = + // @ts-expect-error ShowNetTransfer is a global variable + (window.CustomBackgroundImage as string) !== "" ? window.CustomBackgroundImage : undefined return (
-
+
{tabs.map((tab: string) => (
{ @@ -32,7 +37,9 @@ export function LanguageSwitcher() {