Skip to content
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

Merged
merged 10 commits into from Nov 28, 2020
Merged

TASK-12: discovery page tabs #92

merged 10 commits into from Nov 28, 2020

Conversation

r-saba
Copy link
Collaborator

@r-saba r-saba commented Nov 27, 2020

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

@r-saba r-saba added adds npm packages PR introduces new npm dependencies to the project frontend labels Nov 27, 2020
@cristian-aldea cristian-aldea changed the title Task 12/discovery page tabs TASK-12: discovery page tabs Nov 27, 2020
Copy link
Collaborator

@cristian-aldea cristian-aldea left a 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.

package.json Show resolved Hide resolved
apps/mull-ui/src/app/app.scss Outdated Show resolved Hide resolved
apps/mull-ui/src/app/app.tsx Outdated Show resolved Hide resolved
apps/mull-ui/src/app/app.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@cristian-aldea cristian-aldea left a 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.

Copy link
Collaborator

@bit172 bit172 left a 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!

MAP: '/map',
CREATE_EVENT: '/create-event',
TOOLS: '/tools',
MESSAGES: '/messages',
PROFILE: '/profile',
LOGIN: '/login',
REGISTER: '/register',
DISCOVER: '/discover',
UPCOMING: '/upcoming',
MYEVENTS: '/myevents',
Copy link
Collaborator

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

Suggested change
MYEVENTS: '/myevents',
MY_EVENTS: '/my-events',

JimLau49
JimLau49 previously approved these changes Nov 28, 2020
Copy link
Collaborator

@JimLau49 JimLau49 left a 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

Copy link
Collaborator

@cristian-aldea cristian-aldea left a 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.

@@ -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}`]}>
Copy link
Collaborator

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:

Suggested change
<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

Comment on lines 48 to 61
<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>
Copy link
Collaborator

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.

image

I propose this solution: Remove the page-container class from SubNavigationBar, and put page-container on a container div. So something like this:

Suggested change
<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>

@@ -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}`]}>
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

Comment on lines 26 to 27
[`${ROUTES.UPCOMING}`]: 'subnavigation-upcoming-button',
[`${ROUTES.MYEVENTS}`]: 'subnavigation-myEvents-button',
Copy link
Collaborator

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:

Suggested change
[`${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.

Copy link
Collaborator Author

@r-saba r-saba Nov 28, 2020

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.

@r-saba
Copy link
Collaborator Author

r-saba commented Nov 28, 2020

I addressed your pr comments @bit172 @TheGreatMarkus @JimLau49 . Let me know how it's looking.
Major difference is now each tab points to a nested route /home/:id

cristian-aldea
cristian-aldea previously approved these changes Nov 28, 2020
Copy link
Collaborator

@cristian-aldea cristian-aldea left a 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

apps/mull-ui/src/app/app.tsx Show resolved Hide resolved
JimLau49
JimLau49 previously approved these changes Nov 28, 2020
bit172
bit172 previously approved these changes Nov 28, 2020
Copy link
Collaborator

@bit172 bit172 left a 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

JimLau49
JimLau49 previously approved these changes Nov 28, 2020
bit172
bit172 previously approved these changes Nov 28, 2020
cristian-aldea
cristian-aldea previously approved these changes Nov 28, 2020
@r-saba r-saba dismissed stale reviews from cristian-aldea, bit172, and JimLau49 via ea8b537 November 28, 2020 23:29
@r-saba r-saba merged commit eaa3299 into develop Nov 28, 2020
@r-saba r-saba deleted the TASK-12/discovery-page-tabs branch December 20, 2020 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adds npm packages PR introduces new npm dependencies to the project frontend refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants