Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix password reset alert

Luke Vella245e01e57928
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/password-setup-alert.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/password-setup-alert.tsx
index 2ba685188..7f2c3ac82 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/password-setup-alert.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/password-setup-alert.tsx
@@ -1,5 +1,6 @@
"use client";
import { usePostHog } from "@rallly/posthog/client";
+import { Alert, AlertDescription, AlertTitle } from "@rallly/ui/alert";
import { Button } from "@rallly/ui/button";
import { KeyRoundIcon } from "lucide-react";
import Link from "next/link";
@@ -15,46 +16,44 @@ export function PasswordSetupAlert() {
}
return (
- <div className="flex flex-col items-start gap-4 rounded-xl border border-gray-200 bg-gray-50 p-4 text-sm sm:flex-row">
- <div className="hidden sm:block">
- <KeyRoundIcon className="size-4 text-indigo-600" />
- </div>
- <div className="flex-1">
- <h2 className="font-semibold leading-none">
- <Trans
- i18nKey="setupPasswordAlertTitle"
- defaults="Login quicker with a password"
- />
- </h2>
- <p className="mt-1.5 opacity-75">
+ <Alert>
+ <KeyRoundIcon />
+ <AlertTitle>
+ <Trans
+ i18nKey="setupPasswordAlertTitle"
+ defaults="Login quicker with a password"
+ />
+ </AlertTitle>
+ <AlertDescription>
+ <p>
<Trans
i18nKey="setupPasswordAlertDesc"
defaults="Set up a password to make logging in faster and more convenient."
/>
</p>
- </div>
- <div className="flex flex-row-reverse items-center gap-2 sm:flex-row">
- <Button
- variant="ghost"
- onClick={() => {
- setValue("1");
- posthog.capture("space_dashboard:password_setup_dismissed");
- }}
- >
- <Trans i18nKey="dismissPasswordSetup" defaults="Don't show again" />
- </Button>
- <Button
- variant="primary"
- onClick={() => {
- posthog.capture("space_dashboard:password_setup_button_click");
- }}
- asChild
- >
- <Link href="/settings/security">
- <Trans i18nKey="setupPasswordButton" defaults="Set up password" />
- </Link>
- </Button>
- </div>
- </div>
+ <div className="mt-4 flex items-center gap-2">
+ <Button
+ variant="primary"
+ onClick={() => {
+ posthog.capture("space_dashboard:password_setup_button_click");
+ }}
+ asChild
+ >
+ <Link href="/settings/security">
+ <Trans i18nKey="setupPasswordButton" defaults="Set up password" />
+ </Link>
+ </Button>
+ <Button
+ variant="ghost"
+ onClick={() => {
+ setValue("1");
+ posthog.capture("space_dashboard:password_setup_dismissed");
+ }}
+ >
+ <Trans i18nKey="dismissPasswordSetup" defaults="Don't show again" />
+ </Button>
+ </div>
+ </AlertDescription>
+ </Alert>
);
}
diff --git a/packages/ui/src/alert.tsx b/packages/ui/src/alert.tsx
index 429d5d971..14d6ea443 100644
--- a/packages/ui/src/alert.tsx
+++ b/packages/ui/src/alert.tsx
@@ -5,7 +5,7 @@ import type * as React from "react";
import { cn } from "./lib/utils";
const alertVariants = cva(
- "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-xl px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
{
variants: {
variant: {