master
mahdi 2 years ago
parent fab86aa933
commit e7c2290b2a
  1. 15
      package.json
  2. 1
      src/App.scss
  3. 12
      src/assets/icons/filter-icon.svg
  4. 42
      src/components/LeafletMap/index.js
  5. 14
      src/components/Map/index.js
  6. 34
      src/views/Blog/index.js
  7. 2
      src/views/Blogs/layouts/New.js
  8. 1
      src/views/Blogs/layouts/Single.js
  9. 51
      src/views/Blogs/layouts/Target.js
  10. 34
      src/views/Contact/index.js
  11. 9
      src/views/Contact/layouts/Info.js
  12. 2
      src/views/Dashboard/layouts/Main/Addresses/index.js
  13. 82
      src/views/Products/layouts/Desktop/Main.js
  14. 6
      tailwind.config.js
  15. 39
      yarn.lock

@ -12,11 +12,13 @@
"axios": "^0.24.0", "axios": "^0.24.0",
"jalali-moment": "^3.3.10", "jalali-moment": "^3.3.10",
"jol-player": "^2.5.0", "jol-player": "^2.5.0",
"leaflet": "^1.8.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mapir-react-component": "^2.0.1", "mapir-react-component": "^2.0.1",
"react": "^17.0.2", "react": "^18.2.0",
"react-dom": "^17.0.2", "react-dom": "^18.2.0",
"react-indiana-drag-scroll": "^2.1.0", "react-indiana-drag-scroll": "^2.1.0",
"react-leaflet": ">=3.1.0 <3.2.0 || ^3.2.1",
"react-modern-drawer": "^1.0.1", "react-modern-drawer": "^1.0.1",
"react-qr-reader": "^2.2.1", "react-qr-reader": "^2.2.1",
"react-redux": "^7.2.6", "react-redux": "^7.2.6",
@ -45,18 +47,11 @@
"react-app/jest" "react-app/jest"
] ]
}, },
"browserslist": { "browserslist":[
"production": [
">0.2%", ">0.2%",
"not dead", "not dead",
"not op_mini all" "not op_mini all"
], ],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": { "devDependencies": {
"autoprefixer": "^9.8.8", "autoprefixer": "^9.8.8",
"postcss": "^7.0.39", "postcss": "^7.0.39",

@ -1,4 +1,3 @@
@import "./constants/size.scss"; @import "./constants/size.scss";
@import "./constants/colors.scss"; @import "./constants/colors.scss";
@import "./views/Home/Landscape/Page1/index.scss"; @import "./views/Home/Landscape/Page1/index.scss";

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g id="vuesax_linear_filter-tick" data-name="vuesax/linear/filter-tick" transform="translate(-620 -700)">
<g id="filter-tick">
<path id="Vector" d="M9.5,4.75A4.678,4.678,0,0,1,8.82,7.2,4.735,4.735,0,0,1,4.75,9.5a4.62,4.62,0,0,1-2.56-.77A4.481,4.481,0,0,1,.69,7.2,4.686,4.686,0,0,1,0,4.75,4.754,4.754,0,0,1,4.75,0,4.421,4.421,0,0,1,5.79.12,4.74,4.74,0,0,1,9.5,4.75Z" transform="translate(632.13 710)" fill="none" stroke="#06bace" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,1.17,1.17,2.34,3.7,0" transform="translate(635.03 713.58)" fill="none" stroke="#06bace" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(644 724) rotate(180)" fill="none" opacity="0"/>
<g id="Group">
<path id="Vector-4" data-name="Vector" d="M17.38,2.02V4.24a3.825,3.825,0,0,1-1.01,2.33L14.61,8.12A4.421,4.421,0,0,0,13.57,8a4.754,4.754,0,0,0-4.75,4.75,4.686,4.686,0,0,0,.69,2.45,4.481,4.481,0,0,0,1.5,1.53v.34a2.23,2.23,0,0,1-.91,1.72l-1.41.91a2.058,2.058,0,0,1-3.13-1.72V12.63a3.91,3.91,0,0,0-.81-2.12L.91,6.47A3.407,3.407,0,0,1,0,4.45V2.12A2.051,2.051,0,0,1,2.02,0H15.36A2.027,2.027,0,0,1,17.38,2.02Z" transform="translate(623.31 702)" fill="none" stroke="#06bace" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,42 @@
import React from "react";
import { MapContainer, TileLayer, Popup, Marker } from "react-leaflet";
import "leaflet/dist/leaflet.css";
import L from "leaflet";
import icon from "leaflet/dist/images/marker-icon.png";
import iconShadow from "leaflet/dist/images/marker-shadow.png";
const bounds = [
[35.7020226, 51.4281064],
[35.7020226, 51.4281064],
];
let DefaultIcon = L.icon({
iconUrl: icon,
shadowUrl: iconShadow,
});
L.Marker.prototype.options.icon = DefaultIcon;
const LeafletMap = () => {
return (
<MapContainer
center={[35.7020226, 51.4281064]}
zoom={15}
scrollWheelZoom={false}
style={{ width: "100%", height: "99%" }}
>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Marker position={[35.7020226, 51.4281064]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</MapContainer>
);
};
export default LeafletMap;

@ -15,21 +15,23 @@ const Map = Mapir.setToken({
export default function location() { export default function location() {
return ( return (
<>
{" "}
<Mapir <Mapir
userLocation={true} userLocation={true}
Map={Map} Map={Map}
anchor="bottom"
className="marker"
apiKey={ apiKey={
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIn0.eyJhdWQiOiIxNDc1OSIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIiwiaWF0IjoxNjI1NjY2NzI2LCJuYmYiOjE2MjU2NjY3MjYsImV4cCI6MTYyODI1ODcyNiwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.OIjSLWyNCGALY2C0EFDGPEEUbPqOxL6GxCDkeX1B5C218eTk0qkmlGs8z4E87Y-qL7_PG814UZwcngjdRybVwabMtgfHsJj7DRDtrdBzCW7HRlJXqrSRG7xOuJmFhcn4-HtXRQUOEUn8quQukXPek8zvMtRBoMNsefS5s6es2oAg7Fmv0o5T2uZyDzMnRAfrTb1SKtv52Q_yXWYPtQNZdZcwe9Ed-ZkGeAXuTY2tafow92Oq8mmRxrzaq9Ne3gtu98UqXA3rwzRaQ1ToXU_Tcjh5UCVS6hZAzhI-GQk7KfrLbOOyDCxfd9v7_qXnIkRR6dd3bZ69H-jvlytaxMl51Q" "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIn0.eyJhdWQiOiIxNDc1OSIsImp0aSI6IjliNzIxYmZhZDZlMGI3MzYxMzFiMTMyNjEyZDQ1M2E3ZDg4YTEzMjc2ZDUyYTA5ZDNmOThiNWFjZTM1NDZlMmMwZDU2M2Y5YzY3N2U0NGFhIiwiaWF0IjoxNjI1NjY2NzI2LCJuYmYiOjE2MjU2NjY3MjYsImV4cCI6MTYyODI1ODcyNiwic3ViIjoiIiwic2NvcGVzIjpbImJhc2ljIl19.OIjSLWyNCGALY2C0EFDGPEEUbPqOxL6GxCDkeX1B5C218eTk0qkmlGs8z4E87Y-qL7_PG814UZwcngjdRybVwabMtgfHsJj7DRDtrdBzCW7HRlJXqrSRG7xOuJmFhcn4-HtXRQUOEUn8quQukXPek8zvMtRBoMNsefS5s6es2oAg7Fmv0o5T2uZyDzMnRAfrTb1SKtv52Q_yXWYPtQNZdZcwe9Ed-ZkGeAXuTY2tafow92Oq8mmRxrzaq9Ne3gtu98UqXA3rwzRaQ1ToXU_Tcjh5UCVS6hZAzhI-GQk7KfrLbOOyDCxfd9v7_qXnIkRR6dd3bZ69H-jvlytaxMl51Q"
} }
center={[51.401464, 35.700815]} center={[51.401464, 35.700815]}
> >
<Mapir.Marker <Mapir.Marker
coordinates={[51.401464,35.700815 ]} coordinates={[35.7020089, 51.4281546]}
anchor="top" anchor="bottom"
// Image={blueMark}
style={{width:20, height: 20}}
className="marker"
></Mapir.Marker> ></Mapir.Marker>
</Mapir> </Mapir>{" "}
</>
); );
} }

@ -9,6 +9,7 @@ import Header from "../Blogs/layouts/Header";
import Suggest from "../Blogs/layouts/Suggest"; import Suggest from "../Blogs/layouts/Suggest";
import New from "../Blogs/layouts/New"; import New from "../Blogs/layouts/New";
import Avatar from "../../components/Avatar"; import Avatar from "../../components/Avatar";
import moment from "jalali-moment";
//assets //assets
import arrow from "../../assets/icons/dropdown-blue.svg"; import arrow from "../../assets/icons/dropdown-blue.svg";
@ -30,6 +31,8 @@ export const Blog = ({
getInfo({ id }); getInfo({ id });
}, [id]); }, [id]);
console.log(blog);
return blogs?.length ? ( return blogs?.length ? (
<div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-10 pb-24"> <div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-10 pb-24">
<div <div
@ -46,30 +49,33 @@ export const Blog = ({
<div className="flex flex-col justify-end bg-gradient-to-t from-black absolute top-0 left-0 z-10 w-full h-full pb-2 px-2"> <div className="flex flex-col justify-end bg-gradient-to-t from-black absolute top-0 left-0 z-10 w-full h-full pb-2 px-2">
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex">
<Avatar size={40} /> {!blog?.author.picFileId && <Avatar size={40} />}
{/* {!blog?.author.picFileId && <Avatar size={40} />}
{blog?.author.picFileId && ( {blog?.author.picFileId && (
<img <img
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`}
alt="author" alt="author"
className="w-20 rounded" className="w-20 rounded"
/> />
)} */} )}
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="text-gray-300 text-tiny font-bold bg-red-400 p-2"> <strong className="text-gray-300 text-tiny font-bold">
{window.t("نوشته از:" + " " + "کامران ایزدی")} {window.t("نوشته از:") + " " + blog?.author?.name}
</strong> </strong>
<p className="text-gray-300 mt-2 text-xs"> <p className="text-gray-300 mt-2 text-xs">
{window.t("سردبیر بخش وبلاگ دانوین")} {blog?.author.role}
</p> </p>
</div> </div>
</div> </div>
<div className="flex flex-col justify-center items-end"> <div className="flex flex-col justify-center items-end">
<span className="text-gray-300 text-sm"> <span className="text-gray-300 text-sm">
{window.t("زمان مطالعه" + " " + "۳۰ دقیقه")} {window.t("زمان مطالعه:") +
" " +
`${blog?.duration}` +
" " +
window.t("دقیقه")}
</span> </span>
<span className="mt-2 text-gray-300 text-sm font-bold"> <span className="mt-2 text-gray-300 text-sm font-bold">
{window.t("1400/11/24")} {moment(blog?.updatedAt).locale("fa").format("YYYY/MM/DD")}
</span> </span>
</div> </div>
</div> </div>
@ -98,19 +104,23 @@ export const Blog = ({
<Avatar size={60} /> <Avatar size={60} />
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-base lg:font-black text-gray1"> <strong className="lg:text-base lg:font-black text-gray1">
{window.t("نوشته از:" + " " + "کامران ایزدی")} {window.t("نوشته از:") + " " + blog?.author?.name}
</strong> </strong>
<p className="lg:text-sm lg:font-semibold text-gray70 mt-2"> <p className="lg:text-sm lg:font-semibold text-gray70 mt-2">
{window.t("سردبیر بخش وبلاگ دانوین")} {blog?.author.role}
</p> </p>
</div> </div>
</div> </div>
<div className="flex flex-col justify-center items-end"> <div className="flex flex-col justify-center items-end">
<span className="lg:text-tiny text-gray1 lg:font-black"> <span className="lg:text-tiny text-gray1 lg:font-black">
{window.t("زمان مطالعه" + " " + "۳۰ دقیقه")} {window.t("زمان مطالعه:") +
" " +
`${blog?.duration}` +
" " +
window.t("دقیقه")}
</span> </span>
<span className="mt-2 lg:text-tiny text-gray1 lg:font-black"> <span className="mt-2 lg:text-tiny text-gray1 lg:font-black">
{window.t("1400/11/24")} {moment(blog?.updatedAt).locale("fa").format("YYYY/MM/DD")}
</span> </span>
</div> </div>
</div> </div>

@ -29,7 +29,7 @@ export const New = ({ blog, isMobile, setActive }) => {
</strong> </strong>
<div <div
className="text-tiny leading-5 lg:leading-7 mb-3 dark:text-gray-200 p-2 text-justify" className="text-tiny leading-5 lg:leading-7 mb-3 dark:text-gray-200 p-2 line-clamp-3"
dangerouslySetInnerHTML={{ __html: blog?.text }} dangerouslySetInnerHTML={{ __html: blog?.text }}
/> />
<div className="w-full hidden lg;flex justify-between"> <div className="w-full hidden lg;flex justify-between">

@ -60,7 +60,6 @@ export const Single = ({ blog, isMobile }) => {
<h1 className="lg:text-5xl font-bold leading-6 dark:text-gray-200"> <h1 className="lg:text-5xl font-bold leading-6 dark:text-gray-200">
{blog?.title} {blog?.title}
</h1> </h1>
<div <div
className="text-tiny leading-6 lg:text-tiny text-gray70 dark:text-gray-200 lg:w-4/5 mt-4 lg:mt-6 lg:leading-7" className="text-tiny leading-6 lg:text-tiny text-gray70 dark:text-gray-200 lg:w-4/5 mt-4 lg:mt-6 lg:leading-7"
dangerouslySetInnerHTML={{ __html: blog?.text }} dangerouslySetInnerHTML={{ __html: blog?.text }}

@ -2,11 +2,12 @@ import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import Avatar from "../../../components/Avatar"; import Avatar from "../../../components/Avatar";
import moment from "jalali-moment";
export const Target = ({ blogs, isMobile }) => { export const Target = ({ blogs, isMobile }) => {
const Large = ({ blog }) => { const Large = ({ blog }) => {
return isMobile ? ( return isMobile ? (
<div className="flex flex-col w-full"> <div className="flex flex-col w-full mb-10">
<div <div
className="relative w-full rounded-md overflow-hidden" className="relative w-full rounded-md overflow-hidden"
style={{ height: "calc(100vh / 4.5)" }} style={{ height: "calc(100vh / 4.5)" }}
@ -23,22 +24,33 @@ export const Target = ({ blogs, isMobile }) => {
</strong> </strong>
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex">
<Avatar size={45} /> {!blog?.author.picFileId && <Avatar size={60} />}
{blog?.author.picFileId && (
<img
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`}
alt="author"
className="w-20 rounded"
/>
)}
<div className="flex flex-col py-1 mr-1 justify-center"> <div className="flex flex-col py-1 mr-1 justify-center">
<strong className="text-opacity-75 text-tiny text-black dark:text-gray-200"> <strong className="text-opacity-75 text-tiny text-black dark:text-gray-200">
{window.t("نوشته از:" + " " + "کامران ایزدی")} {window.t("نوشته از:" + " " + `${blog?.author.name}`)}
</strong> </strong>
<p className="text-black text-sm text-opacity-75 mt-2 dark:text-gray-200"> <p className="text-black text-sm text-opacity-75 mt-2 dark:text-gray-200">
{window.t("سردبیر بخش وبلاگ دانوین")} {blog?.author.role}
</p> </p>
</div> </div>
</div> </div>
<div className="flex flex-col i justify-center items-end"> <div className="flex flex-col i justify-center items-end">
<span className="text-gray1 text-sm dark:text-gray-200"> <span className="lg:text-tiny text-gray1 lg:font-black">
{window.t("زمان مطالعه" + " " + "۳۰ دقیقه")} {window.t("زمان مطالعه:") +
" " +
`${blog?.duration}` +
" " +
window.t("دقیقه")}
</span> </span>
<span className="mt-2 text-gray1 text-sm dark:text-gray-200"> <span className="mt-3 lg:text-tiny text-gray1 lg:font-black">
{window.t("1400/11/24")} {moment(blog?.updatedAt).locale("fa").format("YYYY/MM/DD")}
</span> </span>
</div> </div>
</div> </div>
@ -60,13 +72,20 @@ export const Target = ({ blogs, isMobile }) => {
</strong> </strong>
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex">
<Avatar size={60} /> {!blog?.author.picFileId && <Avatar size={60} />}
{blog?.author.picFileId && (
<img
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`}
alt="author"
className="w-20 rounded"
/>
)}
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-tiny lg:font-black text-opacity-75 text-white"> <strong className="lg:text-tiny lg:font-black text-opacity-75 text-white">
{window.t("نوشته از:" + " " + "کامران ایزدی")} {window.t("نوشته از:" + " " + `${blog?.author.name}`)}
</strong> </strong>
<p className="lg:text-sm lg:font-semibold text-white text-opacity-75 mt-2"> <p className="lg:text-sm lg:font-semibold text-white text-opacity-75 mt-2">
{window.t("سردبیر بخش وبلاگ دانوین")} {blog?.author.role}
</p> </p>
</div> </div>
</div> </div>
@ -103,11 +122,11 @@ export const Target = ({ blogs, isMobile }) => {
<strong className="lg:font-bold lg:text-lg text-tiny my-2 leading-5 dark:text-gray-200"> <strong className="lg:font-bold lg:text-lg text-tiny my-2 leading-5 dark:text-gray-200">
{blog?.title} {blog?.title}
</strong> </strong>
<p className="lg:w-4/5 text-gray70 lg:text-tiny text-tiny leading-5 lg:leading-6 dark:text-gray-200">
{window.t( <div
"هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس میزند در نهایت این مرگ" className="lg:w-4/5 text-gray70 lg:text-tiny text-tiny leading-5 lg:leading-6 dark:text-gray-200 text-justify"
)} dangerouslySetInnerHTML={{ __html: blog?.text }}
</p> />
</div> </div>
</Link> </Link>
))} ))}

@ -6,7 +6,7 @@ import Ticket from "./layouts/Ticket";
import Header from "../Activation/components/Header"; import Header from "../Activation/components/Header";
import NotFound from "../Faq/components/NotFound"; import NotFound from "../Faq/components/NotFound";
import Info from "./layouts/Info"; import Info from "./layouts/Info";
import Map from "../../components/Map"; import LeafletMap from "../../components/LeafletMap";
import Divider from "../../components/Divider"; import Divider from "../../components/Divider";
//assets //assets
@ -26,10 +26,7 @@ function Contact({ headerOptions, setHeaderOptions, info, isMobile, isDark }) {
}, []); }, []);
return ( return (
<div <div className="w-full flex h-auto flex-col bg-transparent lg:pt-36 lg:pb-24">
className="w-full flex h-auto flex-col bg-transparent lg:pt-36 lg:pb-24"
// style={{ height: "calc(100vh - 140px)" }}
>
<Header <Header
bg={isMobile ? contactBgImage : desktopContactBgImage} bg={isMobile ? contactBgImage : desktopContactBgImage}
title={window.t("تماس با ما")} title={window.t("تماس با ما")}
@ -69,7 +66,7 @@ function Contact({ headerOptions, setHeaderOptions, info, isMobile, isDark }) {
className="w-1/3 rounded-md overflow-hidden" className="w-1/3 rounded-md overflow-hidden"
style={{ height: "400px" }} style={{ height: "400px" }}
> >
<Map /> <LeafletMap />
</div> </div>
</div> </div>
)} )}
@ -96,13 +93,14 @@ Contact.defaultProps = {
text: window.t( text: window.t(
"همکاران ما در قسمت فروش و پشتیبانی، پاسخگوی شما هستند هر سوالی در مورد کتابهای ما داشتید بپرسید" "همکاران ما در قسمت فروش و پشتیبانی، پاسخگوی شما هستند هر سوالی در مورد کتابهای ما داشتید بپرسید"
), ),
tel: null,
color: "#766600", color: "#766600",
}, },
link: { // link: {
title: window.t("ارتباط با بخش پشتیبانی"), // title: window.t("ارتباط با بخش پشتیبانی"),
link: "/support", // link: "/support",
color: "#766600", // color: "#766600",
}, // },
bg: "#D3B70222", bg: "#D3B70222",
borderColor: "#D3B70255", borderColor: "#D3B70255",
}, },
@ -111,8 +109,9 @@ Contact.defaultProps = {
title: { text: window.t("شماره تماس"), color: "#06A02A" }, title: { text: window.t("شماره تماس"), color: "#06A02A" },
description: { description: {
text: window.t( text: window.t(
"در صورت هرگونه سوال شما میتوانید در ساعات اداری 9 الی 17 با شماره ۰۲۱۸۸۸۱۴۶۳۷ تماس حاصل فرمایید" "در صورت هرگونه سوال شما میتوانید در ساعات اداری 9 الی 17 با شماره 58795 تماس حاصل فرمایید"
), ),
tel: "58795",
color: "#025816", color: "#025816",
}, },
link: null, link: null,
@ -126,13 +125,14 @@ Contact.defaultProps = {
text: window.t( text: window.t(
"نشانی دفتر مرکزی: تهران میدان فردوسی خیابان عباس موسوی پلاک 30" "نشانی دفتر مرکزی: تهران میدان فردوسی خیابان عباس موسوی پلاک 30"
), ),
tel: null,
color: "#066A5C", color: "#066A5C",
}, },
link: { // link: {
title: window.t("لیست نمایندگیهای فروش"), // title: window.t("لیست نمایندگیهای فروش"),
link: "/sell", // link: "/sell",
color: "#0A7769", // color: "#0A7769",
}, // },
bg: "#0A776922", bg: "#0A776922",
borderColor: "#0A776955", borderColor: "#0A776955",
}, },

