From 06fbcb74401606e903fac5750f8ac7b2bac3e197 Mon Sep 17 00:00:00 2001 From: "Darrell K Malone Jr." Date: Sun, 19 Apr 2026 22:21:48 -0400 Subject: [PATCH 1/2] Let the user know that signing in is required. --- frontend/app/page.tsx | 2 +- frontend/app/search/page.tsx | 2 +- frontend/components/Nav/navIcons.module.css | 21 +++++ frontend/components/Nav/navIcons.tsx | 35 ++++++++ frontend/components/SearchBar/index.tsx | 91 ++++++++++++++------- 5 files changed, 120 insertions(+), 31 deletions(-) diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 2000f420c..7341dd436 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -7,7 +7,7 @@ export default function Home() {

How can we help you?

- +
) diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 7a131d5db..d836f06b1 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -27,7 +27,7 @@ const PageResults = () => {
- + {error && (
Error: {error}
)} diff --git a/frontend/components/Nav/navIcons.module.css b/frontend/components/Nav/navIcons.module.css index 0313d4402..8dc213d9f 100644 --- a/frontend/components/Nav/navIcons.module.css +++ b/frontend/components/Nav/navIcons.module.css @@ -12,6 +12,27 @@ color: #303463; } +.signInPulse { + animation: signInPulse 0.9s ease-out; +} + +@keyframes signInPulse { + 0% { + transform: scale(1); + box-shadow: 0 0 0 0 rgba(48, 52, 99, 0.4); + } + + 30% { + transform: scale(1.06); + box-shadow: 0 0 0 10px rgba(48, 52, 99, 0.18); + } + + 100% { + transform: scale(1); + box-shadow: 0 0 0 0 rgba(48, 52, 99, 0); + } +} + @media screen and (max-width: 700px) { .createIcon { display: none; diff --git a/frontend/components/Nav/navIcons.tsx b/frontend/components/Nav/navIcons.tsx index 5df31ac62..b65148981 100644 --- a/frontend/components/Nav/navIcons.tsx +++ b/frontend/components/Nav/navIcons.tsx @@ -16,6 +16,7 @@ export default function NavIcons() { const router = useRouter() const [open, setOpen] = React.useState(false) + const [pulseSignin, setPulseSignin] = React.useState(false) const anchorRef = React.useRef(null) const handleToggle = () => { @@ -59,6 +60,39 @@ export default function NavIcons() { prevOpen.current = open }, [open]) + React.useEffect(() => { + if (isLoggedIn) { + setPulseSignin(false) + return + } + + let timeoutId: number | undefined + + const handleLoginRequiredSearch = () => { + setPulseSignin(false) + window.requestAnimationFrame(() => { + setPulseSignin(true) + }) + + if (timeoutId) { + window.clearTimeout(timeoutId) + } + + timeoutId = window.setTimeout(() => { + setPulseSignin(false) + }, 900) + } + + window.addEventListener("npdc:login-required-search", handleLoginRequiredSearch) + + return () => { + window.removeEventListener("npdc:login-required-search", handleLoginRequiredSearch) + if (timeoutId) { + window.clearTimeout(timeoutId) + } + } + }, [isLoggedIn]) + return (
{!isLoggedIn && ( @@ -76,6 +110,7 @@ export default function NavIcons() {