-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Aaron Pepper <[email protected]>
- Loading branch information
1 parent
3ce039a
commit a4ed775
Showing
72 changed files
with
1,562 additions
and
932 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
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
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
28 changes: 28 additions & 0 deletions
28
src/containers/Airdrop/AirdropGiftTracker/AirdropGiftTracker.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,28 @@ | ||
import { useAirdropStore } from '@app/store/useAirdropStore'; | ||
import { Title, Wrapper, TitleWrapper } from './styles'; | ||
import LoggedOut from './sections/LoggedOut/LoggedOut'; | ||
import LoggedIn from './sections/LoggedIn/LoggedIn'; | ||
import { useAirdropSyncState } from '@app/hooks/airdrop/useAirdropSyncState'; | ||
import { useAppConfigStore } from '@app/store/useAppConfigStore'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export default function AirdropGiftTracker() { | ||
useAirdropSyncState(); | ||
const { t } = useTranslation(['airdrop'], { useSuspense: false }); | ||
const airdrop_ui_enabled = useAppConfigStore((s) => s.airdrop_ui_enabled); | ||
const { airdropTokens } = useAirdropStore(); | ||
|
||
if (!airdrop_ui_enabled) return null; | ||
|
||
const isLoggedIn = !!airdropTokens; | ||
|
||
return ( | ||
<Wrapper> | ||
<TitleWrapper> | ||
<Title>{t('airdropGame')}</Title> | ||
</TitleWrapper> | ||
|
||
{isLoggedIn ? <LoggedIn /> : <LoggedOut />} | ||
</Wrapper> | ||
); | ||
} |
86 changes: 86 additions & 0 deletions
86
src/containers/Airdrop/AirdropGiftTracker/components/Claimmodal/ClaimModal.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,86 @@ | ||
import { | ||
ActionWrapper, | ||
BoxWrapper, | ||
ClaimButton, | ||
Cover, | ||
Gem1, | ||
Gem2, | ||
Gem3, | ||
GemsWrapper, | ||
GemTextImage, | ||
ShareWrapper, | ||
StyledInput, | ||
Text, | ||
TextButton, | ||
TextWrapper, | ||
Title, | ||
Wrapper, | ||
} from './styles'; | ||
import gemImage from './images/gems.png'; | ||
import gemLargeImage from './images/gem-large.png'; | ||
import { useCallback, useState } from 'react'; | ||
import { GIFT_GEMS, useAirdropStore } from '@app/store/useAirdropStore'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
interface ClaimModalProps { | ||
onSubmit: (code?: string) => void; | ||
onClose: () => void; | ||
} | ||
|
||
export default function ClaimModal({ onSubmit, onClose }: ClaimModalProps) { | ||
const referralQuestPoints = useAirdropStore((state) => state.referralQuestPoints); | ||
const { t } = useTranslation(['airdrop'], { useSuspense: false }); | ||
|
||
const [claimCode, setClaimCode] = useState(''); | ||
|
||
const handleSubmit = useCallback(async () => { | ||
return onSubmit(claimCode); | ||
}, [claimCode, onSubmit]); | ||
|
||
return ( | ||
<Wrapper> | ||
<BoxWrapper initial={{ opacity: 0, y: '100px' }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0 }}> | ||
<GemsWrapper> | ||
<Gem1 src={gemLargeImage} alt="" /> | ||
<Gem2 src={gemLargeImage} alt="" /> | ||
<Gem3 src={gemLargeImage} alt="" /> | ||
</GemsWrapper> | ||
|
||
<TextWrapper> | ||
<Title> | ||
<Trans | ||
ns="airdrop" | ||
i18nKey="claimReferralCode" | ||
components={{ span: <span />, image: <GemTextImage src={gemImage} alt="" /> }} | ||
values={{ gems: referralQuestPoints?.pointsForClaimingReferral || GIFT_GEMS }} | ||
/> | ||
</Title> | ||
<Text> | ||
{t('claimReferralGifts', { gems: referralQuestPoints?.pointsForClaimingReferral || GIFT_GEMS })} | ||
</Text> | ||
</TextWrapper> | ||
<ActionWrapper> | ||
<ShareWrapper $isClaim> | ||
<StyledInput | ||
type="text" | ||
placeholder="Enter referral code" | ||
onChange={(e) => setClaimCode(e.target.value)} | ||
value={claimCode} | ||
/> | ||
{ | ||
// <Button color="primary" onClick={handleReferral}> | ||
// Claim | ||
// </Button> | ||
} | ||
</ShareWrapper> | ||
<ClaimButton onClick={handleSubmit}> {t('claimGems')} </ClaimButton> | ||
</ActionWrapper> | ||
<ActionWrapper> | ||
<TextButton onClick={onClose}>{t('doLater')}</TextButton> | ||
</ActionWrapper> | ||
</BoxWrapper> | ||
|
||
<Cover onClick={onClose} initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} /> | ||
</Wrapper> | ||
); | ||
} |
File renamed without changes
File renamed without changes
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
18 changes: 18 additions & 0 deletions
18
src/containers/Airdrop/AirdropGiftTracker/components/Gems/Gems.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,18 @@ | ||
import { Wrapper, Number, Label, GemImage } from './styles'; | ||
import gemImage from '../../images/gem.png'; | ||
|
||
interface Props { | ||
number: number; | ||
label: string; | ||
} | ||
|
||
export default function Gems({ number, label }: Props) { | ||
return ( | ||
<Wrapper> | ||
<Number> | ||
<GemImage src={gemImage} alt="" /> {number.toLocaleString()} | ||
</Number> | ||
<Label>{label}</Label> | ||
</Wrapper> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/containers/Airdrop/AirdropGiftTracker/components/Gems/styles.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,26 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled('div')` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
gap: 2px; | ||
`; | ||
|
||
export const Number = styled('div')` | ||
display: flex; | ||
align-items: center; | ||
gap: 2px; | ||
color: #000; | ||
font-size: 18px; | ||
font-weight: 600; | ||
`; | ||
|
||
export const Label = styled('div')` | ||
color: #797979; | ||
font-size: 12px; | ||
font-weight: 500; | ||
`; | ||
|
||
export const GemImage = styled('img')``; |
Oops, something went wrong.