Kimberly-Hart / East-Barley

1 stars 1 forks source link

Routing #67

Closed aclai4067 closed 4 years ago

aclai4067 commented 4 years ago

UserStory

AC

When you look at the App.js file THEN there should be 6 routes set up.***

DevNotes

const PublicRoute2 = ({ component: Component, authed, ...rest }) => { const routeChecker = (props) => (authed === false ? <Component {...props} {...rest}/> : <Redirect to={{ pathname: '/', state: { from: props.location } }} />); return <Route {...rest} render={(props) => routeChecker(props)} />; }; const PrivateRoute2 = ({ component: Component, authed, ...rest }) => { const routeChecker = (props) => (authed === true ? <Component {...props} {...rest}/> : <Redirect to={{ pathname: '/home', state: { from: props.location } }} />); return <Route {...rest} render={(props) => routeChecker(props)} />; };

- [x] Then, inside of the ```return()```  in ```App.js``` add these routes:

- [x] Inside of the ```Pages``` folder add a folder for each route and then a javascript and SASS file inside of that folder for each route. Example: ```Folder for Whiskeys and a Whiskey.js and Whiskey.scss inside of that folder.```
aclai4067 commented 4 years ago

public route what causing infinite loop issues, after consulting with Nathan and Martin, changed these to just use Route