fix(web): onboarding — locale-aware end date, dynamic plan, completion event

- End date no longer hard-codes tr-TR; follows the active locale.
- The plan badge reads from subscription.plan.key (falls back to "full"),
  so a future change to what the trial provisions doesn't make the UI lie.
- The "Şase Aramaya Başla" CTA captures onboarding_completed, so the
  funnel can distinguish a user who actually clicked through vs one who
  dismissed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:25:10 +03:00
parent eb7b75fbe8
commit 469a7af67e

View File

@@ -57,7 +57,7 @@ export function WelcomeOnboardingModal({
refCode: string | null;
onFinished: () => void;
}) {
const { t } = useTranslation();
const { t, locale } = useTranslation();
const queryClient = useQueryClient();
const [phase, setPhase] = useState<"provisioning" | "completed">("provisioning");
const [animationEnded, setAnimationEnded] = useState(false);
@@ -269,7 +269,7 @@ export function WelcomeOnboardingModal({
{t("subscription.currentPlan")}
</span>
<Badge className="bg-brand text-brand-foreground">
{t("subscription.plans.full.name")}
{t(`subscription.plans.${subscription?.plan?.key ?? "full"}.name`)}
</Badge>
</div>
<div className="flex items-center justify-between">
@@ -286,7 +286,9 @@ export function WelcomeOnboardingModal({
{t("subscription.endDate")}
</span>
<span className="text-sm font-medium leading-5">
{new Date(subscription.endDate).toLocaleDateString("tr-TR")}
{new Date(subscription.endDate).toLocaleDateString(
locale === "tr" ? "tr-TR" : "en-US",
)}
</span>
</div>
)}
@@ -303,7 +305,10 @@ export function WelcomeOnboardingModal({
<Button
size="lg"
className="bg-brand text-brand-foreground hover:bg-brand/90"
onClick={onFinished}
onClick={() => {
capture("onboarding_completed", { source: "welcome_onboarding" });
onFinished();
}}
>
{t("subscription.onboarding.startSearching")}
<ArrowRight className="ml-2 h-4 w-4" />