2023-06-12 22:33:15 -07:00
|
|
|
import { IconButton } from '@components/shared/Button'
|
|
|
|
import { XMarkIcon } from '@heroicons/react/20/solid'
|
2023-07-11 15:48:05 -07:00
|
|
|
import { useIsWhiteListed } from 'hooks/useIsWhiteListed'
|
2023-09-25 04:33:34 -07:00
|
|
|
import { useCurrentSeason } from 'hooks/useRewards'
|
2023-06-12 22:33:15 -07:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { useState } from 'react'
|
|
|
|
|
|
|
|
const PromoBanner = () => {
|
|
|
|
const [showBanner, setShowBanner] = useState(true)
|
2023-07-11 15:48:05 -07:00
|
|
|
const { data: isWhiteListed } = useIsWhiteListed()
|
2023-09-25 04:33:34 -07:00
|
|
|
const { data: seasonData } = useCurrentSeason()
|
|
|
|
|
2023-07-11 15:48:05 -07:00
|
|
|
return isWhiteListed && showBanner ? (
|
2023-06-12 22:33:15 -07:00
|
|
|
<div className="relative">
|
2023-08-17 16:47:11 -07:00
|
|
|
<div className="flex flex-wrap items-center justify-center border-b border-th-bkg-3 bg-th-bkg-2 px-10 py-3">
|
2023-08-09 20:31:47 -07:00
|
|
|
<p className="mr-2 text-center text-th-fgd-1 lg:text-base">
|
2023-09-27 15:08:39 -07:00
|
|
|
Season {seasonData?.season_id} of Mango Mints is currently running.
|
2023-06-12 22:33:15 -07:00
|
|
|
</p>
|
|
|
|
<Link
|
|
|
|
className="bg-gradient-to-b from-mango-classic-theme-active to-mango-classic-theme-down bg-clip-text font-bold text-transparent lg:text-base"
|
|
|
|
href="/rewards"
|
|
|
|
>
|
2023-09-27 15:08:39 -07:00
|
|
|
Check your points
|
2023-06-12 22:33:15 -07:00
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
<IconButton
|
|
|
|
className="absolute right-0 top-1/2 -translate-y-1/2 sm:right-2"
|
|
|
|
hideBg
|
|
|
|
onClick={() => setShowBanner(false)}
|
|
|
|
size="medium"
|
|
|
|
>
|
|
|
|
<XMarkIcon className="h-5 w-5 text-th-fgd-3" />
|
|
|
|
</IconButton>
|
|
|
|
</div>
|
|
|
|
) : null
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PromoBanner
|