Files
co-lite/solvway-customer-portal/app/components/ProfileReminderModal.tsx
T
ngqileandClaude Opus 5.5 5ee51d1913 chore: copy kept Tastefully modules and portals into Co-Lite
Backend modules from tastefully 8bd93d15: core-libs, core-session,
api-gateway, mobile-api, services-auth, services-system,
services-counter, services-member, services-log, services-email.
solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal
from tastefully 8bd93d15. Copied as tracked files only.

Literal secrets replaced with environment placeholders:
- services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY,
  MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default)
- services-system: JUMIO_TOKEN, JUMIO_SECRET (optional)
- services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed
- core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default
  removed, ipgeolocation key read from IPGEOLOCATION_API_KEY
- services-system EkycAppConfig: commented Jumio credentials removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 15:55:45 +08:00

82 lines
3.1 KiB
TypeScript

"use client";
import { motion, AnimatePresence } from "framer-motion";
import Link from "next/link";
import { X } from "lucide-react";
import { useT } from "@/app/lib/i18n/MessagesProvider";
interface ProfileReminderModalProps {
open: boolean;
onClose: () => void;
}
/**
* Presentation only — it does not decide when to appear. Callers own that, so the same
* dialog serves both the automatic home-page reminder (HomeProfileReminder) and a
* deliberate tap on a voucher's Redeem button (app/store). Any session-level dismissal
* belongs to the caller: dismissing the automatic reminder must not suppress a modal
* the member opened on purpose.
*/
export default function ProfileReminderModal({ open, onClose }: ProfileReminderModalProps) {
const t = useT();
return (
<AnimatePresence>
{open && (
<>
<motion.div
key="backdrop"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.2 }}
onClick={onClose}
className="fixed inset-0 z-[100]"
style={{ background: "rgba(0,0,0,0.6)", backdropFilter: "blur(6px)" }}
/>
<div className="fixed inset-0 z-[101] flex items-center justify-center px-6 pointer-events-none">
<motion.div
key="modal"
initial={{ opacity: 0, scale: 0.88, y: 24 }}
animate={{ opacity: 1, scale: 1, y: 0 }}
exit={{ opacity: 0, scale: 0.92, y: 16 }}
transition={{ type: "spring", stiffness: 380, damping: 28 }}
className="rounded-3xl overflow-hidden w-full max-w-sm pointer-events-auto"
style={{
background: "var(--bg-card)",
border: "1px solid var(--border-color)",
boxShadow: "var(--shadow-card)",
}}
>
<div className="flex justify-end px-4 pt-4">
<button
type="button"
aria-label="Close"
onClick={onClose}
className="w-8 h-8 rounded-xl flex items-center justify-center"
style={{ background: "var(--bg-card-alt)" }}
>
<X strokeWidth={2} className="w-4 h-4" style={{ stroke: "var(--text-secondary)" }} />
</button>
</div>
<div className="px-6 pb-6 pt-1 text-center">
<p className="text-sm mb-5 leading-relaxed" style={{ color: "var(--text-primary)" }}>
{t("UpdateProfileGetRewardsMessage")}
</p>
<Link
href="/settings/profile"
onClick={onClose}
className="inline-block w-full py-3 rounded-xl font-bold text-sm text-white"
style={{ background: "linear-gradient(135deg,#C94D00,#A83F00)" }}
>
{t("CompleteProfile")}
</Link>
</div>
</motion.div>
</div>
</>
)}
</AnimatePresence>
);
}