Skip to content

Commit

Permalink
resolved conflict
Browse files Browse the repository at this point in the history
Relates #34
  • Loading branch information
MohammadAlhalaq committed Oct 2, 2019
2 parents cbda7f5 + b4155b0 commit 670aaa0
Show file tree
Hide file tree
Showing 15 changed files with 741 additions and 280 deletions.
56 changes: 56 additions & 0 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 @@ -17,7 +17,7 @@
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.17.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.7.0",
Expand Down
17 changes: 10 additions & 7 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<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>
Expand All @@ -16,11 +17,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 @@ -30,5 +32,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,8 @@
/* 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 Feedback from '../feedback';
import Error404 from '../pages/Error404/index';
Expand All @@ -27,6 +29,7 @@ export default class App extends React.Component {
)}
/>
<Route exact path="/feedback" component={Feedback} />
<Route path="/meals" component={MenuPage} />
<Route exact path="*" component={Error404} />
</Switch>
</Router>
Expand Down
44 changes: 44 additions & 0 deletions client/src/components/App/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,47 @@
padding: 0;
box-sizing: border-box;
}

.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;
}

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 670aaa0

Please sign in to comment.