Skip to content

Commit

Permalink
resolved conflict
Browse files Browse the repository at this point in the history
Relates #37
  • Loading branch information
MohammadAlhalaq committed Oct 2, 2019
2 parents 1e9a08d + b4155b0 commit c6f0ad5
Show file tree
Hide file tree
Showing 16 changed files with 716 additions and 303 deletions.
51 changes: 34 additions & 17 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-router-dom": "^5.1.0",
"react-router-dom": "^5.1.1",
"react-scripts": "^3.1.2"
},
"devDependencies": {
Expand Down
17 changes: 9 additions & 8 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Creepster|Roboto&display=swap" rel="stylesheet">

<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<!--
Notice the use of %PUBLIC_URL% in the tag above.
Expand All @@ -17,11 +16,12 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
<title>React App</title>
</head>

<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -31,5 +31,6 @@
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
</body>

</html>
Binary file added client/src/assets/screen-0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/components/App/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react/no-unused-state */
import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import MenuPage from '../MealPage';

import Login from '../pages/Login/index';
import Error404 from '../pages/Error404/index';
Expand Down Expand Up @@ -28,6 +29,8 @@ export default class App extends React.Component {
)}
/>
<Route exact path="/" component={Home} />
<Route path="/meals" component={MenuPage} />

<Route exact path="*" component={Error404} />
</Switch>
</Router>
Expand Down
46 changes: 42 additions & 4 deletions client/src/components/App/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,46 @@
.App {
text-align: center;
}
.nav{
height: 3rem;
}
.header{
width: 100%;
background: #ED6707;
}
.header__nav{
display: flex;
flex-direction: row;
line-height: 1rem;
padding: 6px 0px 11px 0px;
}
.float{
position:fixed;
width:60px;
height:60px;
bottom:30px;
right:30px;
background-color:#ED6707;
color:#FFF;
border-radius:50px;
text-align:center;
box-shadow: 2px 2px 3px #999;
}
.categoryName{
color: #FFF;
flex: 3;
font-weight: bold;
font-size: 18px;
font-family: Lato;
}
.my-float{
margin-top:22px;
}
.app{
width: 100%;
}
.page{
color: #FFF;;
flex: 1;
}


body{
margin: 0;
}
27 changes: 27 additions & 0 deletions client/src/components/MealPage/CardMeal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import PropTypes from 'prop-types';
import './style.css';

const CardMeal = ({ oneMeal: { img, name, short_desc: shortDesc, price } }) => (
<div className="meal ">
<img className="meal__img" src={img} alt="food" />
<div className="meal__desc">
<h4 className="meal__name">{name}</h4>
<p className="meal__shorDesc">{shortDesc}</p>
</div>

<div className="meal__icon">
<i className="fas card fa-angle-right"></i>
<span className="meal__price">{price}</span>
</div>
</div>
);
CardMeal.propTypes = {
oneMeal: PropTypes.isRequired,
img: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
short_desc: PropTypes.string.isRequired,
price: PropTypes.number.isRequired,
};

export default CardMeal;
71 changes: 71 additions & 0 deletions client/src/components/MealPage/Category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from 'react';
import PropTypes from 'prop-types';
import './style.css';

const Category = ({ fetchMeals }) => {
return (
<div className="category">
<ul className="category_menu">
<li>
<i
className="category_icon white fas fa-turkey"
tabIndex={0}
onClick={() => fetchMeals('desserts')}
role="button"
onKeyPress={key => key}
>
Desserts
</i>
</li>
<li>
<i
className="category_icon white fas fa-turkey"
tabIndex={0}
onClick={() => fetchMeals('breakfast')}
role="button"
onKeyPress={key => key}
>
Breakfast
</i>
</li>
<li>
<i
className="category_icon white fas fa-turkey"
tabIndex={0}
onClick={() => fetchMeals('drinks')}
role="button"
onKeyPress={key => key}
>
Drinks
</i>
</li>
<li>
<i
className="category_icon white fas fa-turkey"
tabIndex={0}
onClick={() => fetchMeals('sandwishes')}
role="button"
onKeyPress={key => key}
>
Sandwiches
</i>
</li>
<li>
<i
className="category_icon white fas fa-turkey"
tabIndex={0}
onClick={() => fetchMeals('main')}
role="button"
onKeyPress={key => key}
>
Main
</i>
</li>
</ul>
</div>
);
};
Category.propTypes = {
fetchMeals: PropTypes.func.isRequired,
};
export default Category;
29 changes: 29 additions & 0 deletions client/src/components/MealPage/MealList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import CardMeal from './CardMeal';

import './style.css';

const MealList = ({ data }) => {
const listItems = data.map(item => {
return (
<Link
className="link"
to={{
pathname: '/details',
state: { item },
}}
>
<li>
<CardMeal key={item.id} oneMeal={item} />
</li>
</Link>
);
});
return <ul className="menu">{listItems}</ul>;
};
MealList.propTypes = {
data: PropTypes.isRequired,
};
export default MealList;
Loading

0 comments on commit c6f0ad5

Please sign in to comment.