reza added some change

master
RezaAshrafi77 3 years ago
parent 0651eaf99b
commit 6c512ebdcf
  1. 13
      src/components/HomeSearchBox/index.scss
  2. 14
      src/components/Navbar/index.scss
  3. 9
      src/components/StyledRating/index.tsx
  4. 14
      src/custom.scss
  5. 6
      src/redux/actions-type/book.tsx
  6. 8
      src/redux/actions-type/public.tsx
  7. 4
      src/redux/actions/book.tsx
  8. 7
      src/redux/actions/public.tsx
  9. 8
      src/redux/reducers/book.tsx
  10. 14
      src/redux/reducers/public.tsx
  11. 33
      src/views/Course/Lesson/index.scss
  12. 8
      src/views/Course/Lesson/index.tsx
  13. 18
      src/views/Course/index.scss
  14. 41
      src/views/Course/index.tsx
  15. 1
      src/views/Courses/Course/index.tsx
  16. 3
      src/views/Home/Blogs/Blog/index.scss
  17. 2
      src/views/Home/Courses/Course/index.scss
  18. 4
      src/views/Home/Courses/index.scss
  19. 19
      src/views/VideoTube/index.tsx

@ -77,15 +77,18 @@
form { form {
width: 850px; width: 850px;
input { input {
font-size: calc(100vw / 65); font-size: calc(100vw / 85);
padding-right: 20px; padding-right: 20px;
&::placeholder { &::placeholder {
font-size: calc(100vw / 75); font-size: calc(100vw / 95);
} }
} }
button { button {
width: 80px; width: 65px;
height: 60px; height: 55px;
& img{
width: 30px;
}
} }
} }
ul { ul {
@ -94,7 +97,7 @@
li { li {
color: #a2b4cb; color: #a2b4cb;
margin-left: 25px; margin-left: 25px;
font-size: calc(100vw / 90); font-size: calc(100vw / 110);
} }
} }
} }

