A suite of apps that includes allocation, dot voting, issue curation, and other planning tools so organizations can collectively budget and design custom reward & bounty systems.
GNU General Public License v3.0
92
stars
54
forks
source link
refactor(projects): mv Tabs & Header out of App.js #1894
Soon, we will get rid of Issues from the Tabs bar, and when you tap on a project from Overview, you will see a ProjectDetail view. This ProjectDetail view will be very similar to the current Issues component, but will show a back button & filter bar instead of the tabs, and may have different header text.
Rather than adding more edge-case logic to App.js, I simplified it, moving this logic to the Content components. Here's what changed:
rm Header and Tabs from App.js, add to Content components
extract Tabs logic to own component, easy to use anywhere
relocate which-Content-to-show logic to Routes component
clean up props passed to Content components – Issues saw the biggest cleanup. Some of the props declared in its propTypes were vestigial, and many that were passed from App.js could be looked up in the component itself.
While testing this, I discovered a bug, triggered by these steps:
add a project
visit /issues
refresh the page
cached data loads initially
aragonAPI replays info from the blockchain, since current data is not more than 100 blocks old and nothing is cached in its store
data gets reset, so repos becomes empty
we construct a nonsense GraphQL query for an empty set of repos
The fix for this required one line, so I included it here.
Soon, we will get rid of Issues from the Tabs bar, and when you tap on a project from Overview, you will see a ProjectDetail view. This ProjectDetail view will be very similar to the current Issues component, but will show a back button & filter bar instead of the tabs, and may have different header text.
Rather than adding more edge-case logic to App.js, I simplified it, moving this logic to the Content components. Here's what changed:
While testing this, I discovered a bug, triggered by these steps:
/issues
store
repos
becomes emptyThe fix for this required one line, so I included it here.
I recommend reading the changes with indentation changes hidden