From 4faa2afc1a1edb9984eac4b45aecfb85d4c5ee14 Mon Sep 17 00:00:00 2001 From: saml33 Date: Tue, 13 Jun 2023 13:01:01 +1000 Subject: [PATCH] add how it works modal --- components/rewards/RewardsPage.tsx | 83 +++++++++++++++++++++++++++++- components/shared/Modal.tsx | 4 +- 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/components/rewards/RewardsPage.tsx b/components/rewards/RewardsPage.tsx index b0cfb12d..b8d6d2ec 100644 --- a/components/rewards/RewardsPage.tsx +++ b/components/rewards/RewardsPage.tsx @@ -14,6 +14,7 @@ const tiers = ['Seed', 'Mango', 'Whale', 'Bot'] const RewardsPage = () => { // const { t } = useTranslation(['common', 'rewards']) const [showClaim] = useState(true) + const [showHowItWorks, setShowHowItWorks] = useState(false) return ( <>
@@ -50,11 +51,22 @@ const RewardsPage = () => { Earn points by performing actions on Mango. More points equals more chances to win.

- How it Works + setShowHowItWorks(true)} + > + How it Works +
- {showClaim ? : } + {!showClaim ? : } + {showHowItWorks ? ( + setShowHowItWorks(false)} + /> + ) : null} ) } @@ -465,3 +477,70 @@ const ClaimLossModal = ({ isOpen, onClose }: ModalProps) => { ) } + +const HowItWorksModal = ({ isOpen, onClose }: ModalProps) => { + return ( + <> + +

How it works

+

+ Mango Mints is a weekly rewards program with amazing prizes. Anyone + can participate simply by performing actions on Mango. +

+
    +
  1. + Each weekly cycle is called a Season and each Season has two + periods. +
  2. +
  3. + This first period is about earning points and runs from midnight + Sunday UTC to midnight Friday UTC. The second period is allocated to + claim prizes and runs from midnight Friday UTC to midnight Sunday + UTC. +
  4. +
  5. + Points are earned by performing actions on Mango. Actions may + include trading, swapping, placing orders and other transactions on + Mango. You'll know when you earn points but the formula is not + public. +
  6. +
  7. + There are 4 rewards tiers. Everyone starts in the Seed tier. After + your first Season is completed you'll be promoted to either the + Mango or Whale tier (depending on the average notional value of your + swaps/trades). If you miss a Season you'll be relegated to the + Seed tier. Bots are automatically assigned to the Bots tier. +
  8. +
  9. + At the end of each Season Loot Boxes are distributed based on the + amount of points earned relative to the other participants in your + tier. Boxes are not guaranteed to contain a prize but the more you + get, the more chances you have to win a prize. +
  10. +
  11. + During the claim period you can come back to this page and open your + loot boxes. Unclaimed prizes will be rolled over to the next Season. +
  12. +
  13. + Feel free to reach out to us on{' '} + + Discord + {' '} + with questions. +
  14. +
+ +
+ + ) +} diff --git a/components/shared/Modal.tsx b/components/shared/Modal.tsx index 2fc53607..f0ac3e91 100644 --- a/components/shared/Modal.tsx +++ b/components/shared/Modal.tsx @@ -8,6 +8,7 @@ type ModalProps = { fullScreen?: boolean isOpen: boolean onClose: () => void + panelClassNames?: string hideClose?: boolean } @@ -17,6 +18,7 @@ function Modal({ fullScreen = false, isOpen, onClose, + panelClassNames, hideClose, }: ModalProps) { const handleClose = () => { @@ -48,7 +50,7 @@ function Modal({ fullScreen ? '' : 'p-4 pt-6 sm:h-auto sm:max-w-md sm:rounded-lg sm:border sm:border-th-bkg-3 sm:p-6' - } relative `} + } relative ${panelClassNames}`} >
{children}
{!hideClose ? (