@ -11,7 +11,16 @@ function Info({ info, isDark }) {
border: `1px solid ${info.borderColor}`, border: `1px solid ${info.borderColor}`,
}} }}
> >
{info.description.tel !== null ? (
<a
href={`tel:${info.description.tel}`}
className={`text-sm text-primaryText`}
>
<img src={info.icon} alt="" />
</a>
) : (
<img src={info.icon} alt="" /> <img src={info.icon} alt="" />
)}
<div className="flex flex-col flex-1 mr-3"> <div className="flex flex-col flex-1 mr-3">
<strong className="text-base" style={{ color: info.title.color }}> <strong className="text-base" style={{ color: info.title.color }}>
{info.title.text} {info.title.text}

@ -69,7 +69,7 @@ const ProfileAddress = ({
}} }}
> >
&nbsp; &nbsp;
{window.t("یک آدرس جدید اضافه کنید")} {window.t("یک آدرس جfdsدید اضافه کنید")}
<strong className="text-lg transform translate-y-0.5 mr-1">+</strong> <strong className="text-lg transform translate-y-0.5 mr-1">+</strong>
</button> </button>
</div> </div>

@ -12,6 +12,7 @@ import { book, publicApi } from "../../../../redux/actions";
import moment from "jalali-moment"; import moment from "jalali-moment";
import dropdownIcon from "../../../../assets/icons/dropdown-blue.svg"; import dropdownIcon from "../../../../assets/icons/dropdown-blue.svg";
import filter from "../../../../assets/icons/filter-icon.svg";
const num = 6; const num = 6;
export const Main = ({ export const Main = ({
@ -20,7 +21,7 @@ export const Main = ({
sortMethods, sortMethods,
filterOptions, filterOptions,
setFilterOptions, setFilterOptions,
useless useless,
}) => { }) => {
const [filterLoading, setFilterLoading] = useState(false); const [filterLoading, setFilterLoading] = useState(false);
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
@ -33,17 +34,21 @@ export const Main = ({
useEffect(() => { useEffect(() => {
if (books?.length) { if (books?.length) {
setTotal(books.length); setTotal(books.length);
window.scroll({ top: 0, behavior: "smooth" });
} }
}, [books]); }, [books]);
const Items = React.useCallback((type) => { const Items = React.useCallback(
(type) => {
const { grade, subject, available, sort, productType } = filterOptions; const { grade, subject, available, sort, productType } = filterOptions;
let byGradeFilter; let byGradeFilter;
let bySubjectFilter; let bySubjectFilter;
let byAvailableFilter; let byAvailableFilter;
let bySortFilter; let bySortFilter;
if (grade) { if (grade) {
byGradeFilter = books?.filter((book) => grades[book?.gradeId] === grade); byGradeFilter = books?.filter(
(book) => grades[book?.gradeId] === grade
);
} else { } else {
byGradeFilter = books; byGradeFilter = books;
} }
@ -61,7 +66,8 @@ export const Main = ({
if (available) { if (available) {
byAvailableFilter = bySubjectFilter?.filter( byAvailableFilter = bySubjectFilter?.filter(
(book) => (book) =>
book.product?.find((product) => product?.productType === type)?.price book.product?.find((product) => product?.productType === type)
?.price
); );
} else { } else {
byAvailableFilter = bySubjectFilter; byAvailableFilter = bySubjectFilter;
@ -70,13 +76,15 @@ export const Main = ({
if (sort === window.t("ارزان ترین")) { if (sort === window.t("ارزان ترین")) {
bySortFilter = byAvailableFilter?.sort( bySortFilter = byAvailableFilter?.sort(
(a, b) => (a, b) =>
a.product?.find((product) => product?.productType === type)?.price - a.product?.find((product) => product?.productType === type)
?.price -
b.product?.find((product) => product?.productType === type)?.price b.product?.find((product) => product?.productType === type)?.price
); );
} else if (sort === window.t("محبوب ترین")) { } else if (sort === window.t("محبوب ترین")) {
bySortFilter = byAvailableFilter?.sort( bySortFilter = byAvailableFilter?.sort(
(a, b) => (a, b) =>
a.product?.find((product) => product?.productType === type)?.rate - a.product?.find((product) => product?.productType === type)
?.rate -
b.product?.find((product) => product?.productType === type)?.rate b.product?.find((product) => product?.productType === type)?.rate
); );
} else if (sort === window.t("جدیدترین")) { } else if (sort === window.t("جدیدترین")) {
@ -90,7 +98,9 @@ export const Main = ({
bySortFilter = byAvailableFilter; bySortFilter = byAvailableFilter;
} }
return bySortFilter; return bySortFilter;
},[books, filterOptions, grades]); },
[books, filterOptions, grades]
);
const elements = React.useMemo(() => { const elements = React.useMemo(() => {
return Items(2); return Items(2);
@ -115,63 +125,7 @@ export const Main = ({
> >
<div className="flex w-full bg-blue rounded-lg border border-solid border-gray-200 p-2 items-center my-1.5 justify-center text-blue52"> <div className="flex w-full bg-blue rounded-lg border border-solid border-gray-200 p-2 items-center my-1.5 justify-center text-blue52">
<div className="flex text-sm items-center mr-2 ml-4"> <div className="flex text-sm items-center mr-2 ml-4">
<svg <img src={filter} className="w-5" alt="filter" />
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<g
id="vuesax_linear_filter-tick"
data-name="vuesax/linear/filter-tick"
transform="translate(-620 -700)"
>
<g id="filter-tick">
<path
id="Vector"
d="M9.5,4.75A4.678,4.678,0,0,1,8.82,7.2,4.735,4.735,0,0,1,4.75,9.5a4.62,4.62,0,0,1-2.56-.77A4.481,4.481,0,0,1,.69,7.2,4.686,4.686,0,0,1,0,4.75,4.754,4.754,0,0,1,4.75,0,4.421,4.421,0,0,1,5.79.12,4.74,4.74,0,0,1,9.5,4.75Z"
transform="translate(632.13 710)"
fill="none"
stroke="rgba(6, 186, 206"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
<path
id="Vector-2"
data-name="Vector"
d="M0,1.17,1.17,2.34,3.7,0"
transform="translate(635.03 713.58)"
fill="none"
stroke="rgba(6, 186, 206"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
<path
id="Vector-3"
data-name="Vector"
d="M0,0H24V24H0Z"
transform="translate(644 724) rotate(180)"
fill="none"
opacity="0"
/>
<g id="Group">
<path
id="Vector-4"
data-name="Vector"
d="M17.38,2.02V4.24a3.825,3.825,0,0,1-1.01,2.33L14.61,8.12A4.421,4.421,0,0,0,13.57,8a4.754,4.754,0,0,0-4.75,4.75,4.686,4.686,0,0,0,.69,2.45,4.481,4.481,0,0,0,1.5,1.53v.34a2.23,2.23,0,0,1-.91,1.72l-1.41.91a2.058,2.058,0,0,1-3.13-1.72V12.63a3.91,3.91,0,0,0-.81-2.12L.91,6.47A3.407,3.407,0,0,1,0,4.45V2.12A2.051,2.051,0,0,1,2.02,0H15.36A2.027,2.027,0,0,1,17.38,2.02Z"
transform="translate(623.31 702)"
fill="none"
stroke="rgba(6, 186, 206"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</g>
</g>
</g>
</svg>
<span className="text-tiny text-greenBA font-bold"> <span className="text-tiny text-greenBA font-bold">
{window.t("مرتب سازی") + "" + ":"} {window.t("مرتب سازی") + "" + ":"}
</span> </span>

@ -1,7 +1,5 @@
module.exports = { module.exports = {
content: [ content: ["./src/**/*.{js,jsx,ts,tsx}"],
"./src/**/*.{js,jsx,ts,tsx}",
],
darkMode: "class", // or 'media' or 'class' darkMode: "class", // or 'media' or 'class'
theme: { theme: {
backgroundColor: (theme) => ({ backgroundColor: (theme) => ({
@ -71,14 +69,12 @@ module.exports = {
gray45: "#454545", gray45: "#454545",
red19: "#C01919", red19: "#C01919",
greenB9: "#80B918", greenB9: "#80B918",
}), }),
fill: (theme) => ({ fill: (theme) => ({
...theme("colors"), ...theme("colors"),
blueC0: "#196EC0", blueC0: "#196EC0",
grayDF: "#DFDFDF", grayDF: "#DFDFDF",
greenBA: "#06BACE", greenBA: "#06BACE",
}), }),
fontSize: { fontSize: {
xs: "clamp(9px, 2.78vw, 11px)", xs: "clamp(9px, 2.78vw, 11px)",

@ -1520,6 +1520,11 @@
schema-utils "^2.6.5" schema-utils "^2.6.5"
source-map "^0.7.3" source-map "^0.7.3"
"@react-leaflet/core@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@react-leaflet/core/-/core-1.1.1.tgz#827fd05bb542cf874116176d8ef48d5b12163f81"
integrity sha512-7PGLWa9MZ5x/cWy8EH2VzI4T8q5WpuHbixzCDXqixP/WyqwIrg5NDUPgYuFnB4IEIZF+6nA265mYzswFo/h1Pw==
"@rollup/plugin-node-resolve@^7.1.1": "@rollup/plugin-node-resolve@^7.1.1":
version "7.1.3" version "7.1.3"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz" resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz"
@ -7305,6 +7310,11 @@ last-call-webpack-plugin@^3.0.0:
lodash "^4.17.5" lodash "^4.17.5"
webpack-sources "^1.1.0" webpack-sources "^1.1.0"
leaflet@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.8.0.tgz#4615db4a22a304e8e692cae9270b983b38a2055e"
integrity sha512-gwhMjFCQiYs3x/Sf+d49f10ERXaEFCPr+nVTryhAW8DWbMGqJqt9G4XuIaHmFW08zYvhgdzqXGr8AlW8v8dQkA==
leven@^3.1.0: leven@^3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz"
@ -9681,6 +9691,14 @@ react-dom@^17.0.2:
object-assign "^4.1.1" object-assign "^4.1.1"
scheduler "^0.20.2" scheduler "^0.20.2"
react-dom@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
scheduler "^0.23.0"
react-error-overlay@^6.0.9: react-error-overlay@^6.0.9:
version "6.0.10" version "6.0.10"
resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz" resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.10.tgz"
@ -9705,6 +9723,13 @@ react-is@^17.0.1, react-is@^17.0.2:
resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
"react-leaflet@>=3.1.0 <3.2.0 || ^3.2.1":
version "3.2.5"
resolved "https://registry.yarnpkg.com/react-leaflet/-/react-leaflet-3.2.5.tgz#bec0bfab9dd8c2b030ea630f7a0687a60322ca7d"
integrity sha512-Z3KZ+4SijsRbbrt2I1a3ZDY6+V6Pm91eYTdxTN18G6IOkFRsJo1BuSPLFnyFrlF3WDjQFPEcTPkEgD1VEeAoBg==
dependencies:
"@react-leaflet/core" "^1.1.1"
react-mapbox-gl-draw@^2.0.4: react-mapbox-gl-draw@^2.0.4:
version "2.0.4" version "2.0.4"
resolved "https://registry.npmjs.org/react-mapbox-gl-draw/-/react-mapbox-gl-draw-2.0.4.tgz" resolved "https://registry.npmjs.org/react-mapbox-gl-draw/-/react-mapbox-gl-draw-2.0.4.tgz"
@ -9874,6 +9899,13 @@ react@^17.0.2:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"
react@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
read-pkg-up@^7.0.1: read-pkg-up@^7.0.1:
version "7.0.1" version "7.0.1"
resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz"
@ -10416,6 +10448,13 @@ scheduler@^0.20.2:
loose-envify "^1.1.0" loose-envify "^1.1.0"
object-assign "^4.1.1" object-assign "^4.1.1"
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
schema-utils@^1.0.0: schema-utils@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz" resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz"

Loading…
Cancel
Save