mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 15:23:58 +00:00
feat: add loading state and full-page loader component; update payment page and application layout to improve user experience
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m23s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m23s
This commit is contained in:
33
components/welcome-banner.tsx
Normal file
33
components/welcome-banner.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
interface WelcomeBannerProps {
|
||||
firstName?: string | null;
|
||||
lastName?: string | null;
|
||||
}
|
||||
|
||||
export function WelcomeBanner({ firstName, lastName }: WelcomeBannerProps) {
|
||||
const [isVisible, setIsVisible] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
setIsVisible(false);
|
||||
}, 3000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
if (!isVisible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="text-sm font-mono px-2 p-1 fade-out-10 bg-green-500/10 text-green-900 dark:text-green-400">
|
||||
Welcome,{" "}
|
||||
<span className="font-semibold">
|
||||
{firstName} {lastName}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user