feat: UI improvements — scrollbar, multi-filters, pricing fix, routing, modals

- Global page scrollbar styled with gold theme
- Schedule: multi-select for class types and status tags
- Pricing: fix tab switch blink (display toggle vs conditional render)
- OpenDay: trainer name more prominent, section divider added
- Team: browser back button closes trainer bio (history API)
- Modals: block scroll + compensate scrollbar width to prevent layout shift
- Header: remove booking button from desktop nav
This commit is contained in:
2026-03-26 13:23:03 +03:00
parent 228e547e10
commit 8088b99a43
17 changed files with 275 additions and 229 deletions

View File

@@ -17,17 +17,38 @@ export function Team({ data: team, schedule }: TeamProps) {
const [activeIndex, setActiveIndex] = useState(0);
const [showProfile, setShowProfile] = useState(false);
const openProfile = useCallback((index: number) => {
setActiveIndex(index);
setShowProfile(true);
history.pushState({ trainerProfile: true }, "");
}, []);
const closeProfile = useCallback(() => {
setShowProfile(false);
}, []);
const openTrainerByName = useCallback((name: string) => {
const idx = team.members.findIndex((m) => m.name === name);
if (idx >= 0) {
setActiveIndex(idx);
setShowProfile(true);
openProfile(idx);
setTimeout(() => {
const el = document.getElementById("team");
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
}, 50);
}
}, [team.members]);
}, [team.members, openProfile]);
// Handle browser back button
useEffect(() => {
function onPopState(e: PopStateEvent) {
if (showProfile) {
e.preventDefault();
setShowProfile(false);
}
}
window.addEventListener("popstate", onPopState);
return () => window.removeEventListener("popstate", onPopState);
}, [showProfile]);
useEffect(() => {
function handler(e: Event) {
@@ -75,14 +96,14 @@ export function Team({ data: team, schedule }: TeamProps) {
members={team.members}
activeIndex={activeIndex}
onSelect={setActiveIndex}
onOpenBio={() => setShowProfile(true)}
onOpenBio={() => openProfile(activeIndex)}
/>
</div>
</>
) : (
<TeamProfile
member={team.members[activeIndex]}
onBack={() => setShowProfile(false)}
onBack={() => { history.back(); }}
schedule={schedule}
/>
)}