Create custom button for Telemtry
This commit is contained in:
parent
2f56f1f653
commit
27540e4ae5
1 changed files with 17 additions and 0 deletions
17
src/components/buttons/Telemtry.astro
Normal file
17
src/components/buttons/Telemtry.astro
Normal file
|
@ -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 ?
|
||||
<a style="color: white;text-decoration: none;margin-bottom: 6px;border-radius: 6px;padding: 8px 24px;background: #1a1a1a;font-size: 14px;border: 2px rgba(255, 255, 255, 0.25) solid;" href="/api/telemtry/disable">{t("TELEMTRY.OPTOUT")}</a>
|
||||
:
|
||||
<a style="color: white;text-decoration: none;margin-bottom: 6px;border-radius: 6px;padding: 8px 24px;background: #1a1a1a;font-size: 14px;border: 2px rgba(255, 255, 255, 0.25) solid;" href="/api/telemtry/enable">{t("TELEMTRY.OPTIN")}</a>
|
||||
}
|
Reference in a new issue