From 7aaf28e0ab6dfed8f71fb1cf20d437603fef75c0 Mon Sep 17 00:00:00 2001 From: mahdi Date: Fri, 15 Jul 2022 16:45:15 +0430 Subject: [PATCH] update --- src/components/Design2D/index.js | 15 ++--------- src/components/Product/index.js | 7 ++--- src/views/Contact/index.js | 10 ------- .../Dashboard/layouts/Main/MyBooks/index.js | 7 +---- .../Main/UserItems/ProductSuggestion/index.js | 2 +- .../layouts/Mobile/ProfileAddress/index.js | 10 +++---- src/views/DeliveryForm/TransportDate/index.js | 4 +-- .../DeliveryForm/TransportMethod/index.js | 11 ++++---- src/views/DeliveryForm/index.js | 27 ++++++++++--------- src/views/Faq/index.js | 21 ++++++++++----- src/views/Favorites/index.js | 14 +++++----- .../Home/Portrait/Private/MyBooks/index.js | 6 ++--- src/views/Order/components/Book.js | 4 +-- src/views/Order/index.js | 13 +++++---- src/views/Orders/components/Order.js | 8 +++--- src/views/Orders/index.js | 2 +- .../Product/Desktop/ProductOverAll/index.js | 2 +- src/views/Product/index.js | 10 ++++--- 18 files changed, 79 insertions(+), 94 deletions(-) diff --git a/src/components/Design2D/index.js b/src/components/Design2D/index.js index 2e22a56..01d9c66 100644 --- a/src/components/Design2D/index.js +++ b/src/components/Design2D/index.js @@ -3,7 +3,7 @@ import React from "react"; const Design2D = ({ array }) => { return (
{array.map((item, index) => ( @@ -11,10 +11,6 @@ const Design2D = ({ array }) => { className={`flex flex-col justify-center h-full`} style={{ flex: item.flex, - // display:'-webkit-box', - // display:'flex', - // maxHeight: '400px', - // minHeight: '400px' }} key={index} > @@ -32,14 +28,7 @@ const Design2D = ({ array }) => { backgroundRepeat: "no-repeat", backgroundPosition: "center", }} - > - {/*

inside div

*/} - {/* */} - + > ))} diff --git a/src/components/Product/index.js b/src/components/Product/index.js index 1a54026..5cdc35b 100644 --- a/src/components/Product/index.js +++ b/src/components/Product/index.js @@ -122,12 +122,13 @@ const ProductDesign = ({ {/* price with line on it */} {discountPrice && (

- 145{window.t("تومان")} + {separate(product.product?.masterPrice)} + {window.t("تومان")}

)}

- {separate(product.product[type]?.price)}{" "} + {separate(product.product[type]?.price)} {window.t("تومان")}

@@ -191,7 +192,7 @@ ProductDesign.defaultProps = { discount: false, discountPricePercent: false, // product price - discountPrice: false, + discountPrice: true, priceHolder: true, productContent: false, diff --git a/src/views/Contact/index.js b/src/views/Contact/index.js index 377a8d5..8fb6e56 100644 --- a/src/views/Contact/index.js +++ b/src/views/Contact/index.js @@ -96,11 +96,6 @@ Contact.defaultProps = { tel: null, color: "#766600", }, - // link: { - // title: window.t("ارتباط با بخش پشتیبانی"), - // link: "/support", - // color: "#766600", - // }, bg: "#D3B70222", borderColor: "#D3B70255", }, @@ -128,11 +123,6 @@ Contact.defaultProps = { tel: null, color: "#066A5C", }, - // link: { - // title: window.t("لیست نمایندگی‌های فروش"), - // link: "/sell", - // color: "#0A7769", - // }, bg: "#0A776922", borderColor: "#0A776955", }, diff --git a/src/views/Dashboard/layouts/Main/MyBooks/index.js b/src/views/Dashboard/layouts/Main/MyBooks/index.js index fa03405..a238a8a 100644 --- a/src/views/Dashboard/layouts/Main/MyBooks/index.js +++ b/src/views/Dashboard/layouts/Main/MyBooks/index.js @@ -55,11 +55,6 @@ export const MyBooks = ({ books, grades, isMobile, userProducts }) => { ) : null} - {/* */} ); }; @@ -67,7 +62,7 @@ export const MyBooks = ({ books, grades, isMobile, userProducts }) => { const mapStateToProps = (state) => ({ userProducts: state.userProduct.list, grades: state.publicApi.grades, - isMobile: state.config.device === 'mobile', + isMobile: state.config.device === "mobile", books: state.book.list, }); diff --git a/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js b/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js index 9c00c62..4e4973a 100644 --- a/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js +++ b/src/views/Dashboard/layouts/Main/UserItems/ProductSuggestion/index.js @@ -8,7 +8,7 @@ function Suggestion({ products, grades, isMobile }) { return (
- پیشنهادات ما به شما + {window.t("پیشنهادات ما به شما")} {products?.length ? (
diff --git a/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js b/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js index f16930a..5c3a6f6 100644 --- a/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js +++ b/src/views/Dashboard/layouts/Mobile/ProfileAddress/index.js @@ -144,7 +144,7 @@ const Location = ({ className="py-3 pr-2 pl-10 border-none m-0 text-sm text-red19 font-bold" onClick={() => delAddress(address.id)} > - حذف + {window.t("حذف")}
@@ -177,20 +177,20 @@ const Location = ({
- {`{window.t("آدرس:")}` + " " + address.address} + {`${window.t("آدرس:")}` + " " + address.address} - {`{window.t("نام:")}` + + {`${window.t("نام:")}` + " " + address.firstName + " " + address.lastName} - {`{window.t("کد پستی:")}` + " " + address.postalCode} + {`${window.t("کد پستی:")}` + " " + address.postalCode} - {`{window.t("شماره تماس:")}` + " " + address.cellphone} + {`${window.t("شماره تماس:")}` + " " + address.cellphone}
{!active && ( diff --git a/src/views/DeliveryForm/TransportDate/index.js b/src/views/DeliveryForm/TransportDate/index.js index de4ffab..db07275 100644 --- a/src/views/DeliveryForm/TransportDate/index.js +++ b/src/views/DeliveryForm/TransportDate/index.js @@ -11,7 +11,7 @@ function TransportDate({ transportDate, isMobile }) { return isMobile ? ( setActiveDate(time)} active={activeDate === time} @@ -35,7 +35,7 @@ function TransportDate({ transportDate, isMobile }) { onClick={() => setActiveDate(time)} active={activeDate === time} toggle={true} - status={"تکمیل ظرفیت"} + status={window.t("تکمیل ظرفیت")} > @@ -77,7 +77,8 @@ function TransportMethod({ : "text-blue52 dark:text-white" }`} > - هزینه ارسال   {separate(method.price)} + {window.t("هزینه ارسال")} +   {separate(method.price)} ); @@ -85,7 +86,7 @@ function TransportMethod({ return isMobile ? (
- لطفا یک روش ارسال انتخاب کنید + {window.t("یک روش ارسال انتخاب کنید")}
    {list.map((method, index) => ( @@ -100,7 +101,7 @@ function TransportMethod({ ) : (
    - لطفا یک روش ارسال انتخاب کنید + {window.t("لطفا یک روش ارسال انتخاب کنید")}
      {list.map((method, index) => ( diff --git a/src/views/DeliveryForm/index.js b/src/views/DeliveryForm/index.js index d963a1b..08a8b90 100644 --- a/src/views/DeliveryForm/index.js +++ b/src/views/DeliveryForm/index.js @@ -40,7 +40,7 @@ export const DeliveryForm = ({ color: !isDark ? (type === "error" ? "#F1420D" : "#246E8A") : "", }} > - {value + " " + "تومان"} + {value + " " + window.t("تومان")}
); @@ -65,7 +65,7 @@ export const DeliveryForm = ({ }} > - تکمیل اطلاعات + {window.t("تکمیل اطلاعات")} بازگشت setPhase("products")} /> @@ -124,21 +124,22 @@ DeliveryForm.defaultProps = { form: { addresses: [ { - address: - " تهران میدان احمد آباد خیابان شریعتی بعد از میدان فجر بن بست شکوفه پلاک 4 زنگ 12", - receiver: "احمد نام آور", + address: window.t( + "تهران میدان احمد آباد خیابان شریعتی بعد از میدان فجر بن بست شکوفه پلاک 4 زنگ 12" + ), + receiver: window.t("احمد نام آور"), postalCode: "54352432", cellphone: "09123456789", }, ], transportMethods: [ { - name: "ارسال اکسپرس مخصوص شهر تهران", + name: window.t("ارسال اکسپرس مخصوص شهر تهران"), cost: "25.000", icon: ExpressIcon, }, { - name: "ارسال با پست پیشتاز", + name: window.t("ارسال با پست پیشتاز"), cost: "25.000", icon: PishtazIcon, }, @@ -147,25 +148,25 @@ DeliveryForm.defaultProps = { day: new Date(), times: [ { - time: "ساعت 9 تا 12", + time: window.t("ساعت 9 تا 12"), status: "completed", }, { - time: "ساعت 12 تا 15", + time: window.t("ساعت 12 تا 15"), status: "free", }, { - time: "ساعت 15 تا 18", + time: window.t("ساعت 15 تا 18"), status: "free", }, ], }, paymentMethods: [ { - name: "پرداخت آنلاین با کلیه کارت‌های عضو شبکه شتاب", + name: window.t("پرداخت آنلاین با کلیه کارت‌های عضو شبکه شتاب"), }, { - name: "پرداخت در محل", + name: window.t("پرداخت در محل"), }, ], }, diff --git a/src/views/Faq/index.js b/src/views/Faq/index.js index 5671e5c..1566019 100644 --- a/src/views/Faq/index.js +++ b/src/views/Faq/index.js @@ -12,7 +12,14 @@ import faqBgImage from "./faq-bg.svg"; import desktopFaqBgImage from "./desktop-faq-bg.svg"; import searchLight from "../../assets/icons/search-light.svg"; -function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectFaq }) { +function Faq({ + headerOptions, + setHeaderOptions, + isMobile, + list, + getList, + selectFaq, +}) { useEffect(() => { setHeaderOptions(headerOptions); getList(); @@ -24,7 +31,7 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF >
@@ -43,8 +50,8 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF
@@ -55,13 +62,13 @@ function Faq({ headerOptions, setHeaderOptions, isMobile, list, getList, selectF const mapStateToProps = (state) => ({ isMobile: state.publicApi.isMobile, - list : state.faq.list, - active : state.faq.active + list: state.faq.list, + active: state.faq.active, }); const mapDispatchToProps = { setHeaderOptions: publicApi.setHeaderOptions, getList: faq.list, - selectFaq: faq.selectFaq + selectFaq: faq.selectFaq, }; export default connect(mapStateToProps, mapDispatchToProps)(Faq); diff --git a/src/views/Favorites/index.js b/src/views/Favorites/index.js index 0cf83f8..45df0c4 100644 --- a/src/views/Favorites/index.js +++ b/src/views/Favorites/index.js @@ -35,7 +35,7 @@ const Favorites = ({ )) ) : ( - + )}
); @@ -78,18 +78,18 @@ export default connect(mapStateToProps, mapDispatchToProps)(Favorites); Favorites.defaultProps = { bookmarkList: [ { - name: "کتاب آموزشی علوم تجربی", - grade: "پایه ششم ابتدایی", + name: window.t("کتاب آموزشی علوم تجربی"), + grade: window.t("پایه ششم ابتدایی"), image: bookImage, }, { - name: "کتاب آموزشی علوم تجربی", - grade: "پایه ششم ابتدایی", + name: window.t("کتاب آموزشی علوم تجربی"), + grade: window.t("پایه ششم ابتدایی"), image: bookImage, }, { - name: "کتاب آموزشی علوم تجربی", - grade: "پایه ششم ابتدایی", + name: window.t("کتاب آموزشی علوم تجربی"), + grade: window.t("پایه ششم ابتدایی"), image: bookImage, }, ], diff --git a/src/views/Home/Portrait/Private/MyBooks/index.js b/src/views/Home/Portrait/Private/MyBooks/index.js index 0514722..449b54c 100644 --- a/src/views/Home/Portrait/Private/MyBooks/index.js +++ b/src/views/Home/Portrait/Private/MyBooks/index.js @@ -63,13 +63,13 @@ function MyBooks({ books, grades, isMobile }) { to={"/scan"} className="w-full text-center py-3 bg-blueC0 text-white font-medium rounded-sm text-tiny" > - اسکن کد QR + {window.t(" اسکن کد QR")} - واقعیت افزوده + {window.t("واقعیت افزوده")}
@@ -83,7 +83,7 @@ function MyBooks({ books, grades, isMobile }) {
- کتابهای من + {window.t("کتابهای من")}
    {books?.slice(0, 5)?.map((book, index) => ( diff --git a/src/views/Order/components/Book.js b/src/views/Order/components/Book.js index 2d2c22e..4c74d20 100644 --- a/src/views/Order/components/Book.js +++ b/src/views/Order/components/Book.js @@ -14,7 +14,7 @@ function Book({ book, grades }) { {book?.product?.book?.name || " "} - {"پایه" + " " + grades[book?.product?.book?.gradeId]} + {window.t("پایه") + " " + grades[book?.product?.book?.gradeId]}
@@ -23,7 +23,7 @@ function Book({ book, grades }) { {book?.product?.count}
- {book?.product?.price + " " + "تومان"} + {book?.product?.price + " " + window.t("تومان")}
diff --git a/src/views/Order/index.js b/src/views/Order/index.js index eec1e51..dfe56bd 100644 --- a/src/views/Order/index.js +++ b/src/views/Order/index.js @@ -33,7 +33,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
{order?.transactionId ? ( - {"شماره سفارش:" + " " + order?.transactionId} + {window.t("شماره سفارش:") + " " + order?.transactionId} ) : null} {order?.condition ? ( @@ -83,7 +83,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
{order?.recieverPostalCode ? ( - {"کد تحویل" + " " + order?.recieverPostalCode} + {window.t("کد تحویل") + " " + order?.recieverPostalCode} ) : null}

@@ -104,7 +104,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) { {window.t("مبلغ سبد خرید:")} - {order?.sumPrice + " " + "تومان"} + {order?.sumPrice + " " + window.t("تومان")}

) : null} @@ -116,7 +116,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) { {window.t("هزینه ارسال کالا:")} - {order?.transportPrice + " " + "تومان"} + {order?.transportPrice + " " + window.t("تومان")}
) : null} @@ -126,7 +126,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) { {window.t("جمع هزینه پرداختی:")} - {order?.payPrice + " " + "تومان"} + {order?.payPrice + " " + window.t("تومان")} ) : null} @@ -134,7 +134,6 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) {
- {" "} {window.t("شماره تراکنش:")} @@ -158,7 +157,7 @@ function OrderDetails({ order, setHeaderOptions, headerOptions, isMobile }) { const mapStateToProps = (state) => ({ isMobile: state.config.device === "mobile", - order: state.userFactor.selectedOrder + order: state.userFactor.selectedOrder, }); const mapDispatchToProps = { diff --git a/src/views/Orders/components/Order.js b/src/views/Orders/components/Order.js index 18f24ac..947d59f 100644 --- a/src/views/Orders/components/Order.js +++ b/src/views/Orders/components/Order.js @@ -27,7 +27,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
{order?.transactionId ? ( - {"شماره سفارش:" + " " + order?.transactionId} + {window.t("شماره سفارش:") + " " + order?.transactionId} ) : null} {order?.condition ? ( @@ -68,7 +68,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) {
{order?.followCode ? (
- {"کد تحویل:" + " " + order?.followCode} + {window.t("کد تحویل:") + " " + order?.followCode}
) : null}
@@ -81,7 +81,7 @@ function Order({ order, setDashboardPage, isDashboard, selectOrder }) { fontFamily: "bold", }} > - {"جمع فاکتور:" + " " + order?.payPrice} + {window.t("جمع فاکتور:") + " " + order?.payPrice} ) : null} {order?.payedAt ? ( - {"تاریخ سفارش:" + + {window.t("تاریخ سفارش:") + " " + moment(order?.payedAt)?.format("jYYYY/jMM/jDD")}{" "} diff --git a/src/views/Orders/index.js b/src/views/Orders/index.js index 269f904..f507dc5 100644 --- a/src/views/Orders/index.js +++ b/src/views/Orders/index.js @@ -40,7 +40,7 @@ function Orders({
) : ( navigation("/products")} /> diff --git a/src/views/Product/Desktop/ProductOverAll/index.js b/src/views/Product/Desktop/ProductOverAll/index.js index eb78751..6a05c41 100644 --- a/src/views/Product/Desktop/ProductOverAll/index.js +++ b/src/views/Product/Desktop/ProductOverAll/index.js @@ -60,7 +60,7 @@ export const ProductOverAll = ({ {book?.gradeId ? (
- {"پایه" + " " + grades[book?.gradeId]} + {window.t("پایه") + " " + grades[book?.gradeId]}
) : null} diff --git a/src/views/Product/index.js b/src/views/Product/index.js index 033bb13..30dda03 100644 --- a/src/views/Product/index.js +++ b/src/views/Product/index.js @@ -84,9 +84,8 @@ export const Product = ({ }, [userProducts, book]); useEffect(() => { - if(!isMobile){ + if (!isMobile) { setHeaderOptions(headerOptions); - } getInfo({ id: location.getId(), vod: true }); if (!isMobile) { @@ -157,7 +156,7 @@ export const Product = ({ {book?.rate ? (
  • - {book?.rate}
    امتیاز + {book?.rate}
    {window.t("امتیاز")}
  • ) : null} @@ -258,7 +257,10 @@ export const Product = ({
    ) : (
    - +
    )}