fix
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
export const COUNTDOWN_TARGET = new Date('2026-05-21T00:00:00').getTime()
|
|
||||||
export const USDT_RATE = 80.00
|
export const USDT_RATE = 80.00
|
||||||
export const GAS_PRICE = 21.00
|
export const GAS_PRICE = 21.00
|
||||||
export const MIN_RUB_AMOUNT = 5000
|
export const MIN_RUB_AMOUNT = 5000
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ROUTES } from '@shared/config/routes'
|
|||||||
import styles from './Footer.module.css'
|
import styles from './Footer.module.css'
|
||||||
|
|
||||||
const SOCIALS = [
|
const SOCIALS = [
|
||||||
{ href: '#', icon: telegram, label: 'Telegram' },
|
{ href: 'https://t.me/+UU4vqX4ENMJhMjBi', icon: telegram, label: 'Telegram' },
|
||||||
{ href: '#', icon: whatsapp, label: 'WhatsApp' },
|
{ href: '#', icon: whatsapp, label: 'WhatsApp' },
|
||||||
{ href: '#', icon: instagram, label: 'Instagram' },
|
{ href: '#', icon: instagram, label: 'Instagram' },
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
import { useEffect, useState } from 'react'
|
|
||||||
|
|
||||||
export interface CountdownValue {
|
|
||||||
d: string
|
|
||||||
h: string
|
|
||||||
m: string
|
|
||||||
s: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useCountdown(target: number): CountdownValue {
|
|
||||||
const [now, setNow] = useState<number>(Date.now())
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const id = setInterval(() => setNow(Date.now()), 1000)
|
|
||||||
return () => clearInterval(id)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const diff = Math.max(0, target - now)
|
|
||||||
const pad = (n: number) => String(n).padStart(2, '0')
|
|
||||||
|
|
||||||
return {
|
|
||||||
d: pad(Math.floor(diff / 86_400_000)),
|
|
||||||
h: pad(Math.floor((diff % 86_400_000) / 3_600_000)),
|
|
||||||
m: pad(Math.floor((diff % 3_600_000) / 60_000)),
|
|
||||||
s: pad(Math.floor((diff % 60_000) / 1000)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import { useCountdown } from '../lib/useCountdown'
|
|
||||||
import styles from './Countdown.module.css'
|
|
||||||
|
|
||||||
const UNITS: Array<['d' | 'h' | 'm' | 's', string]> = [
|
|
||||||
['d', 'ДНЕЙ'],
|
|
||||||
['h', 'ЧАСОВ'],
|
|
||||||
['m', 'МИНУТ'],
|
|
||||||
['s', 'СЕКУНД'],
|
|
||||||
]
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
target: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Countdown({ target }: Props) {
|
|
||||||
const cd = useCountdown(target)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className={styles.label}>ДО ЗАПУСКА ОСТАЛОСЬ</div>
|
|
||||||
<div className={styles.row}>
|
|
||||||
{UNITS.map(([key, label]) => (
|
|
||||||
<div key={key} className={styles.unit}>
|
|
||||||
<div className={styles.num}>{cd[key]}</div>
|
|
||||||
<div className={styles.lbl}>{label}</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
import { COUNTDOWN_TARGET } from '@shared/config/constants'
|
|
||||||
import { ConversionFlow } from './ConversionFlow'
|
import { ConversionFlow } from './ConversionFlow'
|
||||||
import { Countdown } from './Countdown'
|
|
||||||
import { ExchangeCard } from './ExchangeCard'
|
import { ExchangeCard } from './ExchangeCard'
|
||||||
import styles from './Hero.module.css'
|
import styles from './Hero.module.css'
|
||||||
|
|
||||||
@@ -31,7 +29,6 @@ export function Hero() {
|
|||||||
</span>
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
<div>
|
<div>
|
||||||
<Countdown target={COUNTDOWN_TARGET} />
|
|
||||||
<a href="#converter" className={styles.cta}>
|
<a href="#converter" className={styles.cta}>
|
||||||
Попробовать калькулятор
|
Попробовать калькулятор
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user