codeforbtv / baby-equipment-exchange

MIT License
0 stars 8 forks source link

ButtonContainer enhancement (#25) #26

Closed NathanWEdwards closed 1 year ago

NathanWEdwards commented 1 year ago

Additional changes in this request include changes due to formatting and linting.

Currently, when a ButtonContainer button is selected, React state is not preserved. There is no option to disable a ButtonContainer button.

The ButtonContainer uses an anchor element for navigation. The ButtonContainer should perform navigation with the Link component instead.

The React App Router code-splits bundles of JavaScript to be sent to the client by app route directory and performs caching and prefetching operations. When navigation occurs with Next's Link navigation, the browser doesn't reload the page, only the route segment is rendered; the React and browser state are preserved on navigation.

Not only is use of Link navigation more performant, when an anchor element is used for navigation, information such as context state is lost.

It is common to disable buttons when a circumstance does not meet the criteria for a button to be pressed. An option to disable a button should be added.

Acceptance criteria: