fix quiz[id] page error
This commit is contained in:
parent
a8c5dc79f0
commit
cb7cbb7ac9
|
|
@ -81,30 +81,30 @@ const QuizWinnerTable = ({ quizId, questionsData }: IProps) => {
|
||||||
<div className="table-desktop hidden sm:flex flex-col bg-fillTableHead rounded-[25px] shadow-quizButton overflow-hidden max-w-[1000px] w-full">
|
<div className="table-desktop hidden sm:flex flex-col bg-fillTableHead rounded-[25px] shadow-quizButton overflow-hidden max-w-[1000px] w-full">
|
||||||
{/* Table Head */}
|
{/* Table Head */}
|
||||||
<div className="flex border-b border-fillTableStrokeTableHead">
|
<div className="flex border-b border-fillTableStrokeTableHead">
|
||||||
{winnersData[0].client_id || quizSearchData?.data ? (
|
{winnersData[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>Ýeri</span>
|
<span>Ýeri</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData[0].phone || quizSearchData?.data ? (
|
{winnersData[0]?.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>Telefon beligisi</span>
|
<span>Telefon beligisi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData[0].answers.length || quizSearchData?.data ? (
|
{winnersData[0]?.answers.length || 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>Jogap beriş nobatlary</span>
|
<span>Jogap beriş nobatlary</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData[0].total_score_of_client || quizSearchData?.data ? (
|
{winnersData[0]?.total_score_of_client || quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[180px] 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-[180px] w-[100%] px-3 py-5">
|
||||||
<span>Nobatlaryň jemi</span>
|
<span>Nobatlaryň jemi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{winnersData[0].total_score_of_client || quizSearchData?.data ? (
|
{winnersData[0]?.total_score_of_client || quizSearchData?.data ? (
|
||||||
<div className="text-center flex justify-center items-center text-base text-textBlack leading-[125%] font-semibold max-w-[180px] 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-[180px] w-[100%] px-3 py-5">
|
||||||
<span>Utuklaryň jemi</span>
|
<span>Utuklaryň jemi</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -113,7 +113,7 @@ const QuizWinnerTable = ({ quizId, questionsData }: IProps) => {
|
||||||
|
|
||||||
{/* Table Body */}
|
{/* Table Body */}
|
||||||
<div className="">
|
<div className="">
|
||||||
{winnersData
|
{winnersData.length > 0
|
||||||
? winnersData.map((winner, id) => (
|
? winnersData.map((winner, id) => (
|
||||||
<div
|
<div
|
||||||
className={`flex border-b border-fillTableStrokeTableRow ${
|
className={`flex border-b border-fillTableStrokeTableRow ${
|
||||||
|
|
@ -262,24 +262,24 @@ const QuizWinnerTable = ({ quizId, questionsData }: IProps) => {
|
||||||
<div className="sm:hidden flex flex-col bg-fillTableHead rounded-[13px] shadow-quizButton overflow-hidden max-w-[1000px] w-full">
|
<div className="sm:hidden flex flex-col bg-fillTableHead rounded-[13px] shadow-quizButton overflow-hidden max-w-[1000px] w-full">
|
||||||
{/* Table Head */}
|
{/* Table Head */}
|
||||||
<div className="flex border-b border-fillTableStrokeTableHead p-2 gap-[8px]">
|
<div className="flex border-b border-fillTableStrokeTableHead p-2 gap-[8px]">
|
||||||
{winnersData[0].client_id || quizSearchData?.data ? (
|
{winnersData[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>Ýeri</span>
|
<span>Ýeri</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData[0].phone || quizSearchData?.data ? (
|
{winnersData[0]?.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>Telefon beligisi</span>
|
<span>Telefon beligisi</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{winnersData[0].total_score_of_client || quizSearchData?.data ? (
|
{winnersData[0]?.total_score_of_client || 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>Nobatlaryň jemi </span>
|
<span>Nobatlaryň jemi </span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{winnersData[0].total_score_of_client || quizSearchData?.data ? (
|
{winnersData[0]?.total_score_of_client || 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>Utuklaryň jemi</span>
|
<span>Utuklaryň jemi</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -453,7 +453,7 @@ const QuizWinnerTable = ({ quizId, questionsData }: IProps) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{winnersData.length < winnersTotal && (
|
{winnersData.length < winnersTotal && !quizSearchData && (
|
||||||
<button
|
<button
|
||||||
onClick={() => getData(true)}
|
onClick={() => getData(true)}
|
||||||
className="py-[5px] px-[10px] rounded-md bg-blue-500 text-white border border-blue-500 lg:hover:bg-white lg:hover:text-blue-500 transition-all duration-300"
|
className="py-[5px] px-[10px] rounded-md bg-blue-500 text-white border border-blue-500 lg:hover:bg-white lg:hover:text-blue-500 transition-all duration-300"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue