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

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

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

@ -238,6 +238,7 @@ p {
}
.MuiPaper-root {
transform : translateX(50%) !important;
.MuiList-root {
display: flex !important;
width: 200px !important;
@ -247,11 +248,12 @@ p {
display: flex !important;
justify-content: center !important;
text-align: center !important;
padding: 10px 0px !important;
padding: 0px !important;
a{
color: white;
width: 100%;
height: 100%;
padding: 5px 0px;
}
&:nth-child(even) {
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 {
font-size: calc(100vw / 80) !important;
}

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

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

@ -5,10 +5,6 @@ const book = {
(data = {}) =>
async (dispatch: 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) =>
await dispatch({ type: "book/lesson/active", data: data }),
setVideoActive: (data: undefined) => async (dispatch: Dispatch) =>

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

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

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

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

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

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

@ -11,10 +11,9 @@ import play from "../../assets/icons/play.png";
import bookmark from "../../assets/icons/bookmark.png";
import StyledRating from "../../components/StyledRating";
import { connect } from "react-redux";
import { book } from "../../redux/actions";
import { publicApi } from "../../redux/actions";
import scroll from "../../util/scroll";
function Course({ lessons, getInfo, info }: any) {
const [links, setLinks] = useState([
{ link: "/", name: "صفحه اصلی" },
@ -25,14 +24,23 @@ function Course({ lessons, getInfo, info }: any) {
useEffect(() => {
scroll.goToTop();
getInfo({
bookId: 1
bookId: 18,
// window.location.pathname.slice(
// window.location.pathname.lastIndexOf("/") + 1,
// 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 (
<div className="course main d-flex flex-column">
<Navbar />
@ -40,12 +48,16 @@ function Course({ lessons, getInfo, info }: any) {
<header className="course__header desktop align-items-end">
<div className="course__info d-flex">
<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 className="course__info--description d-flex flex-column justify-content-between">
<div>
<BreadCrumbs links={links} />
<h1>{info?.name}</h1>
<p>{info?.text}</p>
</div>
<div className="d-flex justify-content-between">
<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__number d-flex align-items-center">
<div>
<b>10</b>
<i>/2</i>
<b>{Number(info?.rate) * 2 || 10}</b>
<i>/10</i>
</div>
<span>از 288 رای</span>
</div>
<StyledRating />
<StyledRating rate={info?.rate} />
<h2>میانگین رای کاربران</h2>
</div>
<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">
<div className="course__info d-flex">
<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 className="course__info--description d-flex flex-column justify-content-between">
<BreadCrumbs links={links} />
@ -107,7 +122,7 @@ function Course({ lessons, getInfo, info }: any) {
<i>/2</i>
</div>
</div>
<StyledRating />
<StyledRating rate={Number(info?.rate) || 0} />
</div>
</div>
</div>
@ -139,7 +154,7 @@ function Course({ lessons, getInfo, info }: any) {
<h2>سر فصل دوره</h2>
<p>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد </p>
</header>
{lessons.map((lesson: any, i: any) => (
{cats?.map((lesson: any, i: any) => (
<Lesson key={i} lesson={lesson} />
))}
</section>
@ -152,7 +167,7 @@ function Course({ lessons, getInfo, info }: any) {
export default connect(
(state: any) => ({
lessons: state.book.mockLessons,
info : state.book.info,
info: state.publicApi.bookInfo,
}),
{ getInfo: book.info }
{ getInfo: publicApi.bookInfo }
)(Course);

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

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

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

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

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

Loading…
Cancel
Save