treasure section, video controls fix
This commit is contained in:
parent
a4eae0e528
commit
f6fddab1bf
|
|
@ -28,11 +28,13 @@ const VideoPlayer = ({ maxHeight, maxWidth, video_id }: IProps) => {
|
||||||
queryKey: ["video", `video:${video_id}`],
|
queryKey: ["video", `video:${video_id}`],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const response = await Queries.getVideo(video_id);
|
const response = await Queries.getVideo(video_id);
|
||||||
if (response.data.is_downloadable === 0) {
|
|
||||||
setCanDownload(false);
|
// console.log(response);
|
||||||
} else {
|
// if (response.data.is_downloadable == 1) {
|
||||||
setCanDownload(true);
|
// setCanDownload(true);
|
||||||
} // Set canDownload from API
|
// } else {
|
||||||
|
// setCanDownload(false);
|
||||||
|
// } // Set canDownload from API
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -67,13 +69,18 @@ const VideoPlayer = ({ maxHeight, maxWidth, video_id }: IProps) => {
|
||||||
<div className="lg:w-[700px] md:w-[550px] w-full h-[200px] sm:h-[250px] md:h-[350px] lg:h-[420px]">
|
<div className="lg:w-[700px] md:w-[550px] w-full h-[200px] sm:h-[250px] md:h-[350px] lg:h-[420px]">
|
||||||
<video
|
<video
|
||||||
controls
|
controls
|
||||||
controlsList={canDownload ? "" : "nodownload"} // Conditionally enable/disable download
|
controlsList={
|
||||||
src={data!.data.video_stream_url}
|
data?.data.is_downloadable === 0 ? "nodownload" : ""
|
||||||
|
} // Conditionally enable/disable download
|
||||||
poster={data?.data.banner_url}
|
poster={data?.data.banner_url}
|
||||||
playsInline
|
playsInline
|
||||||
itemType="video/mp4"
|
>
|
||||||
onPlay={() => onPlayHandler()}
|
<source
|
||||||
></video>
|
src={data!.data.video_stream_url}
|
||||||
|
type="video/mp4"
|
||||||
|
onPlay={() => onPlayHandler()}
|
||||||
|
/>
|
||||||
|
</video>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col gap-4 h-fit">
|
<div className="flex flex-col gap-4 h-fit">
|
||||||
|
|
|
||||||
|
|
@ -71,20 +71,20 @@ const QuizWinnerTable = ({ quizId, quizFinished, smsNumber }: IProps) => {
|
||||||
<div className="flex border-b border-fillTableStrokeTableHead">
|
<div className="flex border-b border-fillTableStrokeTableHead">
|
||||||
{winnersData?.data[0].client_id || quizSearchData?.data ? (
|
{winnersData?.data[0].client_id || quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[54px] w-[100%] pl-6 pr-3 py-5">
|
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[54px] w-[100%] pl-6 pr-3 py-5">
|
||||||
<span>№</span>
|
<span>Ýeri</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData?.data[0].client.phone || quizSearchData?.data ? (
|
{winnersData?.data[0].client.phone || quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[176px] w-[100%] px-3 py-5">
|
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[176px] w-[100%] px-3 py-5">
|
||||||
<span>Gatnaşyjynyň tel. Beligisi</span>
|
<span>Telefon beligisi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData?.data[0].client.answers.length ||
|
{winnersData?.data[0].client.answers.length ||
|
||||||
quizSearchData?.data ? (
|
quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold w-[100%] px-3 py-5">
|
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold w-[100%] px-3 py-5">
|
||||||
<span>Soraglara jogap berilişiň nobaty</span>
|
<span>Jogap beriş nobatlary</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
|
@ -255,26 +255,26 @@ const QuizWinnerTable = ({ quizId, quizFinished, smsNumber }: IProps) => {
|
||||||
<div className="flex border-b border-fillTableStrokeTableHead p-2 gap-[8px]">
|
<div className="flex border-b border-fillTableStrokeTableHead p-2 gap-[8px]">
|
||||||
{winnersData?.data[0].client_id || quizSearchData?.data ? (
|
{winnersData?.data[0].client_id || quizSearchData?.data ? (
|
||||||
<div className="text-center flex items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[14px] w-[100%]">
|
<div className="text-center flex items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[14px] w-[100%]">
|
||||||
<span>№</span>
|
<span>Ýeri</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData?.data[0].client.phone || quizSearchData?.data ? (
|
{winnersData?.data[0].client.phone || quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[107px] w-[100%]">
|
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[107px] w-[100%]">
|
||||||
<span>Gatnaşyjynyň tel. Beligisi</span>
|
<span>Telefon beligisi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData?.data[0].total_score_of_client ||
|
{winnersData?.data[0].total_score_of_client ||
|
||||||
quizSearchData?.data ? (
|
quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[75px] w-[100%]">
|
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[75px] w-[100%]">
|
||||||
<span>Soraglara jogap berilişiň nobaty </span>
|
<span>Nobatlaryň jemi </span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{winnersData?.data[0].total_score_of_client ||
|
{winnersData?.data[0].total_score_of_client ||
|
||||||
quizSearchData?.data ? (
|
quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[99px] w-[100%]">
|
<div className="text-center flex justify-center items-center text-xs text-textBlack leading-[125%] font-semibold max-w-[99px] w-[100%]">
|
||||||
<span>Nobatlaryň jemi</span>
|
<span>Utuklaryň jemi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -319,7 +319,7 @@ const QuizWinnerTable = ({ quizId, quizFinished, smsNumber }: IProps) => {
|
||||||
<div className="flex gap-[8px] items-center">
|
<div className="flex gap-[8px] items-center">
|
||||||
{winnersData?.data[0].client.answers.length !== 0 ? (
|
{winnersData?.data[0].client.answers.length !== 0 ? (
|
||||||
<div className="flex justify-center items-center text-xs text-textLight leading-[125%] font-semibold w-fit">
|
<div className="flex justify-center items-center text-xs text-textLight leading-[125%] font-semibold w-fit">
|
||||||
<span>Soraglara näçinji jogap berdi :</span>
|
<span>Jogap beriş nobatlary:</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{winnersData.data[0].client.answers.length !== 0 ? (
|
{winnersData.data[0].client.answers.length !== 0 ? (
|
||||||
|
|
@ -403,7 +403,7 @@ const QuizWinnerTable = ({ quizId, quizFinished, smsNumber }: IProps) => {
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-[8px] items-center">
|
<div className="flex gap-[8px] items-center">
|
||||||
<div className="flex justify-center items-center text-xs text-textLight leading-[125%] font-semibold w-fit">
|
<div className="flex justify-center items-center text-xs text-textLight leading-[125%] font-semibold w-fit">
|
||||||
<span>Soraglara näçinji jogap berdi :</span>
|
<span>Jogap beriş nobatlary:</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-center items-center gap-[4px] text-xs text-textGray leading-[125%] w-fit">
|
<div className="flex justify-center items-center gap-[4px] text-xs text-textGray leading-[125%] w-fit">
|
||||||
{Object.keys(quizSearchData.data)
|
{Object.keys(quizSearchData.data)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue