UniversityDAO / udao

The official UniversityDAO DApp repository.
GNU Lesser General Public License v2.1
4 stars 4 forks source link

possible layout refactor #57

Closed oslfmt closed 2 years ago

oslfmt commented 2 years ago

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-routes

Other than that, some possible suggestions:

This PR doesn't have to be merged. Just easiest way to make a comment.

jagger-harris commented 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.

jagger-harris commented 2 years ago

Done.