New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TASK-12: discovery page tabs #92
Conversation
ce1c7ec
to
2bc04f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation @r-saba! I had a few concerns and comments I'd like some clarifications on, but otherwise nice job.
apps/mull-ui/src/app/components/subnavigation-bar/subnavigation-bar.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments, I don't have time to re-review, and I don't want to block this pr, so I'll approve it immediately if it gets another approval. I'll be re-reviewing in more detail tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good! I just have a really minor change. Good job!
apps/mull-ui/src/constants.ts
Outdated
MAP: '/map', | ||
CREATE_EVENT: '/create-event', | ||
TOOLS: '/tools', | ||
MESSAGES: '/messages', | ||
PROFILE: '/profile', | ||
LOGIN: '/login', | ||
REGISTER: '/register', | ||
DISCOVER: '/discover', | ||
UPCOMING: '/upcoming', | ||
MYEVENTS: '/myevents', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really minor but I think it should be consistent
MYEVENTS: '/myevents', | |
MY_EVENTS: '/my-events', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚀 . I think it should have been mentioned that to test scrollability that you need to click along the length of container that has "DISCOVER!" "UPCOMING!" or "MYEVENTS!"
Acceptance Criteria
- The tabs are implemented for the discovery page and the user can swipe/tap to switch between tabs.
- Each tab is routed, but can lead to dead links or pages
- Documentation present for every new component and function
- Unit and UI tests are implemented for every component and function
- Must match Mockup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a chance to look at your pr in more detail and I found a few more issues I'd like addressed or replied to.
apps/mull-ui/src/app/app.tsx
Outdated
@@ -41,6 +44,15 @@ export const App = () => { | |||
<EventPage event={dummyEvent} prevPage={'Review'} /> | |||
</div> | |||
</Route> | |||
{/* Without this outter Route component, the inner components would show on all routes that are not matched */} | |||
<Route exact path={[`${ROUTES.DISCOVER}`, `${ROUTES.UPCOMING}`, `${ROUTES.MYEVENTS}`]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we can't have:
<Route exact path={[`${ROUTES.DISCOVER}`, `${ROUTES.UPCOMING}`, `${ROUTES.MYEVENTS}`]}> | |
<Route exact path={[ROUTES.DISCOVER, ROUTES.UPCOMING, ROUTES.MYEVENTS]}> |
I tried it and it seems to work
apps/mull-ui/src/app/app.tsx
Outdated
<Route exact path={[`${ROUTES.DISCOVER}`, `${ROUTES.UPCOMING}`, `${ROUTES.MYEVENTS}`]}> | ||
<SubNavigationBar /> | ||
<SwipeableRoutes> | ||
<Route path={ROUTES.DISCOVER} component={() => <div>DISCOVER!</div>} /> | ||
<Route path={ROUTES.UPCOMING} component={() => <div>UPCOMING!</div>} /> | ||
<Route path={ROUTES.MYEVENTS} component={() => <div>MYEVENTS!</div>} /> | ||
</SwipeableRoutes> | ||
</Route> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue im seeing right now with styling is that the Subnavbar is set to be in the page-container, which is then pushing the actual page content further down than it should.
I propose this solution: Remove the page-container class from SubNavigationBar, and put page-container on a container div. So something like this:
<Route exact path={[`${ROUTES.DISCOVER}`, `${ROUTES.UPCOMING}`, `${ROUTES.MYEVENTS}`]}> | |
<SubNavigationBar /> | |
<SwipeableRoutes> | |
<Route path={ROUTES.DISCOVER} component={() => <div>DISCOVER!</div>} /> | |
<Route path={ROUTES.UPCOMING} component={() => <div>UPCOMING!</div>} /> | |
<Route path={ROUTES.MYEVENTS} component={() => <div>MYEVENTS!</div>} /> | |
</SwipeableRoutes> | |
</Route> | |
<Route exact path={[ROUTES.DISCOVER, ROUTES.UPCOMING, ROUTES.MYEVENTS]}> | |
<div className="page-container"> | |
<SubNavigationBar /> | |
<SwipeableRoutes> | |
<Route path={ROUTES.DISCOVER} component={() => <div>DISCOVER!</div>} /> | |
<Route path={ROUTES.UPCOMING} component={() => <div>UPCOMING!</div>} /> | |
<Route path={ROUTES.MYEVENTS} component={() => <div>MYEVENTS!</div>} /> | |
</SwipeableRoutes> | |
</div> | |
</Route> |
apps/mull-ui/src/app/app.tsx
Outdated
@@ -41,6 +44,15 @@ export const App = () => { | |||
<EventPage event={dummyEvent} prevPage={'Review'} /> | |||
</div> | |||
</Route> | |||
{/* Without this outter Route component, the inner components would show on all routes that are not matched */} | |||
<Route exact path={[`${ROUTES.DISCOVER}`, `${ROUTES.UPCOMING}`, `${ROUTES.MYEVENTS}`]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about it the more I think these routes should be under /home
, since each tab is a subpage for the home page. I'm not gonna block the PR over this, but I really think what you did initially was good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will change it
[`${ROUTES.UPCOMING}`]: 'subnavigation-upcoming-button', | ||
[`${ROUTES.MYEVENTS}`]: 'subnavigation-myEvents-button', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as in app.tsx, is there a reason we can't put:
[`${ROUTES.UPCOMING}`]: 'subnavigation-upcoming-button', | |
[`${ROUTES.MYEVENTS}`]: 'subnavigation-myEvents-button', | |
[ROUTES.UPCOMING]: 'subnavigation-upcoming-button', | |
[ROUTES.MYEVENTS]: 'subnavigation-myEvents-button', |
I tried it and the tests still seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a remnant from my first iteration, I did a simple find and replace, should be what you proposed now.
223355c
to
82d35d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Work Ragith! I just had one last issue I saw. But otherwise this is as good as merged.
- The tabs are implemented for the discovery page and the user can swipe/tap to switch between tabs.
- Each tab is routed but can lead to dead links or pages
- Documentation present where needed
- Unit and UI tests are implemented for every component and function
- Must match Mockup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
- The tabs are implemented for the discovery page and the user can swipe/tap to switch between tabs.
- Each tab is routed but can lead to dead links or pages
- Documentation present where needed
- Unit and UI tests are implemented for every component and function
- Must match Mockup
5ed3192
82d35d4
to
5ed3192
Compare
ea8b537
This PR implements the discovery page tabs #54.
To test the component visit the followin URL:
http://localhost:4200/home
Swiping between routes is possible when in mobile view