Basket € 8.95
diff --git a/src/components/restaurant/restaurant.module.css b/src/components/restaurant/restaurant.module.css
index 558bea2..d3bb3c5 100644
--- a/src/components/restaurant/restaurant.module.css
+++ b/src/components/restaurant/restaurant.module.css
@@ -1,3 +1,7 @@
+.container {
+ max-width: 908px;
+}
+
.contentTabs {
height: auto;
text-align: center;
@@ -56,6 +60,10 @@
padding: 16px 16px 60px;
}
+ .tabsNav {
+ justify-content: center;
+ }
+
.fixedMobileBasketPanel {
display: flex;
}
diff --git a/src/components/restaurants-index/index.js b/src/components/restaurants-index/index.js
index 477f00d..b4e2f1f 100644
--- a/src/components/restaurants-index/index.js
+++ b/src/components/restaurants-index/index.js
@@ -1,9 +1,9 @@
import React, { useContext, useEffect, useState } from "react";
import PropTypes from "prop-types";
import styles from "./restaurants-index.module.css";
-import { Col, Row, Tabs, Typography } from "antd";
import { connect } from "react-redux";
import RestaurantItem from "./restaurant-item";
+import { Container } from "../container";
import i18n from "../../contexts/i18n-context";
import Loader from "../loader";
import { fetchRestaurants } from "../../redux/ac";
@@ -26,45 +26,61 @@ function RestaurantsIndex({ restaurants, fetchRestaurants, loading }) {
...new Set(restaurants.flatMap(restaurant => restaurant.cuisines))
];
+ const createTabs = () =>
+ cuisines.map(cuisine => (
+
+ ));
+
+ const createTabPanels = () =>
+ cuisines.map(cuisine => (
+
+ {restaurants
+ .filter(
+ restaurant =>
+ cuisine === "all" || restaurant.cuisines.includes(cuisine)
+ )
+ .map(restaurant => (
+
+ ))}
+
+ ));
+
return (
<>
-
- {t("order_food")}
-
-
- {t("from_restaurants")}
-
+
{t("order_food")}
+ {t("from_restaurants")}
-
- {cuisines.map(cuisine => (
-
-
-
- {restaurants
- .filter(
- restaurant =>
- cuisine === "all" || restaurant.cuisines.includes(cuisine)
- )
- .map(restaurant => (
-
- ))}
-
-
-
- ))}
-
+
+
+
+
+ {t("cuisines")}: {createTabs()}
+
+
+
+
{createTabPanels()}
+
>
);
}
diff --git a/src/components/restaurants-index/restaurant-item.js b/src/components/restaurants-index/restaurant-item.js
index f281307..1f7cd7c 100644
--- a/src/components/restaurants-index/restaurant-item.js
+++ b/src/components/restaurants-index/restaurant-item.js
@@ -1,37 +1,34 @@
import React from "react";
-import { Card, Col, Row } from "antd";
import { Link } from "react-router-dom";
+import { Container } from "../container";
+import { Card } from "../card";
import RateComponent from "../rate";
import styles from "./restaurant-item.module.css";
function RestaurantItem({ restaurant }) {
return (
-
-
-
-
-
-
-
-

-
-
-
{restaurant.name}
-
- {restaurant.cuisines.join(", ")}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+

+
+
+
{restaurant.name}
+
+ {restaurant.cuisines.join(", ")}
+
+
+
+
+
+
+
);
}
diff --git a/src/components/restaurants-index/restaurant-item.module.css b/src/components/restaurants-index/restaurant-item.module.css
index a78b43c..98ea56b 100644
--- a/src/components/restaurants-index/restaurant-item.module.css
+++ b/src/components/restaurants-index/restaurant-item.module.css
@@ -1,3 +1,7 @@
+.container {
+ max-width: 780px;
+}
+
.imgWrap {
width: 102px;
margin-right: 16px;
@@ -24,7 +28,7 @@
.description {
font-size: 16px;
line-height: 24px;
- margin: 0 0 5px;
+ margin: 0 0 12px;
}
.price {
@@ -36,16 +40,16 @@
}
.productCard {
- margin-top: 12px !important;
+ margin-top: 12px;
}
.productCard > * {
- padding: 20px !important;
+ padding: 20px;
}
@media all and (max-width: 767px) {
.productCard > * {
- padding: 12px !important;
+ padding: 12px;
}
.imgWrap {
@@ -61,6 +65,6 @@
.description {
font-size: 14px;
line-height: 20px;
- margin: 0;
+ margin: 0 0 3px;
}
}
diff --git a/src/components/reviews/index.js b/src/components/reviews/index.js
index b7f9b3f..e945482 100644
--- a/src/components/reviews/index.js
+++ b/src/components/reviews/index.js
@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
-import { Col, Row } from "antd";
+import { Container } from "../container";
import Review from "./review";
import ReviewForm from "./review-form";
import { connect } from "react-redux";
@@ -18,14 +18,12 @@ function Reviews({ restaurant, loading, loaded, fetchReviews }) {
if (!loaded || loading) return
;
return (
-
-
- {restaurant.reviews.map(id => (
-
- ))}
-
-
-
+
+ {restaurant.reviews.map(id => (
+
+ ))}
+
+
);
}
diff --git a/src/components/reviews/review-form/index.js b/src/components/reviews/review-form/index.js
index f84a93e..5bb1819 100644
--- a/src/components/reviews/review-form/index.js
+++ b/src/components/reviews/review-form/index.js
@@ -1,10 +1,11 @@
-import { Button, Card, Col, Form, Input, Row, Typography } from "antd";
import React, { useContext, useState } from "react";
import PropTypes from "prop-types";
import i18n from "../../../contexts/i18n-context";
import useInput from "../../../hooks/use-input";
+import cx from "classnames";
import Rate from "../../rate";
+import { Card } from "../../card";
import styles from "./review-form.module.css";
import { connect } from "react-redux";
import { addReview } from "../../../redux/ac";
@@ -21,43 +22,34 @@ const AddReview = ({ onSubmit }) => {
return (
-
-
-
- {t("leave_your_review")}
-
-
-
-
-
- {t("rating")}:{" "}
+
+
{t("leave_your_review")}
+
-
-
+
+
+
+
+
);
};
diff --git a/src/components/reviews/review-form/review-form.module.css b/src/components/reviews/review-form/review-form.module.css
index 9b0c676..ed9e67e 100644
--- a/src/components/reviews/review-form/review-form.module.css
+++ b/src/components/reviews/review-form/review-form.module.css
@@ -1,50 +1,82 @@
.reviewForm {
position: relative;
margin-bottom: 0;
+ padding: 20px 26px;
}
.reviewFormItem {
- margin-bottom: 5px !important;
+ margin-bottom: 5px;
}
.rateWrap {
font-size: 16px;
line-height: 24px;
color: #000;
+ white-space: nowrap;
+}
+
+.rateWrap > span {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1;
+}
+
+.rateWrap > span:first-child {
+ margin-right: 8px;
}
.addReviewTitle {
- font-size: 18px !important;
- line-height: 28px !important;
- margin-bottom: 16px !important;
+ font-size: 18px;
+ line-height: 28px;
+ margin-bottom: 16px;
+ font-weight: 600;
+}
+
+.message {
+ max-width: 70%;
+ width: 100%;
}
.submitButton {
height: 40px;
- border: 1px solid #f0ad4e !important;
+ border: 1px solid var(--yellow);
border-radius: 4px;
font-size: 14px;
line-height: 28px;
+ font-weight: 700;
text-align: center;
- color: #f0ad4e !important;
+ color: var(--yellow);
text-transform: uppercase;
- background-color: transparent !important;
+ background-color: transparent;
+ padding-left: 20px;
+ padding-right: 20px;
margin-top: 25px;
+ transition: 0.2s all;
+ cursor: pointer;
+}
+
+.submitButton:hover {
+ border-color: var(--yellow-light);
+ opacity: 0.8;
}
.invalid:focus {
- border-color: red !important;
+ border-color: #f00;
}
@media all and (max-width: 767px) {
+ .message {
+ max-width: none;
+ }
+
.reviewForm {
- margin-bottom: 10px !important;
- padding: 0 !important;
+ margin-bottom: 60px;
+ padding: 12px 16px;
}
.addReviewTitle {
- font-size: 16px !important;
- line-height: 28px !important;
- margin-bottom: 10px !important;
+ font-size: 16px;
+ line-height: 28px;
+ margin-bottom: 10px;
}
}
diff --git a/src/components/reviews/review/index.js b/src/components/reviews/review/index.js
index 493c009..d03a002 100644
--- a/src/components/reviews/review/index.js
+++ b/src/components/reviews/review/index.js
@@ -1,8 +1,8 @@
-import { Card, Col, Row, Typography } from "antd";
import React from "react";
import PropTypes from "prop-types";
import Rate from "../../rate";
+import { Card } from "../../card";
import styles from "./review.module.css";
import animationStyles from "./review-animation.module.css";
import { connect } from "react-redux";
@@ -12,23 +12,19 @@ import { CSSTransition } from "react-transition-group";
const Review = ({ review: { user = "Anonymous", text, rating } }) => (
-
-
-
+
+
+
{user}
-
-
+
+
{text}
-
-
-
+
+
+
-
-
+
+
);
diff --git a/src/components/reviews/review/review.module.css b/src/components/reviews/review/review.module.css
index 40dad88..e623411 100644
--- a/src/components/reviews/review/review.module.css
+++ b/src/components/reviews/review/review.module.css
@@ -7,29 +7,42 @@
margin-bottom: 0;
}
+.reviewInner {
+ padding: 20px 26px;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.reviewInner > *:last-child {
+ min-width: 80px;
+}
+
.addReviewTitle,
.name {
- font-size: 18px !important;
- line-height: 28px !important;
+ font-size: 18px;
+ line-height: 28px;
+ font-weight: 600;
}
.addReviewTitle {
- margin-bottom: 16px !important;
+ margin-bottom: 16px;
}
.name {
- margin-bottom: 5px !important;
+ margin-bottom: 5px;
}
.comment {
margin: 0;
- font-size: 16px !important;
- line-height: 24px !important;
+ font-size: 16px;
+ line-height: 24px;
}
@media all and (max-width: 767px) {
- .review > * {
- padding: 16px !important;
+ .reviewInner {
+ padding: 12px 16px;
}
.rateColumn {
@@ -40,13 +53,13 @@
.addReviewTitle,
.name {
- font-size: 16px !important;
- line-height: 24px !important;
- margin-bottom: 10px !important;
+ font-size: 16px;
+ line-height: 24px;
+ margin-bottom: 10px;
}
.comment {
- font-size: 14px !important;
- line-height: 20px !important;
+ font-size: 14px;
+ line-height: 20px;
}
}
diff --git a/src/contexts/i18n-dictionaries.json b/src/contexts/i18n-dictionaries.json
index 6c38031..aba36f8 100644
--- a/src/contexts/i18n-dictionaries.json
+++ b/src/contexts/i18n-dictionaries.json
@@ -20,7 +20,15 @@
"sub_total": "Sub-total:",
"delivery_costs": "Delivery costs:",
"free": "FREE",
- "total": "total:"
+ "total": "total:",
+ "order_name": "Name",
+ "order_phone": "Phone Number",
+ "order_address": "Address",
+ "order_final": "Order",
+ "thank_you": "Thank You!",
+ "thank_you_placed": "Your order is being prepared",
+ "cuisines": "Cuisines",
+ "all": "all"
},
"ru": {
"select_restaurant": "Пожалуйста, выберите ресторан",
@@ -43,6 +51,14 @@
"sub_total": "Предварительно:",
"delivery_costs": "Доставка:",
"free": "БЕСПЛАТНО",
- "total": "Всего:"
+ "total": "Всего:",
+ "order_name": "Имя",
+ "order_phone": "Номер телефона",
+ "order_address": "Адрес",
+ "order_final": "Заказать",
+ "thank_you": "Спасибо!",
+ "thank_you_placed": "Ваш заказ уже готовится",
+ "cuisines": "Кухни",
+ "all": "все"
}
}
diff --git a/src/hooks/use-tabs.js b/src/hooks/use-tabs.js
new file mode 100644
index 0000000..eadee42
--- /dev/null
+++ b/src/hooks/use-tabs.js
@@ -0,0 +1,14 @@
+import { useState } from "react";
+
+export const useTabs = (type, selectedItem) => {
+ const [activeItem, setActiveItem] = useState(selectedItem);
+
+ const changeActiveItem = id => {
+ const isTabs = type === "tabs";
+ const isAlreadyActive = activeItem === id;
+ const idSelected = isAlreadyActive && !isTabs ? 0 : id;
+ setActiveItem(idSelected);
+ };
+
+ return [activeItem, changeActiveItem];
+};
diff --git a/src/index.css b/src/index.css
index d607287..b14b3a4 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,5 +1,17 @@
-@import "/node_modules/normalize.css/normalize.css";
-@import "~antd/dist/antd.css";
+@import "~normalize.css/normalize.css";
+
+:root {
+ --black: #1d1d1d;
+ --white: #ffffff;
+ --orange: #e4661e;
+ --orange-light: #f0894e;
+ --pink: #fff0db;
+ --yellow: #f0ad4e;
+ --yellow-light: #ffd25d;
+ --grey: #e5e5e5;
+ --green: #49ab39;
+ --input-border: #c4c4c4;
+}
body {
margin: 0;
@@ -29,168 +41,209 @@ hr {
height: 1px;
}
-.text-center {
- text-align: center;
+p {
+ font-size: 16px;
+ line-height: 1.5;
+ margin: 0;
}
-.full-height-layout {
- min-height: calc(100vh - 60px) !important;
+p.sm {
+ font-size: 14px;
+ line-height: 1.4;
}
-h1.ant-typography,
-.ant-typography h1 {
- font-weight: 700 !important;
- text-align: center;
- font-size: 52px !important;
+p.bold {
+ font-weight: 700;
}
-.ant-typography strong {
- font-weight: 700 !important;
+fieldset {
+ padding: 0;
+ border: 0;
}
-.flex-grow-up {
- flex-grow: 1;
+.fullHeightLayout {
+ min-height: calc(100vh - 60px);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
}
-.ant-form-item-label {
- line-height: 1 !important;
- vertical-align: top !important;
- margin-bottom: 8px;
+h1 {
+ font-weight: 700;
+ text-align: center;
+ font-size: 52px;
+ margin: 0;
}
-.ant-form-item-label > label {
- font-size: 16px !important;
- color: #999 !important;
+h2 {
+ margin: 0;
}
-.ant-form-item-control {
- line-height: initial !important;
+h4 {
+ font-size: 18px;
+ line-height: 1.6;
+ font-weight: 600;
+ margin: 0;
}
-.ant-input-lg {
- height: 38px !important;
- padding: 5px 11px !important;
-}
+/* forms */
-.ant-tabs-nav-wrap {
- background-color: #e5e5e5 !important;
+input[type="text"],
+input[type="tel"],
+input[type="email"],
+textarea {
+ border: 1px solid var(--input-border);
+ border-radius: 4px;
+ padding: 9px 16px;
+ font-size: 16px;
+ line-height: 1.2;
+ outline: none;
+ box-shadow: none;
+ transition: 0.2s all;
}
-.ant-tabs-nav .ant-tabs-tab {
- margin-right: 0 !important;
- padding: 12px 0 !important;
- color: #1d1d1d !important;
- margin: 0 8px !important;
- font-size: 16px !important;
- line-height: 24px !important;
+input[type="text"]:focus,
+input[type="tel"]:focus,
+input[type="email"]:focus,
+textarea:focus {
+ border-color: var(--grey);
}
-.ant-tabs-ink-bar {
- background-color: #1d1d1d !important;
+input[type="text"],
+input[type="tel"],
+input[type="email"] {
+ height: 38px;
}
-.ant-tabs-bar {
- margin: 0 !important;
+textarea {
+ height: 84px;
}
-.ant-layout {
- background-color: #fff !important;
+.formGroup label {
+ display: block;
+ font-size: 16px;
+ line-height: 1.3;
+ font-weight: 400;
+ margin-bottom: 6px;
+ color: #999;
}
-.ant-card {
- border-radius: 0 !important;
+.formGroup input,
+.formGroup textarea {
+ width: 100%;
}
-.ant-card-body {
- padding: 20px 26px !important;
+.formGroup {
+ margin-bottom: 24px;
}
-.ant-btn {
- font-weight: 700 !important;
- color: #fff !important;
- background-color: #f0ad4e !important;
- border-color: #f0ad4e !important;
+.flexGrowUp {
+ flex-grow: 1;
}
-.ant-btn-primary {
- background-color: #f0894e !important;
- border-color: #f0894e !important;
- color: #fff !important;
+.contentWrap {
+ padding: 0;
}
-.ant-btn-primary:hover,
-.ant-btn-primary:active,
-.ant-btn-primary:focus {
- opacity: 0.8;
-}
+@media all and (max-width: 767px) {
+ .form {
+ padding: 16px 24px;
+ }
-.ant-btn-lg {
- height: 48px !important;
+ .formGroup {
+ margin-bottom: 16px;
+ }
}
-.content-wrap {
- padding: 0;
+@media all and (min-width: 768px) {
+ .contentWrap {
+ padding: 60px 0;
+ }
}
-.ant-rate {
- color: #f0ad4e !important;
-}
+/* tabs */
-.ant-modal-content,
-.ant-modal-body {
- height: 100%;
+.show {
+ display: block;
+}
+.hide {
+ display: none;
}
-.ant-modal-body {
- padding: 0 !important;
+.tabs {
+ /**/
}
-.ant-radio-group-small .ant-radio-button-wrapper {
- height: auto !important;
+.tab {
+ display: inline-flex;
+ margin: 0 0 0 24px;
+ padding: 12px 0;
+ font-size: 16px;
+ line-height: 1.5;
+ font-weight: 400;
+ outline: none;
+ box-shadow: none;
+ border: none;
+ background-color: transparent;
+ transition: 0.3s all;
+ vertical-align: top;
+ cursor: pointer;
+ position: relative;
+ opacity: 0.8;
+ text-transform: none;
}
-.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
- color: #ffd25d !important;
+.tab:first-child {
+ margin: 0;
}
-.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled),
-.ant-radio-button-wrapper {
- background: none !important;
- box-shadow: none !important;
- outline: none !important;
+.tab.tabSelected {
+ opacity: 1;
}
-.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before {
- opacity: 1 !important;
+.tabSelected:after {
+ content: "";
+ position: absolute;
+ top: calc(100% - 3px);
+ left: 0;
+ right: 0;
+ height: 3px;
+ background-color: var(--black);
}
-.ant-radio-button-wrapper {
- color: #fff !important;
- border: none !important;
- line-height: 1 !important;
- padding: 0 9px !important;
+.tabPanel {
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
}
-@media all and (max-width: 767px) {
- .ant-card-body {
- padding: 12px 16px !important;
- }
+.tabsHeader {
+ padding: 0 24px;
+ background-color: var(--grey);
+}
- .ant-form {
- padding: 20px 26px !important;
- }
+.tabsNav {
+ overflow-x: auto;
+ overflow-y: hidden;
+ white-space: nowrap;
+ text-align: center;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+}
- .ant-form-item {
- margin-bottom: 16px !important;
- }
+.tabsContent {
+ padding: 30px 0;
}
-@media all and (min-width: 768px) {
- .content-wrap {
- padding: 60px 0;
+@media all and (max-width: 767px) {
+ .tabsContent {
+ padding: 18px 0;
}
- .ant-form-item {
- margin-bottom: 24px !important;
+ .tabsNav {
+ justify-content: flex-start;
}
}