Skip to content

Commit 965ed49

Browse files
committed
newupdate
1 parent b764173 commit 965ed49

9 files changed

Lines changed: 96 additions & 71 deletions

File tree

src/components/module/education/ListDataEducation.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ export default function ListDataEducation({ data }: any) {
3636
className=" w-full h-full hover:blur-none transition-all duration-150 ease-in-out rounded-t-[10px] object-cover"
3737
/>
3838
<div className="w-full h-full backdrop-blur-[3px] bg-black/20 hover:backdrop-blur-none xs:backdrop-blur-none absolute z-0 top-0 flex justify-center items-center">
39-
<Video className="w-[78px] h-[78px] p-3 fill-blueLink dark:fill-dark-yellow rounded-full bg-white/80" />
39+
<Link
40+
className="w-fit"
41+
href={`/${lang}/education/category/${item.category.slug}/${item.sub_category.slug}/${item.slug}`}
42+
>
43+
<Video className="w-[78px] h-[78px] p-3 fill-blueLink dark:fill-dark-yellow rounded-full bg-white/80" />
44+
</Link>
4045
</div>
4146
</div>
4247

src/components/module/singleVideo/SingleVideoDetailsModule.tsx

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,41 +68,40 @@ const SingleVideoDetailsModule = ({
6868
<View className="stroke-singleVideo-gray dark:stroke-white xs:size-[24px]" />
6969
</div>
7070
</div>
71-
<p className="w-full text-start h-fit transition-all duration-300 ease-in-out text-[22px] xs:text-[16px] text-singleVideo-gray dark:text-white font-azarMehr font-normal mt-5">
72-
{!isComplete ? (
73-
<span
74-
dangerouslySetInnerHTML={{
75-
__html: checkData(DataVideo.description.slice(0, 500)),
76-
}}
77-
/>
78-
) : (
71+
72+
{!isComplete ? (
73+
<p
74+
className="w-full text-start h-fit transition-all duration-300 ease-in-out text-[22px] xs:text-[16px] text-singleVideo-gray dark:text-white font-azarMehr font-normal mt-5"
75+
dangerouslySetInnerHTML={{
76+
__html: checkData(DataVideo.description.slice(0, 500)),
77+
}}
78+
/>
79+
) : (
80+
<p
81+
className="w-full text-start h-fit transition-all duration-300 ease-in-out text-[22px] xs:text-[16px] text-singleVideo-gray dark:text-white font-azarMehr font-normal mt-5"
82+
dangerouslySetInnerHTML={{
83+
__html: checkData(DataVideo.description),
84+
}}
85+
/>
86+
)}
87+
88+
{!isComplete && DataVideo?.description.length > 500 && (
89+
<>
90+
<span className="font-azarMehr font-medium xl:text-[12px] text-singleVideo-gray dark:text-white">
91+
...
92+
</span>
7993
<span
80-
dangerouslySetInnerHTML={{
81-
__html: checkData(DataVideo.description),
82-
}}
83-
/>
84-
)}
94+
className="dark:text-dark-yellow mx-2 text-blueLink font-azarMehr font-medium cursor-pointer text-[18px]"
95+
onClick={() => setIsComplete(!isComplete)}
96+
>
97+
{checkData(
98+
translateSingleVideo.find((item: any) => item.name === "view all")
99+
?.translation
100+
)}
101+
</span>
102+
</>
103+
)}
85104

86-
{DataVideo?.description.length > 500 && (
87-
<>
88-
<span className="font-azarMehr font-medium xl:text-[12px] text-singleVideo-gray dark:text-white">
89-
{" "}
90-
...
91-
</span>
92-
<span
93-
className="dark:text-dark-yellow mx-2 text-blueLink font-azarMehr font-medium cursor-pointer text-[18px]"
94-
onClick={() => setIsComplete(!isComplete)}
95-
dangerouslySetInnerHTML={{
96-
__html: checkData(
97-
translateSingleVideo.find(
98-
(item: any) => item.name === "view all"
99-
)?.translation
100-
),
101-
}}
102-
/>
103-
</>
104-
)}
105-
</p>
106105
<div className="relative mt-10 px-3 w-[640px] xs:w-[95%] h-[48px]">
107106
<input
108107
type="text"

src/components/module/singleVideo/SingleVideoPlayModule.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const SingleVideoPlayModule = ({ DataVideo }: any) => {
115115
<div className="relative w-full flex justify-center items-center ">
116116
<video
117117
ref={videoRef}
118-
className="w-full h-[700px] xs:h-[500px] rounded-xl mx-10 object-fill z-30"
118+
className="w-full xl:h-[700px] lg:h-[600px] md:h-[500px] sm:h-[300px] xs:h-[300px] rounded-xl mx-10 object-fill z-30"
119119
src={DataVideo.video_url}
120120
poster={DataVideo.image_url}
121121
onPlay={startProgressLoop}
@@ -164,9 +164,12 @@ const SingleVideoPlayModule = ({ DataVideo }: any) => {
164164
</div>
165165

166166
<p className="font-azarMehr text-singleVideo_medium text-singleVideo-gray dark:text-white font-medium">
167-
{videoRef.current && formatDuration(videoRef.current.duration)}
167+
{videoRef.current
168+
? formatDuration(videoRef.current.duration)
169+
: "00:00"}
168170
</p>
169171
<input
172+
dir="ltr"
170173
className="xl:w-[70%] lg:w-[70%] md:w-[70%] sm:w-[65%] xs:w-[60%] accent-blueLink dark:accent-dark-yellow border-none outline-none ring-0"
171174
type="range"
172175
min={0}

src/components/module/singleVideo/SingleVideoSlugModule.tsx

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,54 @@ export default function SingleVideoSlugModule({
1010
return (
1111
<>
1212
<div className="flex flex-wrap xs:px-3 justify-start items-center gap-2 xs:gap-4 w-full h-fit pt-5 bg-white dark:bg-singleVideo-dark-background">
13-
<Link href={`${lang}/education`}>
14-
<p className="w-fit ps-5 font-normal font-azarMehr text-[15px] xs:text-[12px] text-start text-[#575757] dark:text-singleVideo-dark-text cursor-pointer hover:text-blueLink hover:dark:text-dark-yellow">
15-
آموزش
16-
</p>
17-
</Link>
13+
<p
14+
className="w-fit ps-5 font-normal font-azarMehr text-[15px] xs:text-[12px] text-start text-[#575757] dark:text-singleVideo-dark-text cursor-pointer hover:text-blueLink hover:dark:text-dark-yellow"
15+
onClick={() => router.push(`/${lang}/education`)}
16+
>
17+
آموزش
18+
</p>
19+
1820
<span className="text-[#575757] font-normal font-azarMehr text-[15px] xs:text-[12px]">
1921
/
2022
</span>
21-
<Link href={`${lang}/education`}>
22-
<p
23-
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
24-
onClick={() => router.push(`/${lang}/education/category/all`)}
25-
>
26-
دسته بندی ها
27-
</p>
28-
</Link>
23+
24+
<p
25+
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
26+
onClick={() => router.push(`/${lang}/education/category/all`)}
27+
>
28+
دسته بندی ها
29+
</p>
30+
2931
<span className="text-[#575757] font-normal font-azarMehr text-[15px] xs:text-[12px]">
3032
/
3133
</span>
32-
<Link href={`${lang}/education/${DataVideo.category.slug}`}>
33-
<p
34-
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
35-
onClick={() => router.push(`/${lang}/education/category/all`)}
36-
>
37-
{DataVideo.category.name}
38-
</p>
39-
</Link>
34+
35+
<p
36+
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
37+
onClick={() =>
38+
router.push(
39+
`/${lang}/education/category/${DataVideo.category.slug}`
40+
)
41+
}
42+
>
43+
{DataVideo.category.name}
44+
</p>
45+
4046
<span className="text-[#575757] font-normal font-azarMehr text-[15px] xs:text-[12px]">
4147
/
4248
</span>
43-
<Link href={`${lang}/education/${DataVideo.sub_category.slug}`}>
44-
<p
45-
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
46-
onClick={() => router.push(`/${lang}/education/category/all`)}
47-
>
48-
{DataVideo.sub_category.name}
49-
</p>
50-
</Link>
49+
50+
<p
51+
className="w-fit font-normal font-azarMehr cursor-pointer text-[15px] xs:text-[12px] text-start text-[#575757] hover:text-blueLink hover:dark:text-dark-yellow xs:whitespace-nowrap"
52+
onClick={() =>
53+
router.push(
54+
`/${lang}/education/category/${DataVideo.category.slug}/${DataVideo.sub_category.slug}`
55+
)
56+
}
57+
>
58+
{DataVideo.sub_category.name}
59+
</p>
60+
5161
<span className="text-[#575757] font-normal font-azarMehr text-[15px] xs:text-[12px]">
5262
/
5363
</span>

src/components/module/singleVideo/comments/CommentList.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const CommentList = ({
2727
const { setShowAuthCard } = useContext(AuthContext);
2828
const [editMode, setEditMode] = useState(0);
2929
const [editedText, setEditedText] = useState("");
30+
const [edited, setEdited] = useState(false);
3031

3132
return (
3233
<>
@@ -57,12 +58,15 @@ const CommentList = ({
5758
translateSingleVideo={translateSingleVideo}
5859
setEditMode={setEditMode}
5960
setEditedText={setEditedText}
61+
setEdited={setEdited}
6062
/>
6163
)}
6264
</div>
6365
{/* Edit Module */}
6466
<div className="w-full mt-5">
65-
{editMode === itemComment.id && code === itemComment.user.code ? (
67+
{!edited &&
68+
editMode === itemComment.id &&
69+
code === itemComment.user.code ? (
6670
<form
6771
onSubmit={(e: any) =>
6872
handleSubmit(

src/components/module/singleVideo/comments/ControlCommentSection.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { checkData } from "@/components/utils/targetDataName";
33
import { handleClick, handlerDeleteComments } from "./utils/helper";
44
import { useToken } from "@/components/context/TokenContext";
55

6-
76
const ControlCommentSection = ({
87
itemComment,
98
setRefreshComment,
@@ -58,5 +57,4 @@ const ControlCommentSection = ({
5857
);
5958
};
6059

61-
62-
export default ControlCommentSection;
60+
export default ControlCommentSection;

src/components/module/singleVideo/comments/utils/EditSectionComment.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const EditSectionComment = ({
1515
translateSingleVideo,
1616
setEditMode,
1717
setEditedText,
18+
setEdited,
1819
}: any) => {
1920
const { code, token } = useToken();
2021

src/components/templates/singleVideo/VideoSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const VideoSection = ({
4040
return (
4141
<>
4242
<div className="w-full bg-[#F5F5F5] dark:bg-black grid grid-cols-12 xs:flex xs:flex-col select-none ">
43-
<div className="w-auto xl:max-h-[2050px] lg:max-h-[2050px] md:h-full sm:h-full xs:h-full xl:mx-10 lg:mx-5 md:md-2 xs:mx-1 xl:col-span-9 lg:col-span-9 sm:col-span-12 h-fit flex flex-col justify-start items-center">
43+
<div className="w-auto xl:max-h-fit lg:max-h-fit md:h-full sm:h-full xs:h-full xl:mx-10 lg:mx-5 md:md-2 xs:mx-1 xl:col-span-9 lg:col-span-9 sm:col-span-12 h-fit flex flex-col justify-start items-center">
4444
<SingleVideoSlugModule DataVideo={DataVideo} />
4545
<DynamicVideoPlayer DataVideo={DataVideo} />
4646
<SingleVideoDashboardModule

src/pages/[lang]/education/category/[category]/[subcategory]/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ const Index = ({
194194
className=" w-full h-full hover:blur-none transition-all duration-150 ease-in-out rounded-t-[10px] object-cover"
195195
/>
196196
<div className="w-full h-full backdrop-blur-[3px] bg-black/20 hover:backdrop-blur-none xs:backdrop-blur-none absolute z-0 top-0 flex justify-center items-center">
197-
<Video className="w-[78px] h-[78px] p-3 fill-blueLink dark:fill-dark-yellow rounded-full bg-white/80" />
197+
<Link
198+
className="w-fit"
199+
href={`/${lang}/education/category/${CategoryData.category.slug}/${CategoryData.slug}/${item.slug}`}
200+
>
201+
<Video className="w-[78px] h-[78px] p-3 fill-blueLink dark:fill-dark-yellow rounded-full bg-white/80" />
202+
</Link>
198203
</div>
199204
</div>
200205

0 commit comments

Comments
 (0)