From 1fe945a0059235668e0e866710326af17bf4a10f Mon Sep 17 00:00:00 2001 From: Ludovic Morin Date: Sat, 11 Jan 2025 16:04:39 -0500 Subject: [PATCH 1/9] refactor: simplify UI components and improve language/theme switchers --- .../src/components/CouponsPage.tsx | 44 ++++--------------- .../src/components/LanguageSwitcher.tsx | 38 +++------------- Extension-React/src/components/Settings.tsx | 14 +++--- .../src/components/ThemeProvider.tsx | 4 +- .../src/components/ThemeSwitcher.tsx | 42 +++--------------- 5 files changed, 31 insertions(+), 111 deletions(-) diff --git a/Extension-React/src/components/CouponsPage.tsx b/Extension-React/src/components/CouponsPage.tsx index 570f3f13..555aba45 100644 --- a/Extension-React/src/components/CouponsPage.tsx +++ b/Extension-React/src/components/CouponsPage.tsx @@ -49,9 +49,8 @@ const CouponsPage: React.FC = ({ const subDomainName: string = getSubDomainName(parsedSubDomain); const handleDomain = () => { - const domain = document.querySelector( - 'input[name="couponType"]:checked' - )?.id; + + const domain = document.querySelector('input[name="couponType"]:checked')?.id; if (domain === "domain") { document.querySelector(".Domain")?.classList.remove("hidden"); document.querySelector(".SubDomain")?.classList.add("hidden"); @@ -80,46 +79,19 @@ const CouponsPage: React.FC = ({ <> {isSubDomain ? ( <> -