-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implemented basic layout and functionalities for Recipe Search Results page and Recipe Detail page #15
Implemented basic layout and functionalities for Recipe Search Results page and Recipe Detail page #15
Changes from all commits
3728d2e
480cb36
a985cac
cd9a509
f5bf7e5
cc89ef0
2025c5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[1110/201713.186:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
|
||
const Ingredients = () => { | ||
|
||
return ( | ||
<div> | ||
Ingredients | ||
</div> | ||
); | ||
} | ||
|
||
export default Ingredients; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
|
||
const NutritionFacts = () => { | ||
|
||
return ( | ||
<div> | ||
Nutrition | ||
</div> | ||
); | ||
} | ||
|
||
export default NutritionFacts; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react"; | ||
|
||
const RecipeInstruction = () => { | ||
|
||
return ( | ||
<div> | ||
<ul> | ||
<li>Step 1</li> | ||
<li>Step 2</li> | ||
<li>Step 3</li> | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default RecipeInstruction; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
|
||
const RecipeRating = () => { | ||
|
||
return ( | ||
<div> | ||
5.0/5.0 | ||
</div> | ||
); | ||
} | ||
|
||
export default RecipeRating; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
|
||
const RecipeUserNotes = () => { | ||
|
||
return ( | ||
<div> | ||
<p>Some User Notes Here</p> | ||
</div> | ||
); | ||
} | ||
|
||
export default RecipeUserNotes; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from "react"; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Grid from '@material-ui/core/Grid'; | ||
import Paper from '@material-ui/core/Paper'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
flexGrow: 1, | ||
marginTop: 50 | ||
}, | ||
grid: { | ||
width: '100%', | ||
margin: '0px' | ||
}, | ||
leftColumn: { | ||
marginLeft: 50 | ||
}, | ||
recipePaper: { | ||
padding: theme.spacing.unit * 2, | ||
textAlign: 'center', | ||
color: 'black', | ||
marginBottom: 20, | ||
} | ||
})); | ||
|
||
const RecipeCard = (props) => { | ||
const classes = useStyles(); | ||
const imgStyle = { | ||
height: 'auto', | ||
maxWidth: '20%' | ||
}; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<Grid container spacing={7} className={classes.grid} direction="row"> | ||
<Grid item xs={8} md={8} className={classes.leftColumn}> | ||
<Paper className={classes.recipePaper}> | ||
<img src={props.imageUrl} alt="" style={imgStyle}></img> | ||
<p> Recipe ID: {props.recipeId} </p> | ||
<p> Recipe Name: {props.recipeName} </p> | ||
<p> Time to Cook: {props.timeToCookInMinutes} </p> | ||
<p> Calories: {props.calories} </p> | ||
<p> Servings: {props.servings} </p> | ||
</Paper> | ||
</Grid> | ||
</Grid> | ||
</div> | ||
); | ||
} | ||
|
||
RecipeCard.propTypes = { | ||
imageUrl: PropTypes.string, | ||
recipeName: PropTypes.string, | ||
recipeId: PropTypes.number, | ||
timeToCookInMinutes: PropTypes.number, | ||
calories: PropTypes.number, | ||
servings: PropTypes.number | ||
}; | ||
|
||
export default RecipeCard; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { PureComponent } from "react"; | ||
import { withRouter } from "react-router-dom"; | ||
import PropTypes from 'prop-types'; | ||
|
||
class ScrollIntoView extends PureComponent { | ||
componentDidMount = () => window.scrollTo(0, 0); | ||
|
||
componentDidUpdate = prevProps => { | ||
if (this.props.location !== prevProps.location) window.scrollTo(0, 0); | ||
}; | ||
|
||
render = () => this.props.children; | ||
} | ||
|
||
ScrollIntoView.propTypes = { | ||
location: PropTypes.string, | ||
children: PropTypes.string, | ||
}; | ||
|
||
export default withRouter(ScrollIntoView); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
|
||
CONSTANTS.APP_NAME = 'ChefCoPilot'; | ||
|
||
// Used for deployment | ||
// CONSTANTS.BACKEND_URL = 'https://chefcopilotbackend.herokuapp.com'; | ||
|
||
CONSTANTS.LOCAL_HOST_BACKEND_URL = "http://localhost:3001"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe for now can we just set CONSTANTS.BACKEND_UR as the local host url instead of making a local_host constant? just comment out the https://chefcopilot one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup. |
||
CONSTANTS.BACKEND_URL = 'http://localhost:3001'//'https://chefcopilotbackend.herokuapp.com'; | ||
|
||
CONSTANTS.ERROR_MESSAGE = {}; | ||
|
@@ -20,6 +24,7 @@ CONSTANTS.ENDPOINT.MASTERDETAIL = `${CONSTANTS.BACKEND_URL}/api/masterdetail`; | |
CONSTANTS.ENDPOINT.REMOVE_SHOPPING_LIST_ITEM = `${CONSTANTS.BACKEND_URL}/api/remove_item_from_shopping_list`; | ||
CONSTANTS.ENDPOINT.ADD_SHOPPING_LIST_ITEM = `${CONSTANTS.BACKEND_URL}/api/add_item_to_shopping_list`; | ||
CONSTANTS.ENDPOINT.GET_SHOPPING_LIST = `${CONSTANTS.BACKEND_URL}/api/shopping_list`; | ||
CONSTANTS.ENDPOINT.GET_ALL_RECIPES = `${CONSTANTS.LOCAL_HOST_BACKEND_URL}/api/recipes` | ||
CONSTANTS.ENDPOINT.FAVOURITES_LIST = `${CONSTANTS.BACKEND_URL}/api/favourites_list`; | ||
|
||
export default CONSTANTS; |
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 this supposed to be here, haha
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.
Oh yea, it shouldn't