diff --git a/src/views/Courses/index.scss b/src/views/Courses/index.scss
index 1e764a3..487d6ea 100644
--- a/src/views/Courses/index.scss
+++ b/src/views/Courses/index.scss
@@ -4,14 +4,29 @@
position: relative;
main {
margin-top: 30px;
+ h3{
+ margin-top : 100px;
+ text-align: center;
+ color: $gray5;
+ transition: all 0.5s;
+ opacity: 0;
+ transform : translateY(-50px);
+ }
header {
}
}
+ &-notFound{
+ opacity: 1 !important;
+ transform: translateY(0px) !important;
+ }
}
@media screen and (min-width: 1441px) {
.courses {
main {
+ h3{
+ font-size: 21px;
+ }
max-width: 700px;
}
}
@@ -20,6 +35,9 @@
@media screen and (min-width: 1008px) and (max-width: 1440px) {
.courses {
main {
+ h3{
+ font-size: calc(100vw / 70);
+ }
max-width: 700px;
}
}
@@ -28,6 +46,11 @@
@media screen and (min-width: 641px) and (max-width: 1007px) {
.courses {
main {
+ h3{
+ margin-top : 100px;
+ text-align: center;
+ font-size: calc(100vw / 45);
+ }
max-width: 500px;
margin-top: 10px;
}
@@ -37,6 +60,11 @@
@media screen and (max-width: 640px) {
.courses {
main {
+ h3{
+ margin-top : 100px;
+ text-align: center;
+ font-size: calc(100vw / 27);
+ }
max-width: 500px;
margin-top: 10px;
padding: 0px 10px;
diff --git a/src/views/Courses/index.tsx b/src/views/Courses/index.tsx
index 439eeb0..7c1145b 100644
--- a/src/views/Courses/index.tsx
+++ b/src/views/Courses/index.tsx
@@ -5,42 +5,86 @@ import { book } from "../../redux/actions";
import { connect } from "react-redux";
import location from "../../util/location";
import Course from "./Course";
+import HomeSearchBox from "../../components/HomeSearchBox";
import BreadCrumbs from "../../components/BreadCrumbs";
import Loader from "../../components/Loader";
+import Vocal from "../../components/Vocal/Vocal";
+import { info } from "console";
-function Courses({ getList, list, selectedMenu, loading }: any) {
+function Courses({
+ getList,
+ list,
+ selectedMenu,
+ loading,
+ page,
+ theme,
+ selectedSort,
+ sortFilter,
+ sortFilterCourse,
+}: any) {
const [links, setLinks] = useState([
{ link: "/", name: "صفحه اصلی" },
{ link: "/courses", name: "دورهها" },
{ link: "/courses/2", name: "نام کتاب" },
]);
+ const [vocal, setVocal] = useState(false);
+ const [inputValue, setInputValue] = useState("");
useEffect(() => {
getList();
}, []);
+ useEffect(() => {
+ if (inputValue) {
+ sortFilter({ search: inputValue, sort: selectedSort });
+ setVocal(false);
+ }
+ }, [inputValue]);
+
return (
-
+
-
- {list
- ?.filter(
- (item: any) =>
- item.gradeId ===
- (selectedMenu || Number(localStorage.getItem("selectedGrade")))
- )
- .map((item: any, i: any) => (
-
+ {page === "grades" && (
+
+ )}
+ {page === "search" && (
+
+ )}
+ {page === "search" &&
+ inputValue &&
+ sortFilterCourse?.map((item: any, i: any) => (
+
))}
+ {page === "grades" &&
+ list
+ ?.filter(
+ (item: any) =>
+ item.gradeId ===
+ (selectedMenu || Number(localStorage.getItem("selectedGrade")))
+ )
+ .map((item: any, i: any) => )}
+
+ محصولی یافت نشد.
+ {page === "search" && vocal ? (
+
+ ) : null}
- {
- loading &&
+ {loading && (
+
- }
+ )}
);
}
@@ -49,7 +93,10 @@ export default connect(
(state: any) => ({
list: state.book.list,
selectedMenu: state.publicApi.selectedMenu,
- loading : state.book.loading
+ loading: state.book.loading,
+ theme: state.publicApi.theme,
+ selectedSort: state.book.selectedSort,
+ sortFilterCourse: state.book.sortFilterCourse,
}),
- { getList: book.list }
+ { getList: book.list, sortFilter: book.sortFilter }
)(Courses);
diff --git a/src/views/Home/Header/index.scss b/src/views/Home/Header/index.scss
index f818ccd..df6def2 100644
--- a/src/views/Home/Header/index.scss
+++ b/src/views/Home/Header/index.scss
@@ -119,7 +119,7 @@
@media screen and (min-width: 1441px) {
.home-slider {
- max-width: 1440px;
+ max-width: 1340px;
width: 100%;
justify-content: flex-end;
}
diff --git a/src/views/Home/index.tsx b/src/views/Home/index.tsx
index 1771054..275736a 100644
--- a/src/views/Home/index.tsx
+++ b/src/views/Home/index.tsx
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import Navbar from "../../components/Navbar";
-import HomeSearchBox from "../../components/HomeSearchBox";
import Courses from "./Courses";
import GradeFilter from "../../components/GradeFilter";
import Books from "./Books";
@@ -22,25 +21,14 @@ function Home({
headerData,
blogs,
gradeFilterBooks,
- sortFilterCourse,
- selectedSort,
- sortFilter,
getHeader,
bookLoading,
publicLoading,
theme,
}: any) {
const [grade, setGrade] = useState(null);
- const [vocal, setVocal] = useState(false);
- const [inputValue, setInputValue] = useState("");
const [gradeDropdown, setGradeDropdown] = useState(false);
- useEffect(() => {
- if (inputValue) {
- sortFilter({ search: inputValue, sort: selectedSort });
- setVocal(false);
- }
- }, [inputValue]);
useEffect(() => {
getCourseList();
scroll.goToTop();
@@ -57,7 +45,7 @@ function Home({
" "
)}
style={{
- filter: vocal || bookLoading || publicLoading ? "blur(8px)" : "",
+ filter: bookLoading || publicLoading ? "blur(8px)" : "",
}}
onClick={() => setGradeDropdown(false)}
>
@@ -65,14 +53,8 @@ function Home({
-
- {vocal ? (
-
- ) : null}
+
{(bookLoading || publicLoading) && (
@@ -107,8 +87,6 @@ export default connect(
(state: any) => ({
courseList: state.book.list,
gradeFilterBooks: state.book.gradeFilterBooks,
- sortFilterCourse: state.book.sortFilterCourse,
- selectedSort: state.book.selectedSort,
headerData: state.publicApi.header,
bookLoading: state.book.loading,
publicLoading: state.publicApi.loading,
@@ -116,7 +94,6 @@ export default connect(
}),
{
getCourseList: book.list,
- sortFilter: book.sortFilter,
getHeader: publicApi.getHeader,
}
)(Home);