Skip to content

Commit 7b1dfff

Browse files
authored
feat(treasury-grant): add new batch of users (#2537)
* feat(treasury-grant): add new batch of users * feat: update UI
1 parent 8d8b7a4 commit 7b1dfff

File tree

6 files changed

+87681
-87592
lines changed

6 files changed

+87681
-87592
lines changed

src/pages/ElasticSnapshot/components/ChooseGrantModal.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ export default function ChooseGrantModal({
5252
// C: t`Opt out.`,
5353
}
5454

55+
const accountOnlyOptionB = [
56+
'0x3872afe887ced05d353252a88a2acebdacda5071',
57+
'0x87b1594e6e8b8fee7b14cd77a5c2324e31a7bcd4',
58+
'0x2244cfdb499a05c8f08a548f75a13c7485fe9433',
59+
'0xee2147fcf090ce08095e65a3c9e193c459364d5b',
60+
'0x00e6bc5f73ef330c5f553554dcec8a863db84a23',
61+
'0xcab9760e56bfd28803b41cac1e6616704aa5ecce',
62+
'0xd5c6519a51a840398c4444c2fbd9d34820baa10c',
63+
]
64+
5565
const [loading, setLoading] = useState(false)
5666
const [selectedOption, setSelectedOption] = useState(userSelectedOption || '')
5767
useEffect(() => {
@@ -131,12 +141,13 @@ export default function ChooseGrantModal({
131141

132142
<Flex flexDirection="column" sx={{ gap: '12px' }} marginTop="24px">
133143
{Object.keys(options).map(opt => {
144+
const disabled = opt === 'A' && accountOnlyOptionB.includes(account?.toLowerCase())
134145
return (
135146
<Option
136147
key={opt}
137-
onClick={() => !loading && !userSelectedOption && setSelectedOption(opt)}
148+
onClick={() => !disabled && !loading && !userSelectedOption && setSelectedOption(opt)}
138149
active={selectedOption === opt}
139-
disabled={!!userSelectedOption}
150+
disabled={!!userSelectedOption || disabled}
140151
role="button"
141152
>
142153
<Opt active={selectedOption === opt}>{opt}</Opt>

src/pages/ElasticSnapshot/components/SelectTreasuryGrant.tsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { ExternalLink, MEDIA_WIDTHS } from 'theme'
2727
import { formatDisplayNumber } from 'utils/numbers'
2828

2929
import vesting3rdData from '../data/pendle_dappos_vesting.json'
30+
import phase3 from '../data/phase3.json'
3031
import vestingData from '../data/vesting.json'
3132
import vestingOptionA from '../data/vesting/optionA.json'
3233
import vestingOptionB from '../data/vesting/optionB.json'
@@ -63,7 +64,9 @@ const MANUAL_KYCS = [
6364

6465
export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveVestingData: boolean }) {
6566
const theme = useTheme()
67+
6668
const { account, chainId } = useActiveWeb3React()
69+
const phase3Info = phase3.find(item => item.receiver.toLowerCase() === account?.toLowerCase())
6770
const [showOptionModal, setShowOptionsModal] = useState(false)
6871

6972
const addressesOptionA = vestingOptionA.map(item => item.claimData.receiver.toLowerCase())
@@ -244,7 +247,7 @@ export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveV
244247
<Trans>TOTAL AMOUNT (USD)</Trans>
245248
</Text>
246249
<Text fontWeight="500" fontSize={upToMedium ? 16 : 20}>
247-
{isTotalNull ? 'N/A' : format(totalValue)}
250+
{phase3Info ? format(phase3Info.value) : isTotalNull ? 'N/A' : format(totalValue)}
248251
</Text>
249252
</Flex>
250253
<VerticalDivider style={{ height: '100%' }} />
@@ -258,7 +261,7 @@ export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveV
258261
<Trans>Phase 1</Trans>
259262
</Text>
260263
<Text fontWeight="500" fontSize={upToMedium ? 16 : 20}>
261-
{format(userData?.value || 0)}
264+
{phase3Info ? format(phase3Info.vestedAmount || 0) : format(userData?.value || 0)}
262265
</Text>
263266
</Flex>
264267
<VerticalDivider style={{ height: '80%' }} />
@@ -275,6 +278,24 @@ export default function SelectTreasuryGrant({ userHaveVestingData }: { userHaveV
275278
{isNull ? 'N/A' : format(totalPhase2Value || 0)}
276279
</Text>
277280
</Flex>
281+
{phase3Info && (
282+
<>
283+
<VerticalDivider style={{ height: '80%' }} />
284+
<Flex
285+
flexDirection="column"
286+
justifyContent="space-between"
287+
sx={{ gap: '16px' }}
288+
marginX={upToMedium ? '12px' : '24px'}
289+
>
290+
<Text fontSize="14px" color={theme.subText} lineHeight="20px">
291+
<Trans>Phase 3</Trans>
292+
</Text>
293+
<Text fontWeight="500" fontSize={upToMedium ? 16 : 20}>
294+
{format(phase3Info.value - (phase3Info.vestedAmount || 0))}
295+
</Text>
296+
</Flex>
297+
</>
298+
)}
278299
</Flex>
279300

280301
<Text fontSize={14} color={theme.subText} lineHeight={1.5}>

src/pages/ElasticSnapshot/components/Vesting.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ export interface VestingInterface {
9090
proof: string[]
9191
}
9292

93+
// wallets that request to change address due to compromise or loss
94+
// https://team-kyber.atlassian.net/browse/EX-2157
95+
const disableWallets = [
96+
'0xd1bbca0dfde1f51ccd17e33de1a7ead48faa1d68',
97+
'0x194eda5c8302bc8550e3e918b36520d138fba8ae',
98+
'0x12a2455cca45d8f6d9149f0e996260ae49eda8b4',
99+
]
100+
93101
export default function Vesting({
94102
userSelectedOption,
95103
userVestingData,
@@ -162,6 +170,8 @@ export default function Vesting({
162170

163171
const claimablePercent = unlockedPercent - claimedPercent
164172

173+
const isRemoved = disableWallets.includes(account?.toLowerCase() || '')
174+
165175
return (
166176
<>
167177
{show && proof && (
@@ -185,6 +195,11 @@ export default function Vesting({
185195
<Text as="span" fontWeight="500" color={theme.text}>
186196
{upToSmall && account ? shortenAddress(1, account) : account}
187197
</Text>
198+
{isRemoved && (
199+
<Text color={theme.subText} marginTop="8px">
200+
This wallet has been removed from Treasury Grant
201+
</Text>
202+
)}
188203
</Text>
189204
</Box>
190205

@@ -225,7 +240,7 @@ export default function Vesting({
225240
<ButtonPrimary
226241
width="64px"
227242
height="24px"
228-
disabled={claimableAmount === 0}
243+
disabled={claimableAmount === 0 || isRemoved}
229244
onClick={() => setShow(true)}
230245
>
231246
Claim

0 commit comments

Comments
 (0)