diff --git a/app/(main)/lottery/active/page.tsx b/app/(main)/lottery/active/page.tsx index 37b57bb..b1a6097 100644 --- a/app/(main)/lottery/active/page.tsx +++ b/app/(main)/lottery/active/page.tsx @@ -1,14 +1,18 @@ 'use client'; import { Queries } from '@/api/queries'; +import Loader from '@/components/Loader'; import LotteryWinnersSection from '@/components/lottery/LotteryWinnersSection'; import LotteryCountDown from '@/components/lottery/countDown/LotteryCountDown'; +import LotteryCountDownAllert from '@/components/lottery/countDown/countDownAllert/LotteryCountDownAllert'; +import LotteryForm from '@/components/lottery/form/LotteryForm'; +import LotteryRulesSection from '@/components/lottery/rules/LotteryRulesSection'; import { ILottery } from '@/models/lottery/lottery.model'; import Image from 'next/image'; import { useEffect, useState } from 'react'; const page = () => { - const [isLoading, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(true); const [data, setData] = useState(); const [lotteryStatus, setLotteryStatus] = useState<'not-started' | 'started' | 'ended'>( 'not-started', @@ -17,13 +21,18 @@ const page = () => { useEffect(() => { Queries.getLottery() .then((res) => { - setIsLoading(true); setData(res); }) .finally(() => setIsLoading(false)); }, []); - console.log(lotteryStatus); + if (isLoading) { + return ( +
+ +
+ ); + } return (
@@ -32,87 +41,80 @@ const page = () => {
-

- {data.data.title} -

-

- {data.data.description} -

-

- SMS-kod: {data.data.sms_code} -

+ {data.data.title && ( +

+ {data.data.title} +

+ )} + {data.data.description && ( +

+ {data.data.description} +

+ )} + {data.data.sms_code && ( +
+ + + + SMS-kod: {data.data.sms_code} +
+ )}
-
- banner -
- - {/* {lotteryStatus === 'started' || - (lotteryStatus === 'not-started' && ( - + banner - ))} */} +
+ )} - {lotteryStatus === 'not-started' || lotteryStatus === 'started' ? ( +
- ) : null} + +
)} - {lotteryStatus === 'started' || (lotteryStatus === 'ended' && )} - -
-
-
-

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, i) => ( -
  • - SMS = 1 manat -
  • - ))} -
-
-
-
-
+
+ {lotteryStatus === 'not-started' && ( + + )} + +
+ + ); }; diff --git a/app/globals.css b/app/globals.css index f57f9af..9cb0ba6 100644 --- a/app/globals.css +++ b/app/globals.css @@ -244,6 +244,10 @@ big { @apply -tracking-[1%] text-[14px] leading-[20px]; } +.font-xsmall-regular { + @apply -tracking-[1%] text-[12px] leading-[16px]; +} + .text-countdown { @apply font-roboto text-[60px] leading-[70px] -tracking-[1%]; } diff --git a/tailwind.config.js b/tailwind.config.js index 791418e..10bdaaa 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -83,6 +83,12 @@ export const theme = { lightOutline: '#777680', lightOutlineVariant: '#C7C5D0', lightPrimaryOutline: '#D8D6FF', + // Allert + lightInfoAllertContainer: '#E3F2FD', + lightOnInfoAllertContainer: '#1E3A5F', + lightOnWarningAllertContainer: '#F57C00', + lightWarningAllertContainer: '#FFF8E1', + lightWarningAllertContainerOutline: '#F9EDC8', }, fontSize: { // Display