@ -84,13 +84,6 @@
li{ li{
padding: 0px 20px; padding: 0px 20px;
font-size: calc(100vw / 115); font-size: calc(100vw / 115);
span{
width: 2px;
height: 15px;
background-color: #3F3F3F;
margin-right: 15px;
// transform: translateY(-1px);
}
} }
} }
&--buttons{ &--buttons{
@ -105,6 +98,13 @@
} }
&___logo{ &___logo{
padding-right: 0px !important; padding-right: 0px !important;
span{
width: 2px;
height: 15px;
background-color: #3F3F3F;
margin-right: 15px;
// transform: translateY(-1px);
}
} }
&___share{ &___share{
margin-left: 12px; margin-left: 12px;

@ -4,16 +4,15 @@ import Rating from '@mui/material/Rating';
export default function StyledRating(props : any) { export default function StyledRating({rate} : any) {
const {rate} = props;
return ( return (
<> <>
<Rating <Rating
name="customized-color" name="customized-color"
defaultValue={2} defaultValue={rate}
precision={0.5} precision={0.5}
icon={<StarIcon style={{ fontSize : 20, color : '#FFED00' }} />} icon={<StarIcon style={{ fontSize : 25, color : '#FFED00' }} />}
emptyIcon={<StarIcon style={{ fontSize : 20, color : '#494949' }} />} emptyIcon={<StarIcon style={{ fontSize : 25, color : '#494949' }} />}
/> />
</> </>
) )

@ -238,6 +238,7 @@ p {
} }
.MuiPaper-root { .MuiPaper-root {
transform : translateX(50%) !important;
.MuiList-root { .MuiList-root {
display: flex !important; display: flex !important;
width: 200px !important; width: 200px !important;
@ -247,11 +248,12 @@ p {
display: flex !important; display: flex !important;
justify-content: center !important; justify-content: center !important;
text-align: center !important; text-align: center !important;
padding: 10px 0px !important; padding: 0px !important;
a{ a{
color: white; color: white;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 5px 0px;
} }
&:nth-child(even) { &:nth-child(even) {
border-right: 1px solid #555 !important; border-right: 1px solid #555 !important;
@ -335,6 +337,16 @@ p {
} }
} }
.MuiPaper-root {
.MuiList-root {
width : 160px !important;
li {
width : 80px !important;
font-size: calc(100vw / 110) !important;
}
}
}
.MuiOutlinedInput-input { .MuiOutlinedInput-input {
font-size: calc(100vw / 80) !important; font-size: calc(100vw / 80) !important;
} }

@ -3,11 +3,6 @@ interface list {
data: any; data: any;
} }
interface info {
type: "public/bookVOD";
data: any;
}
interface setLessonActive { interface setLessonActive {
type: "book/lesson/active"; type: "book/lesson/active";
data: any; data: any;
@ -40,7 +35,6 @@ interface loading {
type BookAction = type BookAction =
| list | list
| info
| setVideoActive | setVideoActive
| setLessonActive | setLessonActive
| gradeFilter | gradeFilter

@ -8,6 +8,11 @@ interface getBlogList {
data: any; data: any;
} }
interface bookInfo {
type: "public/vod/bookCourse"
data: any
}
interface getBlogInfo { interface getBlogInfo {
type: "public/blogInfo"; type: "public/blogInfo";
data: any; data: any;
@ -44,7 +49,7 @@ interface selectMenu {
} }
interface getHeader{ interface getHeader{
type: "public/homePageVOD"; type: "public/VOD/homePage";
data: any; data: any;
} }
@ -65,6 +70,7 @@ interface loading {
type PublicAction = type PublicAction =
| getBlogList | getBlogList
| getBlogInfo | getBlogInfo
| bookInfo
| setSubscribe | setSubscribe
| getHomeData | getHomeData
| setFaqActive | setFaqActive

@ -5,10 +5,6 @@ const book = {
(data = {}) => (data = {}) =>
async (dispatch: Dispatch) => async (dispatch: Dispatch) =>
await proxy.get("book/list", data, { dispatch }), await proxy.get("book/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch: Dispatch) =>
await proxy.get("public/bookVOD", data, { dispatch }),
setLessonActive: (data: undefined) => async (dispatch: Dispatch) => setLessonActive: (data: undefined) => async (dispatch: Dispatch) =>
await dispatch({ type: "book/lesson/active", data: data }), await dispatch({ type: "book/lesson/active", data: data }),
setVideoActive: (data: undefined) => async (dispatch: Dispatch) => setVideoActive: (data: undefined) => async (dispatch: Dispatch) =>

@ -6,7 +6,10 @@ const publicApi = {
setFaqActive: (data: {}) => async (dispatch: Dispatch) => setFaqActive: (data: {}) => async (dispatch: Dispatch) =>
await dispatch({ type: "public/faq/activate", data: data }), await dispatch({ type: "public/faq/activate", data: data }),
bookInfo:
(data = {}) =>
async (dispatch: Dispatch) =>
await proxy.get("public/vod/bookCourse", data, { dispatch }),
getContactData: getContactData:
(data = {}) => (data = {}) =>
async (dispatch: Dispatch) => async (dispatch: Dispatch) =>
@ -32,7 +35,7 @@ const publicApi = {
getHeader: getHeader:
(data = {}) => (data = {}) =>
async (dispatch: Dispatch) => async (dispatch: Dispatch) =>
await proxy.get("public/homePageVOD", data, { dispatch }), await proxy.get("public/VOD/homePage", data, { dispatch }),
}; };
export default publicApi; export default publicApi;

@ -336,14 +336,6 @@ export default function book(state = initialState, action: BookAction) {
filterResult: data, filterResult: data,
error: null, error: null,
}; };
case "public/bookVOD":
return {
...state,
loading: false,
info: data,
selectedVideo: data.vods[0],
error: null,
};
case "book/lesson/active": case "book/lesson/active":
return { return {
...state, ...state,

@ -28,7 +28,9 @@ const initialState = {
], ],
header : [], header : [],
selectedMenu : null, selectedMenu : null,
contactData: null contactData: null,
selectedVideo: null,
bookInfo : null,
}; };
const grades = [ const grades = [
@ -49,6 +51,14 @@ const grades = [
export default function publicApi(state = initialState, action: PublicAction) { export default function publicApi(state = initialState, action: PublicAction) {
let { type, data } = action; let { type, data } = action;
switch (type) { switch (type) {
case "public/vod/bookCourse":
return {
...state,
loading: false,
bookInfo: data,
selectedVideo: data.vods[0],
error: null,
};
case "public/homePage": case "public/homePage":
let itemsLevel; let itemsLevel;
if (window.innerWidth > 1000) { if (window.innerWidth > 1000) {
@ -176,7 +186,7 @@ export default function publicApi(state = initialState, action: PublicAction) {
return { ...state, loading: false, error: null, city: data }; return { ...state, loading: false, error: null, city: data };
case "public/selectMenu": case "public/selectMenu":
return { ...state, loading: false, error: null, selectedMenu : data }; return { ...state, loading: false, error: null, selectedMenu : data };
case "public/homePageVOD": case "public/VOD/homePage":
return { ...state, loading: false, error: null, header : data }; return { ...state, loading: false, error: null, header : data };
case "loading": case "loading":
return { ...state, loading: true }; return { ...state, loading: true };

@ -1,5 +1,7 @@
.lesson { .lesson {
transition: all 0.5 ease-in; transition: all 0.3s;
overflow : hidden;
border-bottom: 1px solid #b3b3b3;
&__active{ &__active{
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
@ -26,11 +28,12 @@
border-left: 1px solid #b3b3b3; border-left: 1px solid #b3b3b3;
border-right: 1px solid #b3b3b3; border-right: 1px solid #b3b3b3;
transition: all 0.4s ease-in; transition: all 0.4s ease-in;
overflow: hidden;
& img{ & img{
width: 40px; width: 30px;
margin-right: 15px;
} }
&--sample{ &--sample{
margin-bottom: 15px;
color: white; color: white;
li{ li{
text-align: center; text-align: center;
@ -41,7 +44,6 @@
} }
} }
&--active{ &--active{
padding : 30px 15px 20px !important;
border-bottom: 1px solid #b3b3b3; border-bottom: 1px solid #b3b3b3;
} }
} }
@ -54,25 +56,25 @@
margin-right: 5px; margin-right: 5px;
} }
h4 { h4 {
font-size: 21px; font-size: 18px;
margin-right: 30px; margin-right: 30px;
} }
div { div {
font-size: 18px; font-size: 16px;
} }
} }
&__duration{ &__duration{
width: 260px; width: 175px;
text-align: center; text-align: center;
} }
&__files{ &__files{
&--sample{ &--sample{
li{ li{
width : 120px; width : 120px;
font-size: 19px; font-size: 16px;
} }
h5{ h5{
font-size: 19px; font-size: 16px;
} }
} }
} }
@ -84,32 +86,33 @@
header { header {
img{ img{
margin-right: 5px; margin-right: 5px;
width : 30px;
} }
h4 { h4 {
font-size: calc(100vw / 75); font-size: calc(100vw / 95);
margin-right: 30px; margin-right: 30px;
} }
div { div {
font-size: calc(100vw / 80); font-size: calc(100vw / 95);
} }
} }
&__duration{ &__duration{
width: 250px; width: 170px;
text-align: center; text-align: center;
} }
&__files{ &__files{
&--sample{ &--sample{
li{ li{
width : 120px; width : 120px;
font-size: calc(100vw / 75); font-size: calc(100vw / 95);
} }
h5{ h5{
font-size: calc(100vw/ 75); font-size: calc(100vw/ 100);
} }
} }
&--active{ &--active{
padding: 15px 5px !important; padding: 5px !important;
} }
} }

@ -42,7 +42,7 @@ function Lesson(props: any) {
</header> </header>
<ul <ul
className={ className={
"lesson__files d-flex flex-column" + "lesson__files d-flex flex-column justify-content-around" +
" " + " " +
(lesson.active && "lesson__files--active") (lesson.active && "lesson__files--active")
} }
@ -50,12 +50,12 @@ function Lesson(props: any) {
height: lesson.active height: lesson.active
? lesson.files.length * ? lesson.files.length *
(window.innerWidth > 1007 (window.innerWidth > 1007
? window.innerWidth / 75 + 45 ? window.innerWidth / 33 + 20
: window.innerWidth / 33 + 45) : window.innerWidth / 33 + 45)
: "0px", : "0px",
}} }}
> >
{lesson.files.map((data: any, i: any) => ( {lesson.map((data: any, i: any) => (
<li <li
className="lesson__files--sample justify-content-between align-items-center" className="lesson__files--sample justify-content-between align-items-center"
style={{ style={{
@ -70,7 +70,7 @@ function Lesson(props: any) {
<ul className="d-flex"> <ul className="d-flex">
<li>{data.type !== "document" && data.duration}</li> <li>{data.type !== "document" && data.duration}</li>
<li>{data.view && "مشاهده"}</li> <li>{data.view && "مشاهده"}</li>
<li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> {/* <li>{data.download ? "دانلود" : <img src={lock} alt="" />}</li> */}
</ul> </ul>
</li> </li>
))} ))}

@ -181,35 +181,29 @@
&--image{ &--image{
img{ img{
// width: 250px; // width: 250px;
height: 380px; height: 350px;
} }
} }
&--description{ &--description{
a{
font-size: calc(100vw / 90);
}
li{
font-size: calc(100vw / 90);
}
h1{ h1{
font-size: calc(100vw / 40); font-size: calc(100vw / 50);
} }
p{ p{
font-size: calc(100vw / 80);; font-size: calc(100vw / 100);;
} }
.course-info-items{ .course-info-items{
width: 45%; width: 45%;
margin-top: 20px; margin-top: 20px;
& img{ & img{
margin-left: 10px; margin-left: 10px;
width : 45px; width : 40px;
} }
i{ i{
font-size: calc(100vw / 95); font-size: calc(100vw / 120);
font-family: numeralLight; font-family: numeralLight;
} }
p{ p{
font-size: calc(100vw / 100); font-size: calc(100vw / 130);
margin: 0px; margin: 0px;
} }
} }

@ -11,10 +11,9 @@ import play from "../../assets/icons/play.png";
import bookmark from "../../assets/icons/bookmark.png"; import bookmark from "../../assets/icons/bookmark.png";
import StyledRating from "../../components/StyledRating"; import StyledRating from "../../components/StyledRating";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { book } from "../../redux/actions"; import { publicApi } from "../../redux/actions";
import scroll from "../../util/scroll"; import scroll from "../../util/scroll";
function Course({ lessons, getInfo, info }: any) { function Course({ lessons, getInfo, info }: any) {
const [links, setLinks] = useState([ const [links, setLinks] = useState([
{ link: "/", name: "صفحه اصلی" }, { link: "/", name: "صفحه اصلی" },
@ -25,14 +24,23 @@ function Course({ lessons, getInfo, info }: any) {
useEffect(() => { useEffect(() => {
scroll.goToTop(); scroll.goToTop();
getInfo({ getInfo({
bookId: 1 bookId: 18,
// window.location.pathname.slice( // window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1, // window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length // window.location.pathname.length
// ), // ),
}); });
}, []); }, []);
let allCats;
let cats = [];
if (info?.vods) {
allCats = Array.from(
new Set(info?.vods.map((item: any) => item.categoryId && item.categoryId))
);
cats = allCats.map((item: any) =>
info?.vods.filter((item1: any) => item1.categoryId === item)
);
}
return ( return (
<div className="course main d-flex flex-column"> <div className="course main d-flex flex-column">
<Navbar /> <Navbar />
@ -40,12 +48,16 @@ function Course({ lessons, getInfo, info }: any) {
<header className="course__header desktop align-items-end"> <header className="course__header desktop align-items-end">
<div className="course__info d-flex"> <div className="course__info d-flex">
<div className="course__info--image d-flex align-items-end"> <div className="course__info--image d-flex align-items-end">
<img src={`https://dnvn.ir/api/v1/file/${info?.fileIds}`} alt="" /> <img
src={`https://dnvn.ir/api/v1/file/${info?.fileIds}`}
alt=""
/>
</div> </div>
<div className="course__info--description d-flex flex-column justify-content-between"> <div className="course__info--description d-flex flex-column justify-content-between">
<div> <div>
<BreadCrumbs links={links} /> <BreadCrumbs links={links} />
<h1>{info?.name}</h1> <h1>{info?.name}</h1>
<p>{info?.text}</p>
</div> </div>
<div className="d-flex justify-content-between"> <div className="d-flex justify-content-between">
<div className="course-info-items d-flex align-items-center justify-content-around"> <div className="course-info-items d-flex align-items-center justify-content-around">
@ -69,12 +81,12 @@ function Course({ lessons, getInfo, info }: any) {
<div className="course__options--rate d-flex flex-column align-items-center justify-content-start"> <div className="course__options--rate d-flex flex-column align-items-center justify-content-start">
<div className="course__options--rate__number d-flex align-items-center"> <div className="course__options--rate__number d-flex align-items-center">
<div> <div>
<b>10</b> <b>{Number(info?.rate) * 2 || 10}</b>
<i>/2</i> <i>/10</i>
</div> </div>
<span>از 288 رای</span> <span>از 288 رای</span>
</div> </div>
<StyledRating /> <StyledRating rate={info?.rate} />
<h2>میانگین رای کاربران</h2> <h2>میانگین رای کاربران</h2>
</div> </div>
<button className="course__options--button d-flex align-items-center justify-content-between"> <button className="course__options--button d-flex align-items-center justify-content-between">
@ -93,7 +105,10 @@ function Course({ lessons, getInfo, info }: any) {
<header className="mobile flex-column"> <header className="mobile flex-column">
<div className="course__info d-flex"> <div className="course__info d-flex">
<div className="course__info--image d-flex align-items-end"> <div className="course__info--image d-flex align-items-end">
<img src={`https://dnvn.ir/api/v1/file/${info?.fileIds}`} alt="" /> <img
src={`https://dnvn.ir/api/v1/file/${info?.fileIds}`}
alt=""
/>
</div> </div>
<div className="course__info--description d-flex flex-column justify-content-between"> <div className="course__info--description d-flex flex-column justify-content-between">
<BreadCrumbs links={links} /> <BreadCrumbs links={links} />
@ -107,7 +122,7 @@ function Course({ lessons, getInfo, info }: any) {
<i>/2</i> <i>/2</i>
</div> </div>
</div> </div>
<StyledRating /> <StyledRating rate={Number(info?.rate) || 0} />
</div> </div>
</div> </div>
</div> </div>
@ -139,7 +154,7 @@ function Course({ lessons, getInfo, info }: any) {
<h2>سر فصل دوره</h2> <h2>سر فصل دوره</h2>
<p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p> <p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p>
</header> </header>
{lessons.map((lesson: any, i: any) => ( {cats?.map((lesson: any, i: any) => (
<Lesson key={i} lesson={lesson} /> <Lesson key={i} lesson={lesson} />
))} ))}
</section> </section>
@ -152,7 +167,7 @@ function Course({ lessons, getInfo, info }: any) {
export default connect( export default connect(
(state: any) => ({ (state: any) => ({
lessons: state.book.mockLessons, lessons: state.book.mockLessons,
info : state.book.info, info: state.publicApi.bookInfo,
}), }),
{ getInfo: book.info } { getInfo: publicApi.bookInfo }
)(Course); )(Course);

@ -13,6 +13,7 @@ export default function Course({ data }: any) {
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده
از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و
</p> </p>
<i></i>
</div> </div>
</Link> </Link>
); );

@ -30,7 +30,6 @@
} }
h2 { h2 {
color: white; color: white;
font-family: numeralBold;
} }
} }
@ -60,7 +59,7 @@
transform : scale(0.9); transform : scale(0.9);
} }
h2 { h2 {
font-size: calc(100vw / 80); font-size: calc(100vw / 100);
} }
p { p {
font-size: calc(100vw / 130); font-size: calc(100vw / 130);

@ -64,7 +64,7 @@
height: 280px; height: 280px;
} }
h2{ h2{
font-size: calc(100vw / 80); font-size: calc(100vw / 90);
} }
p{ p{
font-size: calc(100vw / 130); font-size: calc(100vw / 130);

@ -63,10 +63,10 @@
max-width: 1250px; max-width: 1250px;
header{ header{
h1{ h1{
font-size: calc(100vw / 60); font-size: calc(100vw / 75);
} }
span{ span{
font-size: calc(100vw / 100); font-size: calc(100vw / 120);
} }
} }
&__more{ &__more{

@ -12,7 +12,7 @@ import "./index.scss";
import listIcon from "../../assets/icons/list.png"; import listIcon from "../../assets/icons/list.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import scroll from "../../util/scroll.js"; import scroll from "../../util/scroll.js";
import { book } from "../../redux/actions"; import { book, publicApi } from "../../redux/actions";
function VodTube({ function VodTube({
videoList, videoList,
@ -25,15 +25,16 @@ function VodTube({
}: any) { }: any) {
useEffect(() => { useEffect(() => {
getBookList(); getBookList();
getInfo({ // getInfo({
bookId: 1, // bookId: 1,
// window.location.pathname.slice( // // window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1, // // window.location.pathname.lastIndexOf("/") + 1,
// window.location.pathname.length // // window.location.pathname.length
// ), // // ),
}); // });
scroll.goToTop(); scroll.goToTop();
}, []); }, []);
return ( return (
<div className="video-tube main d-flex flex-column"> <div className="video-tube main d-flex flex-column">
<Navbar /> <Navbar />
@ -131,5 +132,5 @@ export default connect(
comments: state.book.comments, comments: state.book.comments,
info: state.book.info, info: state.book.info,
}), }),
{ getInfo: book.info, getBookList : book.list } { getInfo: publicApi.bookInfo, getBookList : book.list }
)(VodTube); )(VodTube);

Loading…
Cancel
Save