From 27540e4ae5413d5d6b937cc75a07b65c5e79b1af Mon Sep 17 00:00:00 2001 From: Korbs Date: Thu, 11 Jul 2024 18:05:12 -0400 Subject: [PATCH] Create custom button for Telemtry --- src/components/buttons/Telemtry.astro | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/components/buttons/Telemtry.astro diff --git a/src/components/buttons/Telemtry.astro b/src/components/buttons/Telemtry.astro new file mode 100644 index 0000000..609beab --- /dev/null +++ b/src/components/buttons/Telemtry.astro @@ -0,0 +1,17 @@ +--- +import i18next,{ t, changeLanguage } from "i18next"; +import Base from "@layouts/Default.astro"; + +if (Astro.cookies.get("Telemtry").value === "Enabled") { + var UserIsOptedIn = true +} +else if (Astro.cookies.get("Telemtry").value === "Disabled") { + var UserIsOptedIn = false +} +--- + +{UserIsOptedIn ? + {t("TELEMTRY.OPTOUT")} + : + {t("TELEMTRY.OPTIN")} +} \ No newline at end of file