Closed mcoetzee closed 2 years ago
A new page to navigate to when the user clicks the New Claim button on the My Claims page. The page only lists the user's active policies.
I am 95% sure I left one more comment (but I don't see it here). I was thinking we should not have the policies components moved inside the components
folder but instead have it in pages
similarly to proposal-commons
. My intention was that components are to be the generic building blocks for the UI and all domain specific stuff should be in pages
(which is a bad name looking at it now).
I was thinking we should not have the policies components moved inside the
components
folder but instead have it inpages
similarly toproposal-commons
. My intention was that components are to be the generic building blocks for the UI and all domain specific stuff should be inpages
(which is a bad name looking at it now).
Yeah the lines are always a bit blurry when folder structure is the topic.
When I first started exploring the codebase, pages/proposal-commons
gave the impression that it was a page itself:
pages/
|- ...
|- proposal-commons/
|- proposals/
So tbh, I'm not too keen on a pages/policy-commons
, but I do get what you are saying about keeping src/components
more generic. Another option that I would be more keen on looks like this:
components/ (generic building blocks)
pages/
|- ...
|- components/ (domain specific building blocks)
|- policies/
|- proposal-details/
|- proposal-list/
|- ...
|- my-policies/
|- proposals/
|- ...
wdyt?
When I first started exploring the codebase, pages/proposal-commons gave the impression that it was a page itself:
Yep. It initially all started with all pages bing pages (and related components were in a page subfolder), but then we started to reuse proposal specific components in multiple pages so it was awkward to have them import from another page, so I moved the common stuff (proposal-commons) alongside.
Another option that I would be more keen on looks like this:
Yeah, that feels ideal to me.
Ok cool, reckon I will create a separate task for this (and keep this PR's folder structure as is so that the PR doesn't bloat)
Ok cool, reckon I will create a separate task for this (and keep this PR's folder structure as is so that the PR doesn't bloat)
Yeah, that seems better.
What does this change?
onClick={() => history.goBack()}
(i.e. it works like the browser's back button). Advantages include:query
,filter
, andpage
search params)How did you action this task?
Policy Select page I moved all components from
src/pages/policies
->src/components/policies
, to be reused by both the My Policies and Policy Select pages.BackButton component For UX purposes, we want to prevent the BackButton from going back (via
history.goBack()
) if the BackButton is present on the first page the user visited (i.e. the app entry page). Otherwise if they visited a website in the same tab before opening the DAO dashboard, it would navigate back to that website. The solution was quite simple, and it was to identify the app entry page withwindow.history.state
(the HashRouter doesn't support history/location state):And then we can figure out if we can go back or not:
Screenshots