Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Im Khem
authored and
Im Khem
committed
Jul 28, 2023
1 parent
c50b854
commit b3ec80f
Showing
5 changed files
with
87 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 24 additions & 26 deletions
50
src/refactor/ui/components/modals/create-green/air-drop.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
import React from 'react'; | ||
import { useMasa } from '../../../../provider'; | ||
import { SubflowPage } from '../../interface-subflow'; | ||
|
||
export const AirdropPage: React.FunctionComponent<SubflowPage> = ({ | ||
next, | ||
}: SubflowPage) => { | ||
const { useModalSize } = useMasa(); | ||
|
||
useModalSize?.({ width: 800, height: 400 }); | ||
import { useModal } from '@ebay/nice-modal-react'; | ||
import { Modal } from '../modal'; | ||
|
||
export const AirDropModal = () => { | ||
const modal = useModal(); | ||
return ( | ||
<div className="airdrop-interface"> | ||
<h2>100,000 $Masa Token Airdrop</h2> | ||
<div> | ||
<p> | ||
Earn 10 $MASA tokens for each new user you successfully refer to Masa | ||
</p> | ||
<p> | ||
Each friend you refer must mint a Masa Green SBT to be considered a | ||
successful referral | ||
</p> | ||
</div> | ||
<Modal> | ||
<section className="airdrop-interface"> | ||
<h2>100,000 $Masa Token Airdrop</h2> | ||
<div> | ||
<p> | ||
Earn 10 $MASA tokens for each new user you successfully refer to | ||
Masa | ||
</p> | ||
<p> | ||
Each friend you refer must mint a Masa Green SBT to be considered a | ||
successful referral | ||
</p> | ||
</div> | ||
|
||
<div className=""> | ||
<button className="masa-button" onClick={next}> | ||
Get verified to start referrals | ||
</button> | ||
</div> | ||
</div> | ||
<div className=""> | ||
<button className="masa-button" onClick={() => modal.resolve()}> | ||
Get verified to start referrals | ||
</button> | ||
</div> | ||
</section> | ||
</Modal> | ||
); | ||
}; |
41 changes: 15 additions & 26 deletions
41
src/refactor/ui/components/modals/create-green/create-green.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
import React from 'react'; | ||
|
||
import NiceModal from '@ebay/nice-modal-react'; | ||
import NiceModal, { useModal } from '@ebay/nice-modal-react'; | ||
import { Modal } from '../modal'; | ||
|
||
export const CreateGreenModal: React.FunctionComponent<SubflowPage> = | ||
NiceModal.create(() => { | ||
return ( | ||
<Modal> | ||
<div className="airdrop-interface"> | ||
<h2>100,000 $Masa Token Airdrop</h2> | ||
<div> | ||
<p> | ||
Earn 10 $MASA tokens for each new user you successfully refer to | ||
Masa | ||
</p> | ||
<p> | ||
Each friend you refer must mint a Masa Green SBT to be considered | ||
a successful referral | ||
</p> | ||
</div> | ||
export const CreateGreenModal = NiceModal.create(({ currentStep }) => { | ||
const steps = ['AirDrop', 'NotABot', 'PhoneNumber', 'Mint']; | ||
const modal = useModal(); | ||
|
||
<div className=""> | ||
<button className="masa-button"> | ||
Get verified to start referrals | ||
</button> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
}); | ||
return ( | ||
<Modal> | ||
<section> | ||
<h1>{steps[currentStep]}</h1> | ||
<br /> | ||
<br /> | ||
<button onClick={() => modal.resolve()}>Next</button> | ||
</section> | ||
</Modal> | ||
); | ||
}); |
29 changes: 29 additions & 0 deletions
29
src/refactor/ui/components/modals/create-green/not-a-bot-modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { useEffect } from 'react'; | ||
import NiceModal, { useModal } from '@ebay/nice-modal-react'; | ||
import { Modal } from '../modal'; | ||
|
||
const BOT_DISCLAIMER_TIMEOUT_SECONDS = 5; | ||
|
||
export const NotABotModal = () => { | ||
const modal = useModal(); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
modal.resolve(); | ||
}, BOT_DISCLAIMER_TIMEOUT_SECONDS * 1000); | ||
|
||
return () => clearTimeout(timer); | ||
}, [modal]); | ||
|
||
return ( | ||
<Modal> | ||
<section className="not-a-bot-interface"> | ||
<h2> | ||
To be eligible for Masa Green, we kindly ask that you prove you are | ||
not a bot. | ||
</h2> | ||
<p className="bot-icon">🤖</p> | ||
</section> | ||
</Modal> | ||
); | ||
}; |
16 changes: 16 additions & 0 deletions
16
src/refactor/ui/components/modals/create-green/use-green-modal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { useModal } from '@ebay/nice-modal-react'; | ||
import { CreateGreenModal } from './create-green'; | ||
|
||
export const useGreenModal = () => { | ||
const chainingModal = useModal(CreateGreenModal); | ||
|
||
const showChainingModal = async () => { | ||
for (let i = 0; i < 3; i++) { | ||
console.log({ i }); | ||
await chainingModal.show({ currentStep: i }); | ||
Check failure on line 11 in src/refactor/ui/components/modals/create-green/use-green-modal.ts GitHub Actions / Build, lint, and test on Node
|
||
await chainingModal.hide(); | ||
} | ||
}; | ||
return { showChainingModal }; | ||
}; |