feat: add ssajan in lots of flows

This commit is contained in:
ramvignesh-b
2026-04-28 03:12:25 +05:30
parent 935a43c311
commit ac2c7b0eac
5 changed files with 67 additions and 44 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ export function useLetters() {
return {
drafts: letters.filter((l) => l.status === "DRAFT"),
kept: letters.filter((l) => l.type === "KEPT" && l.status === "SEALED"),
vault: letters.filter((l) => l.type === "VAULT"),
vault: letters.filter((l) => l.type === "VAULT" && l.status === "SEALED"),
sent: letters.filter((l) => l.type === "SENT" && l.status === "SEALED"),
};
}, [letters]);
+7 -9
View File
@@ -16,8 +16,6 @@ export default function Activate() {
useEffect(() => {
if (!(uidb64 && token) || hasCalled.current) return;
// prevent double api calls
hasCalled.current = true;
const activateAccount = async () => {
@@ -46,7 +44,7 @@ export default function Activate() {
)}
{status === "success" && (
<div className="flex flex-col items-center gap-6 animate-in fade-in zoom-in duration-500">
<div className="flex flex-col items-center gap-6 duration-500">
<div className="bg-success/10 p-4 rounded-full">
<CheckCircleIcon
size={64}
@@ -57,13 +55,12 @@ export default function Activate() {
<h2 className="font-display text-xl text-success">
Account Activated!
</h2>
<p className="opacity-70 mb-8 leading-relaxed">
Welcome to <Logo />
<p className="opacity-70 leading-relaxed">
Welcome to <Logo scale={1} />
<br />
Your identity is now verified and ready for timeless letters.
</p>
<div className="divider opacity-10"></div>
<div className="divider opacity-10 my-0"></div>
<button
type="button"
className="btn btn-primary w-full shadow-lg"
@@ -85,16 +82,17 @@ export default function Activate() {
<XCircleIcon size={64} weight="duotone" className="text-error" />
</div>
<h2 className="font-display text-xl text-error">Activation Failed</h2>
<p className="opacity-70 mb-8 leading-relaxed">
<p className="opacity-70 leading-relaxed">
The link might be expired or already used. Please try registering
again.
</p>
<div className="divider opacity-10 my-0"></div>
<button
type="button"
className="btn btn-ghost w-full"
onClick={() => navigate(ROUTES.ONBOARD)}
>
Back to Registration
Register Again
</button>
</div>
)}
+7
View File
@@ -5,6 +5,7 @@ import { DrawerSection } from "../components/drawer/DrawerSection.tsx";
import { LetterItem } from "../components/drawer/LetterItem.tsx";
import { PasskeyModal } from "../components/drawer/PasskeyModal.tsx";
import Logo from "../components/Logo";
import Saajan from "../components/ui/Saajan.tsx";
import { PATHS } from "../config/routes";
import { useAuth } from "../hooks/useAuth";
import { useLetters } from "../hooks/useLetters";
@@ -165,6 +166,12 @@ export default function Drawer() {
<footer className="mt-25 font-sans text-[0.6rem] tracking-[0.2em] uppercase text-base-content/10 z-10">
For your unsaid.
</footer>
<div className="absolute bottom-0 z-50 font-sans">
<Saajan
message={`Good to see you again, ${user.full_name}.\nWhat's on your mind today?`}
position="top"
/>
</div>
</div>
);
}
+6 -2
View File
@@ -293,7 +293,7 @@ export default function Editor() {
setLetterStatus(status);
setLastSavedPulseTick((prev) => prev + 1);
if (status === "SEALED") {
if (status === "SEALED" || status === "VAULT") {
setSealedTargetId(targetId);
}
setSaveOverlay("saved");
@@ -419,7 +419,11 @@ export default function Editor() {
/>
)}
{sealedTargetId && (
<PostSealModal sealedTargetId={sealedTargetId} navigate={navigate} />
<PostSealModal
sealedTargetId={sealedTargetId}
navigate={navigate}
type={status === "VAULT" ? "VAULT" : "KEPT"}
/>
)}
<div className="max-w-180 mx-auto px-1 md:px-0">
+22 -8
View File
@@ -1,8 +1,14 @@
import { EnvelopeSimpleOpenIcon } from "@phosphor-icons/react";
import Logo from "../components/Logo";
import Saajan from "../components/ui/Saajan";
export default function VerifyEmail() {
return (
<div className="relative">
<Saajan
message={"I sent something to your inbox.\nOpen it, and we can begin."}
/>
<div className="glass-card w-full max-w-sm p-8 text-center flex flex-col items-center gap-6 fade-zoom">
<div className="auth-icon-container">
<EnvelopeSimpleOpenIcon
@@ -13,19 +19,26 @@ export default function VerifyEmail() {
</div>
<div className="space-y-2">
<h2 className="font-display text-xl text-primary">Check Your Email</h2>
<p className="text-sm opacity-80 leading-relaxed font-sans">
We've sent an activation link to your inbox. <br />
Please click it to verify your <Logo /> account.
<h2 className="font-display text-xl text-primary">
Check Your Mailbox
</h2>
<p className="text-sm opacity-80 leading-relaxed font-sans mt-6">
You're one train away from starting your <Logo scale={0.8} />{" "}
journey.
</p>
</div>
<div className="divider opacity-10"></div>
<div className="divider opacity-10 my-0"></div>
<div className="alert bg-base-200/50 p-4 rounded-lg text-xs leading-relaxed text-left opacity-70">
<div className="alert bg-base-200/50 p-4 rounded-lg text-xs leading-relaxed opacity-70 text-center">
<p>
Didn't receive it? Check your spam folder or wait for a few minutes.
The link will expire in 24 hours.
Nothing yet? Sometimes letters take the wrong train. Check your spam
folder.
<br />
<span className="underline font-bold">
The link expires in 24 hours.
</span>
<br /> I'm patient... but not endlessly so
</p>
</div>
@@ -37,5 +50,6 @@ export default function VerifyEmail() {
You can close this window now.
</button>
</div>
</div>
);
}