mahdi 2 years ago
parent 0ea04952a6
commit ade3753679
  1. 3
      src/views/Address/index.js
  2. 2
      src/views/Blogs/index.js
  3. 51
      src/views/Dashboard/layouts/Main/MyBooks/index.js
  4. 8
      src/views/Home/Portrait/Private/MyBooks/index.js

@ -307,7 +307,7 @@ export const Address = ({
<div className="flex flex-col w-full lg:w-1/2"> <div className="flex flex-col w-full lg:w-1/2">
<Input <Input
width="100%" width="100%"
label={window.t("مزیت رقابتی")} label={window.t("انتخاب آدرس ")}
regex={(val) => onInput.numberOnly(val)} regex={(val) => onInput.numberOnly(val)}
name="address" name="address"
onChange={(name, value) => setMapAddress(value)} onChange={(name, value) => setMapAddress(value)}
@ -545,7 +545,6 @@ export const Address = ({
fill={isDark ? "fill-white" : "fill-gray-600"} fill={isDark ? "fill-white" : "fill-gray-600"}
/> />
{!cityLoading ? ( {!cityLoading ? (
// <div>fdfds</div>
<Select <Select
selectProvince={"شهر"} selectProvince={"شهر"}
options={cities.map((e) => ({ value: e.id, name: e.name }))} options={cities.map((e) => ({ value: e.id, name: e.name }))}

@ -31,7 +31,7 @@ export const Blogs = ({ isMobile, getList, blogs, setHeaderOptions }) => {
<div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0"> <div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0">
<Hashtags /> <Hashtags />
<Single /> <Single />
<Header itle={window.t(" تازهترینها از وبلاگ")} /> <Header title={window.t(" تازهترینها از وبلاگ")} />
{isMobile ? ( {isMobile ? (
<div className="w-full flex overflow-x-scroll no-scrollbar gap-4"> <div className="w-full flex overflow-x-scroll no-scrollbar gap-4">
{blogs.map((blog, index) => ( {blogs.map((blog, index) => (

@ -1,15 +1,58 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Link } from "react-router-dom";
import Product from "../../../../../components/Product"; import Product from "../../../../../components/Product";
import ProductSuggestion from "../UserItems/ProductSuggestion"; import ProductSuggestion from "../UserItems/ProductSuggestion";
import { ScrollingCarousel } from "@trendyol-js/react-carousel";
import { Book } from "../../../../Home/Portrait/Private/MyBooks";
import Progress from "../../../../../components/Progress";
export const MyBooks = ({ books, grades, isMobile }) => { export const MyBooks = ({ books, grades, isMobile }) => {
const Book = ({ book }) => {
return (
<li className=" flex flex-col lg:ml-6 lg:p-2 lg:border lg:border-solid lg:border-green-200 lg:rounded-md lg:pt-4">
<Link to={"/products/" + book.id}>
<img
src={`https://dnvn.ir/api/v1/file/${book.fileIds}`}
alt=""
className="rounded-sm"
style={{
height: isMobile ? "" : "calc(100vh / 4)",
width: isMobile ? "" : "calc(100vh / 4 * 3 / 4)",
minHeight: isMobile ? "calc(100vh / 5)" : "",
minWidth: isMobile ? "calc(100vh / 5 * 3 / 4)" : "",
maxHeight: isMobile ? 100 : "",
maxWidth: isMobile ? 70 : "",
}}
/>
<h2 className="mt-2 text-tiny lg:text-tiny font-semibold text-blue5F dark:text-white lg:mt-4">
{book.name}
</h2>
<p className="font-medium text-green7B dark:text-greenBA text-sm lg:text-sm mt-2 lg:mt-2">{`پایه ${
grades[book.gradeId]
}`}</p>
<Progress percent={60} direction="float-right" />
</Link>
</li>
);
};
return ( return (
<div className="flex flex-1 flex-col"> <div className="flex flex-1 flex-col ">
<div className="flex flex-wrap gap-4 mb-5"> <div className="flex flex-wrap gap-4 mb-5 ">
{books.slice(0,1).map((product, index) => ( {/* {books.slice(0, 1).map((product, index) => (
<Product key={index} product={product} imageSize={5} /> <Product key={index} product={product} imageSdize={5} />
))} */}
<div className="w-full scrolling-carousel mt-4 pb-2">
<p className="text-green7B font-bold text-2xl lg:text-base">
کتاب های من
</p>
<ScrollingCarousel className="py-3">
{books?.map((book, index) => (
<Book book={book} key={index} />
))} ))}
</ScrollingCarousel>
</div>
</div> </div>
<ProductSuggestion products={books} grades={grades} isMobile={isMobile} /> <ProductSuggestion products={books} grades={grades} isMobile={isMobile} />
</div> </div>

@ -7,7 +7,7 @@ import Progress from "../../../../../components/Progress";
function MyBooks({ books, grades, isMobile }) { function MyBooks({ books, grades, isMobile }) {
const Book = ({ book }) => { const Book = ({ book }) => {
return ( return (
<li className="flex flex-col lg:ml-6 lg:p-2 lg:border lg:border-solid lg:border-green-200 lg:rounded-md lg:pt-4"> <li className=" flex flex-col lg:ml-6 lg:p-2 lg:border lg:border-solid lg:border-green-200 lg:rounded-md lg:pt-4">
<Link to={"/products/" + book.id}> <Link to={"/products/" + book.id}>
<img <img
src={`https://dnvn.ir/api/v1/file/${book.fileIds}`} src={`https://dnvn.ir/api/v1/file/${book.fileIds}`}
@ -19,7 +19,7 @@ function MyBooks({ books, grades, isMobile }) {
minHeight: isMobile ? "calc(100vh / 5)" : "", minHeight: isMobile ? "calc(100vh / 5)" : "",
minWidth: isMobile ? "calc(100vh / 5 * 3 / 4)" : "", minWidth: isMobile ? "calc(100vh / 5 * 3 / 4)" : "",
maxHeight: isMobile ? 100 : "", maxHeight: isMobile ? 100 : "",
maxWidth: isMobile ? 70 : "" maxWidth: isMobile ? 70 : "",
}} }}
/> />
<h2 className="mt-2 text-tiny lg:text-tiny font-semibold text-blue5F dark:text-white lg:mt-4"> <h2 className="mt-2 text-tiny lg:text-tiny font-semibold text-blue5F dark:text-white lg:mt-4">
@ -35,8 +35,8 @@ function MyBooks({ books, grades, isMobile }) {
}; };
return ( return (
<div className="px-4 mb-5 lg:mb-0" style={{maxWidth: '100%'}}> <div className="px-4 mb-5 lg:mb-0" style={{ maxWidth: "100%" }}>
<div className="w-full flex flex-col rounded-md pt-4 lg:py-5 px-2 lg:px-4 bg-blueC0 bg-opacity-5 border border-green-200 border-solid dark:bg-gray2077 dark:border-opacity-40 overflow-hidden"> <div className=" w-full flex flex-col rounded-md pt-4 lg:py-5 px-2 lg:px-4 bg-opacity-5 border border-green-200 border-solid dark:bg-gray2077 dark:border-opacity-40 overflow-hidden">
<strong className="text-green7B dark:text-white font-bold text-base lg:text-base mb-2"> <strong className="text-green7B dark:text-white font-bold text-base lg:text-base mb-2">
کتابهای من کتابهای من
</strong> </strong>

Loading…
Cancel
Save