diff --git a/api/queries.ts b/api/queries.ts index 459c356..39394fa 100644 --- a/api/queries.ts +++ b/api/queries.ts @@ -231,4 +231,19 @@ export class Queries { }, ).then((res) => res.json().then((res) => res as MessagesByTvAdmin)); } + + // Lottery ================================================================================ + public static async getLottery(): Promise { + return await fetch(`${baseUrl.QUIZ_SRC}${routes.lotteryActive}`, { + next: { revalidate: 3600 }, + }).then((res) => res.json().then((res) => res as IAllVotes)); + } + + public static async getLotteryById(lottery_id: string): Promise { + return await fetch(`${baseUrl.QUIZ_SRC}${routes.lotteryId(lottery_id)}`, { + next: { revalidate: 3600 }, + }).then((res) => res.json().then((res) => res as IVote)); + } + + // ============================================================================================ } diff --git a/app/(main)/lottery/[lottery_id]/page.tsx b/app/(main)/lottery/[lottery_id]/page.tsx new file mode 100644 index 0000000..a8cc261 --- /dev/null +++ b/app/(main)/lottery/[lottery_id]/page.tsx @@ -0,0 +1,71 @@ +import LotteryWinnersSection from '@/components/lottery/LotteryWinnersSection'; +import LotteryCountDown from '@/components/lottery/countDown/LotteryCountDown'; +import Image from 'next/image'; + +interface IParams { + params: { + lottery_id: string; + }; +} + +const page = ({ params }: IParams) => { + return ( +
+
+
+
+

Bije

+
+ banner +
+ + +
+
+
+ + + +
+
+
+

Lotereýanyň duzgunleri:

+
+
+

Umumy düzgünler:

+
    + {Array(5) + .fill(' ') + .map((item, i) => ( +
  • + Ilkinji we dogry jogap beren sanawda ilkinji ýeri eýelýär +
  • + ))} +
+
+ +
+

Üns beriň:

+
    + {Array(1) + .fill(' ') + .map((item) => ( +
  • SMS = 1 manat
  • + ))} +
+
+
+
+
+
+
+ ); +}; + +export default page; diff --git a/app/(main)/(lottery)/lottery/page.tsx b/app/(main)/lottery/active/page.tsx similarity index 100% rename from app/(main)/(lottery)/lottery/page.tsx rename to app/(main)/lottery/active/page.tsx diff --git a/components/home/SmallSwiperVideos.tsx b/components/home/SmallSwiperVideos.tsx index 1f83c85..6ff3fc7 100644 --- a/components/home/SmallSwiperVideos.tsx +++ b/components/home/SmallSwiperVideos.tsx @@ -36,7 +36,7 @@ const SmallSwiperVideos = () => { } return ( -
+
{ }}> {/* PAY ATTENTION [data] is wrapped in an array */} - + {data?.data ? chooseRandomItems(data.data).map((item, index) => ( diff --git a/models/lottery/lottery.model.ts b/models/lottery/lottery.model.ts new file mode 100644 index 0000000..e69de29 diff --git a/routes.ts b/routes.ts index 8216ef5..1339c96 100644 --- a/routes.ts +++ b/routes.ts @@ -19,6 +19,11 @@ export default { vote: (vote_id: string) => `/voting/${vote_id}`, // ====================================================================== + // Lottery ================================================================ + lotteryActive: '/lottery/active', + lotteryId: (lottery_id: string) => `/lottery/${lottery_id}`, + // ====================================================================== + addPost: '/mahabat/order', news: '/pagination/new/posts', lastVideos: '/materials?per_page=30',