💄 Stylize detected timezone (#1311)

This commit is contained in:
Luke Vella 2024-09-05 22:11:59 +01:00 committed by GitHub
parent 6ed89c897b
commit c093066f9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -270,7 +270,7 @@
"downloadICSFile": "Download ICS File",
"schedulateDate": "Scheduled Date",
"timeZoneChangeDetectorTitle": "Timezone Change Detected",
"timeZoneChangeDetectorMessage": "Your timezone has changed to {currentTimeZone}. Do you want to update your preferences?",
"timeZoneChangeDetectorMessage": "Your timezone has changed to <b>{currentTimeZone}</b>. Do you want to update your preferences?",
"yesUpdateTimezone": "Yes, update my timezone",
"noKeepCurrentTimezone": "No, keep the current timezone",
"annualBenefit": "{count} months free"

View file

@ -8,6 +8,7 @@ import {
DialogHeader,
DialogTitle,
} from "@rallly/ui/dialog";
import * as Sentry from "@sentry/nextjs";
import { usePostHog } from "posthog-js/react";
import React, { useState } from "react";
@ -25,7 +26,7 @@ export function TimeZoneChangeDetector() {
return cachedPreviousTimeZone;
}
} catch (e) {
console.error(e);
Sentry.captureException(e);
}
const timeZone = preferences.timeZone ?? getBrowserTimeZone();
@ -33,7 +34,7 @@ export function TimeZoneChangeDetector() {
try {
localStorage.setItem("previousTimeZone", timeZone);
} catch (e) {
console.error(e);
Sentry.captureException(e);
}
return timeZone;
@ -61,10 +62,11 @@ export function TimeZoneChangeDetector() {
/>
</DialogTitle>
</DialogHeader>
<p className="text-muted-foreground text-sm">
<p className="text-muted-foreground text-sm leading-relaxed">
<Trans
i18nKey="timeZoneChangeDetectorMessage"
defaults="Your timezone has changed to {currentTimeZone}. Do you want to update your preferences?"
defaults="Your timezone has changed to <b>{currentTimeZone}</b>. Do you want to update your preferences?"
components={{ b: <b className="text-foreground font-medium" /> }}
values={{ currentTimeZone }}
/>
</p>