Download netflix-clone-using-react/src/app.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/netflix-clone-using-react/src/app.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/netflix-clone-using-react/src/app.js
-
curl -L -o app.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/netflix-clone-using-react/src/app.js
1.07 kB
| import React from 'react'; | |
| import { BrowserRouter as Router, Switch } from 'react-router-dom'; | |
| import { Home, Browse, Signin, Signup } from './pages'; | |
| import * as ROUTES from './constants/routes'; | |
| import { IsUserRedirect, ProtectedRoute } from './helpers/routes'; | |
| import { useAuthListener } from './hooks/index'; | |
| export default function App() { | |
| const {user} = useAuthListener(); | |
| console.log(user); | |
| return ( | |
| <Router> | |
| <Switch> | |
| <IsUserRedirect user={user} loggedInPath={ROUTES.BROWSE} | |
| path={ROUTES.SIGN_IN} | |
| > | |
| <Signin /> | |
| </IsUserRedirect> | |
| <IsUserRedirect user={user} loggedInPath={ROUTES.BROWSE} | |
| path={ROUTES.SIGN_UP} | |
| > | |
| <Signup /> | |
| </IsUserRedirect> | |
| <ProtectedRoute user={user} path={ROUTES.BROWSE} > | |
| <Browse /> | |
| </ProtectedRoute> | |
| <IsUserRedirect user={user} loggedInPath={ROUTES.BROWSE} | |
| path={ROUTES.HOME} exact> | |
| <Home /> | |
| </IsUserRedirect> | |
| </Switch> | |
| </Router> | |
| ); | |
| } | |