wevisdemo / parliament-watch

Citizens are watching 👀
https://parliamentwatch.wevis.info
Other
61 stars 33 forks source link

fix navbar on mobile does not close when changing to new page #153

Closed SupeemAFK closed 1 week ago

SupeemAFK commented 1 week ago

Related GitHub issues

Close #151

What have been done

Screenshot (if any)

Before

379742950-83318469-9c03-4d83-a857-6f5886b2278a.webm

After

https://github.com/user-attachments/assets/7f0d4b8f-9b79-4dfa-b226-a571bb5c596e

Help needed (if any)

SupeemAFK commented 1 week ago

Fix it @Th1nkK1D . I remove button and pass down close sidebar function from NavigationBar component to SideMenuLink component using context to avoid props drilling so that a inside SideMenuLink component can call close sidebar function when a on:click via context.

SupeemAFK commented 1 week ago

Fix @Th1nkK1D. I change to on:click={closeSideNav} and move const closeSideNav: () => void = getContext('closeSideNav'); below props.