Skip to content

Mini challenge 5 routing#1

Open
JaviHuizar wants to merge 12 commits intomasterfrom
mini-challenge-5-Routing
Open

Mini challenge 5 routing#1
JaviHuizar wants to merge 12 commits intomasterfrom
mini-challenge-5-Routing

Conversation

@JaviHuizar
Copy link
Owner

No description provided.

Copy link

@erickwize erickwize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments

You're still combining yarn and npm, try only one of those. I left out some recommendations and suggestions.
The server where the React app is deployed is redirecting all the URLs to the main one. You're not able to copy a URL, paste it on another tab and see the same content.
You didn't add any of the testing parts. We encouraged you to do that if you would like to receive the certificate (you could add snapshots and increase the coverage)

Acceptance Criteria

  • All the sections have their own route.
  • Navigation across the sections is implemented correctly.
  • The Global State is persistent across all the sections.
  • The "Mocked Authentication" mechanism works correctly.
  • The "session data" is stored in the Global Context correctly.
  • Videos can be added to the Favorites list.
  • Videos can be removed from the Favorites list.
  • Navigation to Favorite Videos View using a private route is implemented correctly (only authenticated users should access this section).
  • Navigation to the Favorite Video Details View using a private route is implemented correctly (only authenticated users should access this section).
  • Information for the selected favorite video is displayed correctly
  • The list of other favorite videos in the Favorite Video Details View is displayed.
  • Testing coverage is above 70%. (Please include a screenshot of the code coverage report in your PR description).

Bonus Points

  • The Add/remove from favorites button should appear when the user passes the mouse over the video card in the list.
  • Integrate with a real authentication provider (such as Auth0, OAuth or Firebase).
  • A 404 section is shown when a route is not found.
  • The Login View is implemented as a modal using React Portals.

@@ -0,0 +1 @@
REACT_APP_API_YOUTUBE_KEY = AIzaSyAOsyZMq5msH04OZ9W7Y_fQX--TictP_v8 No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing this file from git, you should never upload secrets to your git repository and, I suggest creating a file called .env.example with all the needed variables

REACT_APP_API_YOUTUBE_KEY=

Comment on lines +43 to +54
<Route exact path="/video">
<VideoDetail />
</Route>
<Route exact path="/login">
<Login />
</Route>
<Private exact path="/favorites">
<FavoriteVideos />
</Private>
<Private exact path="/favoritedetails">
<FavoriteVideoDetail />
</Private>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the routes /video and, /favorites you are not going to give the feature of URL sharing one of the main reasons to implement routing. I recommend changing them to /video/:id and, /favorites/:id and extract the id inside the corresponding component using a hook.

import { useParams } from 'react-router-dom';
....
function Component () {
  ...
  const { id } = useParams();
}

const { REACT_APP_API_YOUTUBE_KEY } = process.env;

const Fetch = async (search) => {
console.log(search);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend removing all the console.logs before submitting a PR 😊

required
type="text"
id="username"
onChange={(event) => onChangeUserName(event.target.value)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend calling directly onChange={(event) => setUsername(event.target.value)}

Comment on lines +13 to +19
function onChangeUserName(value) {
setUsername(() => value);
}

function onChangePassword(value) {
setPassword(() => value);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend removing these two functions

required
type="password"
id="password"
onChange={(event) => onChangePassword(event.target.value)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here: onChange={(event) => setPassword(event.target.value)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants