Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Gamification #9966

Merged
merged 473 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
473 commits
Select commit Hold shift + click to select a range
d5e5006
feat: Update data
ChefMomota Jul 12, 2024
bf27b33
feat: Update wording
ChefMomota Jul 12, 2024
9830a19
feat: Update complete
ChefMomota Jul 12, 2024
741513d
feat: Update MultiSelect
ChefMomota Jul 12, 2024
e030d49
style: Update UI
ChefMomota Jul 12, 2024
5e97a76
feat: Update
ChefMomota Jul 12, 2024
9c34be2
feat: Update twitterFollow
ChefMomota Jul 15, 2024
bbfd5be
feat: Add getBlockExploreLink
ChefMomota Jul 15, 2024
ade84bf
feat: Link contact address
ChefMomota Jul 15, 2024
f67f599
feat: Update wording
ChefMomota Jul 15, 2024
7aafc4a
feat: Random pick profile
ChefMomota Jul 15, 2024
af24386
feat: Remove WithdrawRewardModal
ChefMomota Jul 15, 2024
cbb7f3d
feat: Move userInfo under /api
ChefMomota Jul 15, 2024
d4b73c7
feat: Add telegram log
ChefMomota Jul 15, 2024
031ff4f
fix: Build
ChefMomota Jul 15, 2024
f237f85
feat: Update twitterFollow
ChefMomota Jul 15, 2024
89a1645
feat: Add MakeProfileModal
ChefMomota Jul 16, 2024
5917ed0
feat: Add Chain icon and text
ChefMomota Jul 16, 2024
291be95
feat: Discord add token
ChefMomota Jul 16, 2024
5171f30
fix: Default chainId
ChefMomota Jul 16, 2024
5af3c5e
feat: Remove
ChefMomota Jul 16, 2024
9514f25
feat: Update status
ChefMomota Jul 16, 2024
fe32112
feat: Typo
ChefMomota Jul 16, 2024
5e86ecc
feat: Update to network chain
ChefMomota Jul 16, 2024
e1f8af7
feat: startDateTime and endDateTime change to seconds
ChefMomota Jul 16, 2024
28e0f88
feat: Add data
ChefMomota Jul 16, 2024
9687b1b
fix: Connect social problem
ChefMomota Jul 16, 2024
59bb0bb
fix: disconnectSocial
ChefMomota Jul 16, 2024
792f434
feat: Add random connect twitter account
ChefMomota Jul 16, 2024
97d3292
feat: Update handleVerifyButton
ChefMomota Jul 16, 2024
607bed1
feat: Add reward contract
ChefMomota Jul 17, 2024
25b8b62
fix: Time issue
ChefMomota Jul 17, 2024
1376321
feat: Update contractChainId
ChefMomota Jul 17, 2024
96271e8
feat: Only available for Draft status
ChefMomota Jul 17, 2024
b733e2e
feat: add check
ChefMomota Jul 17, 2024
a401307
feat: Add telegram check
ChefMomota Jul 17, 2024
01f844b
feat: Test
ChefMomota Jul 17, 2024
ea4bf04
feat: Update token
ChefMomota Jul 17, 2024
389bfb8
feat: Remove crypto-js
ChefMomota Jul 17, 2024
8cfac4e
feat: Add Enable button for create reward
ChefMomota Jul 17, 2024
cdacacd
feat: Can't update reward
ChefMomota Jul 17, 2024
ee53571
feat: Add isSaveAndAddReward button
ChefMomota Jul 17, 2024
2e9bdca
feat: Update icon
ChefMomota Jul 17, 2024
c9296dc
feat: Remove unused code
ChefMomota Jul 17, 2024
ff6e54f
feat: Add create quest reward
ChefMomota Jul 18, 2024
1b34b0e
feat: Done connect user claim reward contract
ChefMomota Jul 18, 2024
3ce3998
feat: Add twitter liked API
ChefMomota Jul 18, 2024
a53cee5
feat: Rename
ChefMomota Jul 18, 2024
ba0d945
feat: Update wording
ChefMomota Jul 18, 2024
8d31395
feat: Add chainNameConverter
ChefMomota Jul 19, 2024
3ae64f3
fix: Conflict
ChefMomota Jul 22, 2024
09967f5
feat: Add status tag
ChefMomota Jul 20, 2024
f2331b4
feat: Add Empty Reward
ChefMomota Jul 20, 2024
5bb6166
feat: Add task only for draf status
ChefMomota Jul 20, 2024
2d8b4e4
feat: Update new UI for Save
ChefMomota Jul 20, 2024
1881af3
feat: Hide reward
ChefMomota Jul 22, 2024
096a13a
feat: Update submit
ChefMomota Jul 22, 2024
cc3fc04
fix: No reward
ChefMomota Jul 22, 2024
554280b
feat: Update UI
ChefMomota Jul 22, 2024
286f0e3
feat: Update Questers
ChefMomota Jul 22, 2024
96ac296
feat: Update text
ChefMomota Jul 22, 2024
649d305
fix: Enough completed
ChefMomota Jul 22, 2024
a83b39e
feat: Update name
ChefMomota Jul 22, 2024
62928fc
feat: Update Task
ChefMomota Jul 22, 2024
70b1b3d
fix: Bug
ChefMomota Jul 22, 2024
7b649f7
feat: Add taskId
ChefMomota Jul 22, 2024
519defa
fix: Native token address
ChefMomota Jul 22, 2024
a14154c
fix: Build
ChefMomota Jul 22, 2024
7f841a7
fix: Build
ChefMomota Jul 22, 2024
71240e0
fix: Number
ChefMomota Jul 22, 2024
b5348b6
fix: Percentage
ChefMomota Jul 22, 2024
d424d55
feat: Update profile contract
ChefMomota Jul 22, 2024
d22a949
feat: Set minDate for End Date
ChefMomota Jul 22, 2024
a183578
feat: Update to taskId
ChefMomota Jul 22, 2024
cfbe169
feat: Update
ChefMomota Jul 22, 2024
0c7480c
feat: Update wording
ChefMomota Jul 23, 2024
dbc29d1
feat: Add needAddReward
ChefMomota Jul 23, 2024
d49a8c4
feat: Update fetchMarkTaskStatus
ChefMomota Jul 23, 2024
9f008ee
feat: Blog add title and description
ChefMomota Jul 23, 2024
c167443
feat: Update ConfirmDeleteModal
ChefMomota Jul 23, 2024
f2eaa1a
feat: Update Beta Logo
ChefMomota Jul 23, 2024
d4acc91
feat: Add no support text
ChefMomota Jul 23, 2024
8a5d399
feat: Update text
ChefMomota Jul 23, 2024
ce5f806
feat: Update
ChefMomota Jul 23, 2024
aa36ca1
fix: Decimals problem
ChefMomota Jul 23, 2024
4c613c8
feat: Update
ChefMomota Jul 23, 2024
336d2be
feat: totalRewardAmount to string
ChefMomota Jul 23, 2024
1b705c5
feat: Check twitter liked
ChefMomota Jul 24, 2024
a4191a7
feat: Twitter liked api with pagination
ChefMomota Jul 24, 2024
552caca
feat: Add stakePeriodInDays
ChefMomota Jul 24, 2024
b4297a2
feat: Reward amount send in wei
ChefMomota Jul 24, 2024
579e0c3
feat: Update getVerificationStatus
ChefMomota Jul 24, 2024
d27856e
feat: Convert minAmount
ChefMomota Jul 24, 2024
e61f33d
feat: Connect new profile setup
ChefMomota Jul 24, 2024
a768722
feat: Support 6 chains
ChefMomota Jul 24, 2024
2d985d5
feat: Add mark-task-status and merkle-proof
ChefMomota Jul 25, 2024
aab7485
feat: Update GetMerkleProofResponse
ChefMomota Jul 25, 2024
05b8425
feat: Complete new user social
ChefMomota Jul 25, 2024
c6803c9
feat: Update telegram
ChefMomota Jul 25, 2024
bf21153
feat: Add remove social
ChefMomota Jul 25, 2024
4187b08
feat: Add update key
ChefMomota Jul 25, 2024
715878d
feat: Update liquid minAmount
ChefMomota Jul 25, 2024
5236593
feat: Update telegram
ChefMomota Jul 25, 2024
fb54dce
feat: Update
ChefMomota Jul 25, 2024
863c0a2
feat: Remove updateUserInfo
ChefMomota Jul 25, 2024
68ad47d
feat: Update GetMerkleProofResponse
ChefMomota Jul 25, 2024
7424374
feat: Add error message
ChefMomota Jul 25, 2024
534a99b
feat: Add UnsupportNetworkModal
ChefMomota Jul 25, 2024
53b8ad1
feat: Update style
ChefMomota Jul 25, 2024
3399b24
feat: Revert minAmount
ChefMomota Jul 25, 2024
41941a8
feat: Add lottery type
ChefMomota Jul 25, 2024
ec4d2aa
feat: Add chains
ChefMomota Jul 26, 2024
bb0c156
feat: stakePeriodInDays is no option
ChefMomota Jul 26, 2024
86f1415
fix: Error modal
ChefMomota Jul 26, 2024
448d9c1
feat: Hold a token to wei
ChefMomota Jul 26, 2024
cdcc6b5
feat: Return BE message
ChefMomota Jul 26, 2024
1b019f0
feat: Update
ChefMomota Jul 26, 2024
3cc666b
fix: no user validation with dashboard write actions
chefjackson Jul 26, 2024
d8ffc0f
feat: Add photo_url
ChefMomota Jul 26, 2024
d6b99b3
fix: Blog verify
ChefMomota Jul 26, 2024
672cb4c
feat: Update telegram code
ChefMomota Jul 26, 2024
e93da0d
feat: Dont conver to type string
ChefMomota Jul 26, 2024
5dbfe1c
feat: Pass all data to Backend
ChefMomota Jul 26, 2024
6829bec
feat: Add error message
ChefMomota Jul 26, 2024
0afef91
feat: Add error message
ChefMomota Jul 26, 2024
5e57cff
feat: Convert to string
ChefMomota Jul 26, 2024
a88c52c
feat: Add log
ChefMomota Jul 26, 2024
c16ecbf
feat: try axios
ChefMomota Jul 26, 2024
66facf2
feat: test
ChefMomota Jul 26, 2024
3d0d04a
feat: test
ChefMomota Jul 26, 2024
3eeb005
feat: Add
ChefMomota Jul 26, 2024
26dc70a
feat: Add
ChefMomota Jul 26, 2024
00e7182
feat: Update
ChefMomota Jul 26, 2024
05e0702
feat: Update color
ChefMomota Jul 26, 2024
e72346c
feat: update tag color
ChefMomota Jul 26, 2024
b4ae470
fix: no auth check for dashboard read calls
chefjackson Jul 28, 2024
c34f1fc
chore: use replace instead
chefjackson Jul 28, 2024
28ff415
fix: build error
chefjackson Jul 28, 2024
35ab6ad
feat: Remove axios
ChefMomota Jul 28, 2024
aae95c4
feat: Handle when reward API fail
ChefMomota Jul 28, 2024
602470c
fix: incorrect display if not signed in
chefjackson Jul 29, 2024
3cd343a
fix: only allow to complete web page visiting task on fe
chefjackson Jul 29, 2024
3d81b47
chore: use middleware for siwe
chefjackson Jul 29, 2024
1d2a70a
chore: verify user identity before completing tasks
chefjackson Jul 29, 2024
a68d73f
chore: throw error if connect social failed
chefjackson Jul 29, 2024
82ec5a0
chore: fix build error
chefjackson Jul 29, 2024
58ff031
chore: remove unused variables
chefjackson Jul 29, 2024
084729b
fix: cannot verify twitter like
chefjackson Jul 29, 2024
35c8b0a
fix: invalid reward id to claim
chefjackson Jul 29, 2024
148421f
chore: add twitter verify api
chefjackson Jul 29, 2024
9a1b7ca
feat: Remove ownerAddress with lowercase
ChefMomota Jul 30, 2024
995cd8d
feat: Update Claim button and message logic
ChefMomota Jul 30, 2024
f2603e0
feat: Update wording
ChefMomota Jul 30, 2024
a583fd4
feat: Add Switch Network
ChefMomota Jul 30, 2024
7c0e38d
fea: Add tag status
ChefMomota Jul 30, 2024
e9a33fb
feat: Update bug
ChefMomota Jul 30, 2024
f483fbd
feat: Update tag
ChefMomota Jul 30, 2024
bbe661c
fix: Quest status
ChefMomota Jul 30, 2024
a707510
feat: Add SuccessClaimedModal
ChefMomota Jul 30, 2024
2aad121
feat: Update claim button
ChefMomota Jul 30, 2024
a78331f
feat: Update claim button
ChefMomota Jul 30, 2024
55a92bc
feat: Add refreshProofData
ChefMomota Jul 30, 2024
8f8afc0
fix: failed to verify twitter like and follow
chefjackson Jul 30, 2024
4f0b2e1
chore: switch to use likes endpoint
chefjackson Jul 30, 2024
59df0dc
fix: user signature not popping up when switching accounts
chefjackson Jul 30, 2024
fc4a143
fix: only allow user to follow and like twitter after signin
chefjackson Jul 30, 2024
9239f22
fix: handleSave
ChefMomota Jul 30, 2024
3ad745d
feat: Remove save button in SCHEDULED
ChefMomota Jul 30, 2024
69ff353
fix: only allow to start quest after signing in
chefjackson Jul 30, 2024
1245ca8
feat: Update text
ChefMomota Jul 30, 2024
cde8433
feat: Update claim button
ChefMomota Jul 30, 2024
875c9b6
feat: Update refetchClaimedRewardAmount
ChefMomota Jul 30, 2024
0a38eed
feat: Update reward
ChefMomota Jul 30, 2024
0761fe8
feat: Update claim button
ChefMomota Jul 30, 2024
355025a
fix: multiple signin requests
chefjackson Jul 30, 2024
0418966
feat: Update claim button
ChefMomota Jul 30, 2024
7b63a3c
feat: Typo
ChefMomota Jul 30, 2024
7b69a64
feat: Update ClaimButton
ChefMomota Jul 30, 2024
62dfc24
feat: add expiration time to siwe
chefjackson Jul 30, 2024
2fcc03f
fix: build error
chefjackson Jul 30, 2024
6190a8f
feat: Add twitterRetweet
ChefMomota Jul 30, 2024
80bdeee
fix: Build
ChefMomota Jul 30, 2024
015a8e2
feat: Revert jackson commit
ChefMomota Jul 30, 2024
8c7a940
feat: Remove QA button
ChefMomota Jul 30, 2024
d8d5673
fix: Retweet issue
ChefMomota Jul 30, 2024
5782199
fix: Native token swap url
ChefMomota Jul 30, 2024
b734ea1
feat: Add handle task error
ChefMomota Jul 30, 2024
3e75a7f
fix: Retweet
ChefMomota Jul 30, 2024
dec8fa9
feat: Add await
ChefMomota Jul 30, 2024
c63ff58
feat: Done retweet
ChefMomota Jul 30, 2024
554793f
fix: Social multi sign issue
ChefMomota Jul 30, 2024
9dcbe96
fix: Social multi sign issue
ChefMomota Jul 30, 2024
1650ac9
feat: Update questReward
ChefMomota Jul 30, 2024
28a3ad5
feat: Update useReadRewardContract
ChefMomota Jul 30, 2024
b4865f7
feat: Block endDateTime is less then current time
ChefMomota Jul 30, 2024
d44931b
feat: Swap url redirect to output
ChefMomota Jul 31, 2024
2c4ba83
fix: Build
ChefMomota Jul 31, 2024
6bb9b2b
feat: Reward only accept picked network
ChefMomota Jul 31, 2024
feffe1b
feat: Update quest url
ChefMomota Jul 31, 2024
3a0527e
feat: Update claim buttton
ChefMomota Jul 31, 2024
d893fb5
fix: Add reward bug
ChefMomota Jul 31, 2024
faf84a6
fix: Reward chain
ChefMomota Jul 31, 2024
a21a87d
fix: onlyAcceptChains
ChefMomota Jul 31, 2024
3b118d2
fix: onlyAcceptChains
ChefMomota Jul 31, 2024
af915b3
feat: Profile add switch network button
ChefMomota Jul 31, 2024
c787579
feat: Update Css
ChefMomota Jul 31, 2024
361a7fe
feat: Add zkevm
ChefMomota Jul 31, 2024
30c924c
feat: Update switch network ui
ChefMomota Jul 31, 2024
ae3e5f6
feat: Update Claim button
ChefMomota Jul 31, 2024
3e464c6
feat: Update code
ChefMomota Jul 31, 2024
cb717b4
feat: Update placeholder name
ChefMomota Jul 31, 2024
3e55d69
feat: Revert back emptyUserSocialInfo
ChefMomota Jul 31, 2024
f4b05d9
feat: Use SUPPORT_ONLY_BSC
ChefMomota Jul 31, 2024
c2e134d
feat: Remove profile creation fee
ChefMomota Jul 31, 2024
4aaf6f2
chore: add twitter id validation check
chefjackson Jul 31, 2024
4278d0e
feat: Update profile
ChefMomota Jul 31, 2024
6e91c27
feat: trim accountId
ChefMomota Jul 31, 2024
a3a4b51
feat: Hide when lowestPrice is zero
ChefMomota Aug 1, 2024
9b1750c
feat: Add Nft profile check
ChefMomota Aug 1, 2024
086aec1
feat: Update social task layout
ChefMomota Aug 1, 2024
47a44af
feat: Remove activity tab and achievements
ChefMomota Aug 1, 2024
006fd03
fix: NFT API issue
ChefMomota Aug 1, 2024
e498479
feat: Remove sell button
ChefMomota Aug 1, 2024
b18c8c9
fix: Missing token image
ChefMomota Aug 1, 2024
04cd25d
feat: Hide error message
ChefMomota Aug 1, 2024
7544a73
feat: Show error
ChefMomota Aug 1, 2024
80922ad
fix: Claim button
ChefMomota Aug 1, 2024
e52b68c
fix: Claim reward
ChefMomota Aug 1, 2024
9f2c01b
feat: Update swap placeholder
ChefMomota Aug 1, 2024
b4642e1
feat: Task input able to draft
ChefMomota Aug 2, 2024
4223907
feat: Disabled title and desc
ChefMomota Aug 2, 2024
317094a
feat: Update icon
ChefMomota Aug 2, 2024
1f5f8c8
feat: Add address
ChefMomota Aug 2, 2024
2206e97
fix: Wallet conenct issue
ChefMomota Aug 5, 2024
bd46b5f
fix: Build
ChefMomota Aug 5, 2024
4778619
feat: Update prod api
ChefMomota Aug 5, 2024
c7f1ef1
feat: API url
ChefMomota Aug 5, 2024
88c6692
feat: Revert back API
ChefMomota Aug 5, 2024
2a72f19
fix: Wallet issue
ChefMomota Aug 5, 2024
b637210
feat: Update nav
ChefMomota Aug 5, 2024
07adc87
fix: Logo size
ChefMomota Aug 5, 2024
08b0f1a
feat: add param validation
chefjackson Aug 5, 2024
51fb560
fix: Eslint
ChefMomota Aug 5, 2024
b2782ab
fix: Profile router
ChefMomota Aug 5, 2024
a0bb57d
feat: New bunnyFactory contract and API
ChefMomota Aug 5, 2024
ffb7bbc
feat: Update
ChefMomota Aug 5, 2024
c2d928c
feat: Update
ChefMomota Aug 5, 2024
fa1204e
feat: Test TWITTER_ID_2
ChefMomota Aug 5, 2024
949f393
feat: Revert back TWITTER_ID_3
ChefMomota Aug 5, 2024
16a9df8
feat: Update token image
ChefMomota Aug 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file added apps/gamification/.env
Empty file.
41 changes: 41 additions & 0 deletions apps/gamification/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"env": {
"es6": true,
"browser": true
},
"extends": ["plugin:@next/next/recommended", "../../packages/eslint-config/lib/next-page-router.js"],
"rules": {
"no-empty-function": 0,
"no-restricted-syntax": 0,
"import/no-unresolved": 0,
"no-console": ["warn", { "allow": ["info", "warn", "error", "debug", "time", "timeLog", "timeEnd"] }],
"no-plusplus": 0,
"prefer-destructuring": ["warn", { "object": true, "array": false }],
"no-underscore-dangle": 0,
"lodash/import-scope": [2, "method"],
"@next/next/no-img-element": 0,
"no-sparse-arrays": 0,
"react-hooks/exhaustive-deps": [
"warn",
{
"additionalHooks": "(useFastRefreshEffect|useSlowRefreshEffect)"
}
],
// Start temporary rules
// These rules are here just to keep the lint error to 0 during the migration to the new rule set
// They need to be removed and fixed as soon as possible
"@typescript-eslint/ban-ts-comment": [1, { "ts-ignore": false, "ts-nocheck": false }],
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"radix": 0,
"import/no-extraneous-dependencies": 0,
"jsx-a11y/media-has-caption": 0,
// Exchange
"no-param-reassign": ["error", { "props": true, "ignorePropertyModificationsFor": ["state", "memo"] }],
"react/require-default-props": 0,
"no-nested-ternary": 0,
"max-classes-per-file": 0
// End temporary rules
}
}
144 changes: 144 additions & 0 deletions apps/gamification/components/ApproveConfirmButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import { useTranslation } from '@pancakeswap/localization'
import { AutoRenewIcon, Box, ChevronDownIcon, ChevronRightIcon, Flex, Button as UIKitButton } from '@pancakeswap/uikit'
import { styled } from 'styled-components'

export enum ButtonArrangement {
ROW = 'row',
SEQUENTIAL = 'sequential',
}

interface ApproveConfirmButtonsProps {
isApproveDisabled: boolean
isApproving: boolean
isConfirming: boolean
isConfirmDisabled: boolean
onApprove: () => void
onConfirm: () => void
buttonArrangement?: ButtonArrangement
confirmLabel?: string
confirmId?: string
useMinWidth?: boolean
}

const StyledApproveConfirmButtonRow = styled.div`
align-items: center;
display: grid;
grid-template-columns: 1fr;
justify-content: center;

${({ theme }) => theme.mediaQueries.md} {
grid-template-columns: 1fr 24px 1fr;
}
`

const Button = styled(UIKitButton)<{ useMinWidth?: boolean }>`
width: 100%;

${({ theme }) => theme.mediaQueries.md} {
${({ useMinWidth }) =>
useMinWidth &&
`
min-width: 160px;
`}
}
`

const iconAttrs = { width: '24px', color: 'textDisabled' }

const ChevronRight = styled(ChevronRightIcon).attrs(iconAttrs)`
display: none;

${({ theme }) => theme.mediaQueries.md} {
display: block;
}
`

const ChevronBottom = styled(ChevronDownIcon).attrs(iconAttrs)`
display: block;

${({ theme }) => theme.mediaQueries.md} {
display: none;
}
`

const spinnerIcon = <AutoRenewIcon spin color="currentColor" />

const ApproveConfirmButtons: React.FC<React.PropsWithChildren<ApproveConfirmButtonsProps>> = ({
isApproveDisabled,
isApproving,
isConfirming,
isConfirmDisabled,
onApprove,
onConfirm,
buttonArrangement = ButtonArrangement.ROW,
confirmLabel,
confirmId,
useMinWidth = true,
}) => {
const { t } = useTranslation()
const confirmButtonText = confirmLabel ?? t('Confirm')

const ApproveConfirmRow = () => {
return (
<StyledApproveConfirmButtonRow>
<Box>
<Button
disabled={isApproveDisabled}
onClick={onApprove}
endIcon={isApproving ? spinnerIcon : undefined}
isLoading={isApproving}
useMinWidth={useMinWidth}
>
{isApproving ? t('Enabling') : t('Enable')}
</Button>
</Box>
<Flex justifyContent="center">
<ChevronRight />
<ChevronBottom />
</Flex>
<Box>
<Button
id={confirmId}
onClick={onConfirm}
disabled={isConfirmDisabled}
isLoading={isConfirming}
endIcon={isConfirming ? spinnerIcon : undefined}
useMinWidth={useMinWidth}
>
{isConfirming ? t('Confirming') : confirmButtonText}
</Button>
</Box>
</StyledApproveConfirmButtonRow>
)
}

const ApproveConfirmSequential = () => {
return (
<>
{isApproveDisabled ? (
<Box>
<Button
id={confirmId}
onClick={onConfirm}
disabled={isConfirmDisabled}
isLoading={isConfirming}
endIcon={isConfirming ? spinnerIcon : undefined}
>
{isConfirming ? t('Confirming') : confirmButtonText}
</Button>
</Box>
) : (
<Box>
<Button onClick={onApprove} endIcon={isApproving ? spinnerIcon : undefined} isLoading={isApproving}>
{isApproving ? t('Enabling') : t('Enable')}
</Button>
</Box>
)}
</>
)
}

return buttonArrangement === ButtonArrangement.ROW ? ApproveConfirmRow() : ApproveConfirmSequential()
}

