update src/components/Comments/index.js and src/components/CourseChapter/index.js

temp
mahdi 2 years ago
parent 9e1e0e5562
commit f7f61934cb
  1. 6
      src/components/Comments/index.js
  2. 21
      src/components/CourseChapter/index.js

@ -46,7 +46,7 @@ export const Comments = ({ comments, indent }) => {
<div className="flex items-center"> <div className="flex items-center">
<strong className="text-base mr-2">{comment.userId}</strong> <strong className="text-base mr-2">{comment.userId}</strong>
<span className="text-tiny text-greenBA mr-3"> <span className="text-tiny text-greenBA mr-3">
{comment?.userRoll || "خریدار محصول"} {comment?.userRoll || `${window.t("خریدار محصول")}`}
</span> </span>
<div className="flex flex-row items-center mr-10 font-semibold"> <div className="flex flex-row items-center mr-10 font-semibold">
<StarRating /> <StarRating />
@ -80,7 +80,7 @@ export const Comments = ({ comments, indent }) => {
<> <>
<img src={positiveIcon} alt="" className="w-6 ml-2" /> <img src={positiveIcon} alt="" className="w-6 ml-2" />
<span className="text-sm text-black"> <span className="text-sm text-black">
برای خرید توصیه میکنم {window.t("برای خرید توصیه میکنم")}
</span> </span>
</> </>
)} )}
@ -88,7 +88,7 @@ export const Comments = ({ comments, indent }) => {
<> <>
<img src={negativeIcon} alt="" className="w-6 ml-2" /> <img src={negativeIcon} alt="" className="w-6 ml-2" />
<span className="text-sm text-black"> <span className="text-sm text-black">
برای خرید توصیه نمیکنم {window.t("بازگشت بی چون و برای خرید توصیه نمیکنم")}
</span> </span>
</> </>
)} )}

@ -12,7 +12,7 @@ const CourseChapter = ({
selectedVideo, selectedVideo,
userId, userId,
setVideoActive, setVideoActive,
isMobile isMobile,
}) => { }) => {
const duration = (value) => { const duration = (value) => {
const minute = value % 60; const minute = value % 60;
@ -30,19 +30,19 @@ const CourseChapter = ({
className={`bg-transparent lg:bg-green1 bg-opacity-10 lg:bg-opacity-10 lg:shadow-md lg:py-5 lg:pr-5 overflow-hidden flex flex-col rounded-md`} className={`bg-transparent lg:bg-green1 bg-opacity-10 lg:bg-opacity-10 lg:shadow-md lg:py-5 lg:pr-5 overflow-hidden flex flex-col rounded-md`}
style={{ style={{
minWidth: "calc(100% / 12 * 3.5)", minWidth: "calc(100% / 12 * 3.5)",
height: isMobile ? "auto" :"calc(100vh - 300px)", height: isMobile ? "auto" : "calc(100vh - 300px)",
}} }}
> >
<div className="hidden lg:flex flex-row w-full items-center justify-between"> <div className="hidden lg:flex flex-row w-full items-center justify-between">
<div> <div>
<h2 className="text-green7B bg-opacity-5 text-base font-semibold"> <h2 className="text-green7B bg-opacity-5 text-base font-semibold">
سرفصل دوره {window.t("سرفصل دوره")}
</h2> </h2>
</div> </div>
<div className="flex flex-row-reverse items-center divide-x divide-solid transform translate-x-2"> <div className="flex flex-row-reverse items-center divide-x divide-solid transform translate-x-2">
<span className="text-green7B text-sm px-2">{book?.name}</span> <span className="text-green7B text-sm px-2">{book?.name}</span>
<span className="text-green7B text-sm px-2"> <span className="text-green7B text-sm px-2">
{"پایه" + " " + grades[book?.gradeId]} {`${window.t("پایه")}` + " " + grades[book?.gradeId]}
</span> </span>
</div> </div>
</div> </div>
@ -88,7 +88,10 @@ const CourseChapter = ({
></span> ></span>
</div> </div>
{/* left div content */} {/* left div content */}
<div className="py-1.5" style={{ width: isMobile ? '100%' :"90%" }}> <div
className="py-1.5"
style={{ width: isMobile ? "100%" : "90%" }}
>
<div <div
className={`w-full bg-white flex flex-col transition duration-400 hover:scale-95 shadow-md border border-solid border-green-200 transform rounded-md className={`w-full bg-white flex flex-col transition duration-400 hover:scale-95 shadow-md border border-solid border-green-200 transform rounded-md
${ ${
@ -100,7 +103,7 @@ const CourseChapter = ({
onClick={() => onClick={() =>
video?.isFreeVod || +userId === 140 video?.isFreeVod || +userId === 140
? setVideoActive(video) ? setVideoActive(video)
: toast.error("ابتدا محصول رو خریداری کن!") : toast.error(`${window.t("ابتدا محصول رو خریداری کن!")}`)
} }
disabled={true} disabled={true}
> >
@ -138,7 +141,9 @@ const CourseChapter = ({
: "text-blueC0" : "text-blueC0"
}`} }`}
> >
{selectedVideo?.id === video?.id ? "در حال پخش" : "پخش"} {selectedVideo?.id === video?.id
? `${window.t("در حال پخش")}`
: `${window.t("پخش")}`}
</span> </span>
</div> </div>
</div> </div>
@ -157,7 +162,7 @@ const mapStateToProps = (state) => ({
grades: state.publicApi.grades, grades: state.publicApi.grades,
// vods: state.publicApi.bookSection?.vods, // vods: state.publicApi.bookSection?.vods,
userId: state?.user?.status?.id, userId: state?.user?.status?.id,
isMobile: state.publicApi.isMobile isMobile: state.publicApi.isMobile,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

Loading…
Cancel
Save