Closed oslfmt closed 2 years ago
Ok, I thought I knew what layouts did but I did some research and we can make all pages follow a basic layout of at least having a navigation menu. Then, proposals and grants pages can also have their own layout. I can actually put the different sections that have the proposals and grants inside of a component themselves, eliminating a lot of duplicate code. I will work on this.
Yes, the landing page will be the main root, but that is simple to change. Eventually we will have to figure out how to make a component be it's own thing in React, that should be possible and it will make it to where each proposal/grant is its own thing.
Done.
Just reviewed the frontend revamp. I think most refactoring will come after we figure out the state issue but a couple suggestions. First, the main thing that code in this PR actually addresses. I noticed that the 3 main pages: Dashboard, grants, proposals, all have the same general layout. There is some duplicate html code in each component, and I think this could all be extracted to a generic "layout" component. The differences would be rendered in
<Outlet />
. See this for more: https://reactrouter.com/docs/en/v6/getting-started/concepts#layout-routesOther than that, some possible suggestions:
/
right now, but the root will probably have to be the landing page. Can the landing page be just done in theindex.html
file? Since it will literally just be text and images./view_proposal
that renders the specific view for a proposal/grant. This works for now since each dummy proposal is the exact same. But once we have real proposals, each proposal will be different. So we might need something like url params: https://reactrouter.com/docs/en/v6/getting-started/concepts#match-params. Just something to think about, might be hard to reason about since state isn't set yet.This PR doesn't have to be merged. Just easiest way to make a comment.