export default ApproveConfirmButtons
55 changes: 55 additions & 0 deletions apps/gamification/components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Box, BoxProps } from '@pancakeswap/uikit'
import { styled } from 'styled-components'

export interface LightCardProps extends BoxProps {
width?: string
padding?: string | string[]
border?: string
borderRadius?: string
}

const Card = styled(Box)<LightCardProps>`
width: ${({ width }) => width ?? '100%'};
padding: ${({ padding }) => padding ?? '1.25rem'};
border: ${({ border }) => border};
border-radius: ${({ borderRadius }) => borderRadius ?? '16px'};
background-color: ${({ theme }) => theme.colors.background};
`

export default Card

export const LightCard = styled(Card)`
border: 1px solid ${({ theme }) => theme.colors.cardBorder};
background-color: ${({ theme }) => theme.colors.backgroundAlt};
`

export const LightGreyCard = styled(Card)`
border: 1px solid ${({ theme }) => theme.colors.cardBorder};
background-color: ${({ theme }) => theme.colors.background};
`

export const CryptoCard = styled(Card)<{ isClicked: boolean; isDisabled: boolean; elementHeight: number }>`
border: 1px solid ${({ theme }) => theme.colors.cardBorder};
background-color: ${({ theme, isClicked }) => (isClicked ? theme.colors.input : theme.colors.background)};
transition: max-height 0.3s ease-in-out, background-color 0.1s ease-in-out;
max-height: ${({ isClicked, elementHeight }) => (isClicked ? `${elementHeight}px` : `105px`)};
overflow: hidden;
&:hover {
cursor: ${({ isDisabled }) => (isDisabled ? 'not-allowed' : 'pointer')};
pointer-events: ${({ isDisabled }) => (isDisabled ? 'none' : 'auto')};
}
`

export const GreyCard = styled(Card)`
background-color: ${({ theme }) => theme.colors.dropdown};
`

export const LightTertiaryCard = styled(Card)<{ active: boolean }>`
border: 1px solid ${({ theme, active }) => (active ? 'none' : theme.colors.cardBorder)};
background-color: ${({ theme }) => theme.colors.tertiary};
`

export const DisableCard = styled(Card)`
border: 1px solid ${({ theme }) => theme.colors.cardBorder};
background-color: ${({ theme }) => theme.colors.disabled};
`
3 changes: 2 additions & 1 deletion apps/gamification/components/ConnectWalletButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const ConnectWalletButton = ({ children, ...props }: ButtonProps) => {
{children || <Trans>Connect Wallet</Trans>}
</Button>
<style jsx global>{`
w3m-modal {
w3m-modal,
wcm-modal {
position: relative;
z-index: 99;
}
Expand Down
Loading
Loading