diff --git a/public/index.html b/public/index.html index aa069f2..bb14fca 100644 --- a/public/index.html +++ b/public/index.html @@ -2,19 +2,19 @@ - + - + - + - React App + دانوین diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..16f7fd5 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/App.scss b/src/App.scss index 95cf680..4ba4d46 100644 --- a/src/App.scss +++ b/src/App.scss @@ -18,6 +18,10 @@ direction: rtl; } +.scrolling-carousel button{ + display: none; +} + @font-face { font-family: Black; src: url("./assets/font/IranSansX/Farsi/Black.ttf"); diff --git a/src/assets/icons/dropdown-blue.svg b/src/assets/icons/dropdown-blue.svg new file mode 100644 index 0000000..26e9ee6 --- /dev/null +++ b/src/assets/icons/dropdown-blue.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index 38d5dd1..f9d4f26 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -2,7 +2,7 @@ import React from "react"; import './index.css'; export default function Checkbox(props) { - console.log(props) + // console.log(props) return (
diff --git a/src/components/CourseChapter/index.js b/src/components/CourseChapter/index.js index d973b8b..df92b20 100644 --- a/src/components/CourseChapter/index.js +++ b/src/components/CourseChapter/index.js @@ -1,112 +1,160 @@ import React, { useState } from "react"; -import './index.css'; - -const CourseChapter = ({ chapters }) => { - const [selectedLesson, setSelectedLesson] = useState(null); +import { connect } from "react-redux"; +import { publicApi } from "../../redux/actions"; +import { toast } from "react-toastify"; +import "./index.css"; +const CourseChapter = ({ + playList, + seasons, + book, + grades, + selectedVideo, + userId, + setVideoActive, +}) => { + const duration = (value) => { + const minute = value % 60; + const hour = Math.round(value / 60); + return ( + (hour > 0 + ? (hour.toString().length === 1 ? "0" + hour.toString() : hour) + "" + : "") + + ":" + + (minute.toString().length === 1 ? "0" + minute.toString() : minute) + ); + }; return ( -
-
- {/* top */} -
-
-

سرفصل دوره

-
-
- علوم تجربی - پایه ششم -
+
+
+
+

سرفصل دوره

- {/* divider */} -
- {/* course title */} -
- {chapters.map((chapter, index) => ( -
-
-

{chapter.title}

- {chapter.duration} -
- {/* course lessons */} - {chapter.lessons.map((lesson, i) => ( +
+ {book?.name} + + {"پایه" + " " + grades[book?.gradeId]} + +
+
+ +
+
+ {/*

+ {(seasons.length > 0 && playList.length > 0) && + seasons?.filter((item) => item?.id === playList[0]?.categoryId)[0] + ?.name} +

*/} + {/* {video?.duration} */} +
+ {playList?.map((video, index) => ( +
+
+ {/* right div dot dot */}
- {/* right div dot dot */} + + + +
+ {/* left div content */} +
-
- -
- {/* left div content */} -
setSelectedLesson(lesson)} + onClick={() => + video?.isFreeVod || +userId === 140 + ? setVideoActive(video) + : toast.error("ابتدا محصول رو خریداری کن!") + } + disabled={true} > {/* top */} -
+

- {lesson.title} + {video?.name}

- {lesson.duration} + {duration(video?.duration)}
{/* divider */}
{/* bottom */} - {lesson.play} + پخش
- ))} +
))} -
- {/* blue left border */} - {/*
*/}
); }; -export default CourseChapter; +const mapStateToProps = (state) => ({ + selectedVideo: state.publicApi.selectedVideo, + seasons: state.publicApi.bookInfo?.categories, + book: state.publicApi.bookInfo, + grades: state.publicApi.grades, + // vods: state.publicApi.bookSection?.vods, + userId: state?.user?.status?.id, +}); + +const mapDispatchToProps = { + setVideoActive: publicApi.setVideoActive, +}; + +export default connect(mapStateToProps)(CourseChapter); CourseChapter.defaultProps = { chapters: [ diff --git a/src/components/Footer/Bazar.svg b/src/components/Footer/Bazar.svg new file mode 100644 index 0000000..b1f4dd5 --- /dev/null +++ b/src/components/Footer/Bazar.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/components/Footer/IOS.svg b/src/components/Footer/IOS.svg new file mode 100644 index 0000000..aef3093 --- /dev/null +++ b/src/components/Footer/IOS.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js index c836f52..7756b3e 100644 --- a/src/components/Footer/index.js +++ b/src/components/Footer/index.js @@ -1,59 +1,70 @@ import React from "react"; +import { Link } from "react-router-dom"; import _ from "lodash"; // import enamadlogo from './enamad-pic.svg'; -import callIcon from '../../assets/icons/vuesax-linear-call-calling.svg'; -import samandehi from './samandehi-pic.svg'; +import callIcon from "../../assets/icons/vuesax-linear-call-calling.svg"; +import samandehi from "./samandehi-pic.svg"; +import iosIcon from "./IOS.svg"; +import bazarIcon from "./Bazar.svg"; import lightBlueLine from "./light-blue-line.svg"; - - -const FooterDesign1 = ({ color, bg, links, hasHeader }) => { - +const FooterDesign1 = ({ color, bg, items, hasHeader }) => { const enamad = ''; return ( <> - {hasHeader ? -
+ {hasHeader ? ( +
+
+
+
+ +
+

+ 7 روز هفته{" "} + 24 ساعته +

+

+ منتظر شنیدن صدای گرمتان هستیم +

+
+
-
- -
-

- 7 روز هفته 24 ساعته -

-

منتظر شنیدن صدای گرمتان هستیم

+
+

654412 021

+

Info[at]danovin.ir

+
+
+
+ + + +
- -
-

654412 021

-

Info[at]danovin.ir

-
-
- : null} + ) : null}
-
- <> - { - links.map((section, index) =>
    - { - section.map((link, index) =>
  • - {link} -
  • ) - } -
) - } - +
+ {items.map((item, index) => ( +
+ {item.name} +
    + {item.links.map((link, index) => ( +
  • + + {link.name} + +
  • + ))} +
+
+ ))}
{ __html: enamad, }} className="w-28 p-2 rounded-md bg-gray-300 mx-6" - > - -
- + >
+
{/* line @@ -73,7 +86,6 @@ const FooterDesign1 = ({ color, bg, links, hasHeader }) => { alt="" className="hidden sm:block absolute bottom-5 left-20" /> */} -
); @@ -82,26 +94,71 @@ const FooterDesign1 = ({ color, bg, links, hasHeader }) => { export default FooterDesign1; FooterDesign1.defaultProps = { - links: [ - ["لینک های اصلی", "فروشگاه", "درباره ما", "پرسش های متوالی"], - [ - "خدمات مشتریان", - "شرایط و ضوابط استفاده", - " راهنمای خرید", - "همکاری تجاری" - ], - [ - "کاربری", - "حساب کاربری", - "سبد خرید", - "داشبورد کاربری" - ], - [ - "رضایت مشتریان", - "رسیدگی به شکایات", - "پیگیری سفارشات" - ], - + items: [ + { + name: "لینک‌های اصلی", + links: [ + { + name: "فروشگاه", + link: "/products", + }, + { + name: "درباره‌ما", + link: "/about-us", + }, + { + name: "پرسش‌های متداول", + link: "/faq", + }, + ], + }, + { + name: "خدمات مشتریان", + links: [ + { + name: "شرایط و ضوابط استفاده", + link: "#", + }, + { + name: "راهنمای خرید", + link: "#", + }, + { + name: "همکاری تجاری", + link: "#", + }, + ], + }, + { + name: "کاربری", + links: [ + { + name: "حساب کاربری", + link: "#", + }, + { + name: "سبد خرید", + link: "/cart", + }, + { + name: "داشبورد کاربری", + link: "/dashboard", + }, + ], + }, + { + name: "رضایت مشتریان", + links: [ + { + name: "رسیدگی به شکایات", + link: "/contact-us", + }, + { + name: "پیگیری سفارشات", + link: "/orders", + }, + ], + }, ], bg: "bg-white", color: "text-gray-600", diff --git a/src/components/Input/index.js b/src/components/Input/index.js index 7c3e46e..9201d8f 100644 --- a/src/components/Input/index.js +++ b/src/components/Input/index.js @@ -49,9 +49,10 @@ export default function Input(props) { return (
{/*