Task 4: Add PatientBanner component with full/condensed modes

- Create useScrollCondensation hook with IntersectionObserver
- PatientBanner with 80px full mode and 48px condensed mode
- Smooth height transition (200ms) on scroll past 100px
- Status dot (green) and badge for 'Open to opportunities'
- Action buttons: Download CV, Email, LinkedIn
- NHS blue outlined buttons with hover fill effect
- Proper GPhC number formatting with tooltip
- Sticky positioning for persistent visibility
This commit is contained in:
2026-02-11 01:04:51 +00:00
parent de34ec48cc
commit 8d26049b17
2 changed files with 224 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { useState, useEffect, useRef } from 'react'
interface UseScrollCondensationOptions {
threshold?: number
}
export function useScrollCondensation(options: UseScrollCondensationOptions = {}) {
const { threshold = 100 } = options
const [isCondensed, setIsCondensed] = useState(false)
const sentinelRef = useRef<HTMLDivElement>(null)
useEffect(() => {
const sentinel = sentinelRef.current
if (!sentinel) return
const observer = new IntersectionObserver(
(entries) => {
const [entry] = entries
setIsCondensed(!entry.isIntersecting)
},
{
rootMargin: `-${threshold}px 0px 0px 0px`,
threshold: 0,
}
)
observer.observe(sentinel)
return () => {
observer.disconnect()
}
}, [threshold])
return { isCondensed, sentinelRef }
}