HackBrexit / MinistersUnderTheInfluence

MIT License
6 stars 10 forks source link

ui: convert to React named routes #163

Open aspiers opened 7 years ago

aspiers commented 7 years ago

Description

We don't want to have to manually construct URL paths every time we write a <Link>. In the old days, React supported named routes natively, but they ditched that for dubious reasons. Fortunately however there are third party replacements, e.g. https://github.com/adamziel/react-router-named-routes, which should let us write stuff like:

<Link to="organisation.show" params={{id: organisation_id}}>{organisation_name}</Link>

Acceptance Criteria

This story can be considered done when the following acceptance tests are satisfied:

Given all the <Link> elements in the UI

When they need to link to some route within the app (i.e. not external links)

Then the link path should be generated dynamically rather than hardcoding assumptions about the structure of the URL path.