WillTheVideoMan / willhall.uk

Personal website, blog and meme hub.
https://willhall.uk
0 stars 0 forks source link

Improve Header Navigation Highlighting #45

Open WillTheVideoMan opened 4 years ago

WillTheVideoMan commented 4 years ago

At the mo, the active link is determined by a route prop which is simply compared with the route of the link being rendered. If they match, then go bold.

However, in order to have absolutely anything possible in the navigation (tags, pages, posts) and have the highlighting work, a different approach must be taken.

The current route prop should be passed down. When rendering each link, all possible nav links should be considered. If there is a match, then highlight. No match, then the default home route "/" should be highlighted.