mango-v4-ui/components/rewards/PromoBanner.tsx

39 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-06-12 22:33:15 -07:00
import { IconButton } from '@components/shared/Button'
import { XMarkIcon } from '@heroicons/react/20/solid'
import { useIsWhiteListed } from 'hooks/useIsWhiteListed'
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)
const { data: isWhiteListed } = useIsWhiteListed()
const { data: seasonData } = useCurrentSeason()
return isWhiteListed && showBanner ? (
2023-06-12 22:33:15 -07:00
<div className="relative">
<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">
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"
>
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