Skip to content

Commit 1fd69c3

Browse files
authored
Cleans up several screens in governance and token locking (#918)
* removes the IOT/MOBILE/HNT network bar in governance pages, proxy pages, etc. You can't get there any more directly. * removes it also in the assign proxy screen
1 parent 3ed19cf commit 1fd69c3

File tree

7 files changed

+15
-158
lines changed

7 files changed

+15
-158
lines changed

src/features/governance/AssignProxyScreen.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ import BackScreen from '@components/BackScreen'
22
import Box from '@components/Box'
33
import ButtonPressable from '@components/ButtonPressable'
44
import CircleLoader from '@components/CircleLoader'
5-
import { Select } from '@components/Select'
65
import Text from '@components/Text'
76
import {
87
batchInstructionsToTxsWithPriorityFee,
98
bulkSendTransactions,
10-
HNT_MINT,
11-
IOT_MINT,
12-
MOBILE_MINT,
139
populateMissingDraftInfo,
1410
toVersionedTx,
1511
truthy,
@@ -50,14 +46,7 @@ export const AssignProxyScreen = () => {
5046
const { wallet, position } = route.params
5147
const { t } = useTranslation()
5248
const [proxyWallet, setProxyWallet] = useState(wallet)
53-
const { loading, positions, refetch, mint } = useGovernance()
54-
const networks = useMemo(() => {
55-
return [
56-
{ label: 'HNT', value: HNT_MINT.toBase58() },
57-
{ label: 'MOBILE', value: MOBILE_MINT.toBase58() },
58-
{ label: 'IOT', value: IOT_MINT.toBase58() },
59-
]
60-
}, [])
49+
const { loading, positions, refetch } = useGovernance()
6150

6251
const unproxiedPositions = useMemo(
6352
() =>
@@ -240,20 +229,6 @@ export const AssignProxyScreen = () => {
240229
/>
241230
</Box>
242231

243-
{/* Don't show network when position already defined */}
244-
{position ? null : (
245-
<Box mb="m">
246-
<Text variant="body3" color="secondaryText" mb="xs">
247-
{t('gov.assignProxy.selectNetwork')}
248-
</Text>
249-
<Select
250-
title={t('gov.assignProxy.selectNetwork')}
251-
value={mint.toBase58()}
252-
onValueChange={(pk) => navigation.setParams({ mint: pk })}
253-
options={networks}
254-
/>
255-
</Box>
256-
)}
257232
<Box flexDirection="row" justifyContent="space-between">
258233
<Text variant="body1" color="white" opacity={0.5}>
259234
{t('gov.assignProxy.assignPositions')}

src/features/governance/GovernanceWrapper.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
GovernanceStackParamList,
2121
} from './governanceTypes'
2222
import { useSetTab } from './useSetTab'
23-
import { NetworkTabs } from './NetworkTabs'
2423

2524
const icons: { [key: string]: React.ReactElement } = {
2625
proposals: <Flag width={16} height={16} color="white" />,
@@ -92,9 +91,6 @@ export const GovernanceWrapper: React.FC<
9291
<Text marginTop="m" alignSelf="center" variant="h4">
9392
{t('gov.title')}
9493
</Text>
95-
<Box mt="xl" mb="l">
96-
<NetworkTabs />
97-
</Box>
9894
{loading ? (
9995
<Box paddingHorizontal="m" mt="xxl" flexDirection="column" flex={1}>
10096
<CircleLoader loaderSize={24} color="white" />

src/features/governance/NetworkTabs.tsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/features/governance/PositionsScreen.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -269,21 +269,21 @@ export const PositionsScreen = () => {
269269
</Box>
270270
)}
271271
<Box flexDirection="row" padding="m">
272-
<ButtonPressable
273-
flex={1}
274-
fontSize={16}
275-
borderRadius="round"
276-
borderWidth={2}
277-
borderColor="white"
278-
backgroundColorOpacityPressed={0.7}
279-
title={t('gov.transactions.lockTokens')}
280-
titleColor="white"
281-
titleColorPressed="black"
282-
onPress={() => setIsLockModalOpen(true)}
283-
disabled={claimingAllRewards || loading || !mint.equals(HNT_MINT)}
284-
/>
285272
{HNT_MINT.equals(mint) && (
286273
<>
274+
<ButtonPressable
275+
flex={1}
276+
fontSize={16}
277+
borderRadius="round"
278+
borderWidth={2}
279+
borderColor="white"
280+
backgroundColorOpacityPressed={0.7}
281+
title={t('gov.transactions.lockTokens')}
282+
titleColor="white"
283+
titleColorPressed="black"
284+
onPress={() => setIsLockModalOpen(true)}
285+
disabled={claimingAllRewards || loading}
286+
/>
287287
<Box paddingHorizontal="s" />
288288
<ButtonPressable
289289
flex={1}

src/features/governance/ProxyScreen.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import BN from 'bn.js'
1818
import React, { useCallback, useMemo } from 'react'
1919
import { useTranslation } from 'react-i18next'
2020
import { Image } from 'react-native'
21-
import { NetworkTabs } from './NetworkTabs'
2221
import { VoteHistory } from './VoteHistory'
2322
import { ProxyCardStat } from './ProxyCardStat'
2423
import {
@@ -286,10 +285,6 @@ export const ProxyScreen = () => {
286285
borderBottomColor="dividerGrey"
287286
borderBottomWidth={1}
288287
/>
289-
290-
<Box mb="m">
291-
<NetworkTabs />
292-
</Box>
293288
</>
294289
}
295290
/>

src/features/governance/RevokeProxyScreen.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ import BackScreen from '@components/BackScreen'
22
import Box from '@components/Box'
33
import ButtonPressable from '@components/ButtonPressable'
44
import CircleLoader from '@components/CircleLoader'
5-
import { Select } from '@components/Select'
65
import Text from '@components/Text'
76
import {
87
batchInstructionsToTxsWithPriorityFee,
98
bulkSendTransactions,
10-
HNT_MINT,
11-
IOT_MINT,
12-
MOBILE_MINT,
139
populateMissingDraftInfo,
1410
toVersionedTx,
1511
truthy,
@@ -51,14 +47,7 @@ export const RevokeProxyScreen = () => {
5147
const [proxyWallet, setProxyWallet] = useState(wallet)
5248
const proxyWalletKey = usePublicKey(proxyWallet)
5349
const positionKey = usePublicKey(position)
54-
const { loading, positions, refetch, mint } = useGovernance()
55-
const networks = useMemo(() => {
56-
return [
57-
{ label: 'HNT', value: HNT_MINT.toBase58() },
58-
{ label: 'MOBILE', value: MOBILE_MINT.toBase58() },
59-
{ label: 'IOT', value: IOT_MINT.toBase58() },
60-
]
61-
}, [])
50+
const { loading, positions, refetch } = useGovernance()
6251

6352
const proxiedPositions = useMemo(
6453
() =>
@@ -212,20 +201,6 @@ export const RevokeProxyScreen = () => {
212201
/>
213202
</Box>
214203

215-
{/* Don't show network when position already defined */}
216-
{position ? null : (
217-
<Box mb="m">
218-
<Text variant="body3" color="secondaryText" mb="xs">
219-
{t('gov.assignProxy.selectNetwork')}
220-
</Text>
221-
<Select
222-
title={t('gov.assignProxy.selectNetwork')}
223-
value={mint.toBase58()}
224-
onValueChange={(m: string) => navigation.setParams({ mint: m })}
225-
options={networks}
226-
/>
227-
</Box>
228-
)}
229204
<Box flexDirection="row" justifyContent="space-between">
230205
<Text variant="body1" color="white" opacity={0.5}>
231206
{t('gov.revokeProxy.revokePositions')}

src/locales/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,6 @@ export default {
13431343
description:
13441344
"Select the proxy to assign as your position's votes. Once assigned, they can cast a vote on your behalf and/or assign it to others.",
13451345
searchPlaceholder: 'Select Proxy or Paste Wallet Address',
1346-
selectNetwork: 'Select Network',
13471346
assignPositions: 'Assign Positions',
13481347
selectAll: 'Select All',
13491348
deSelectAll: 'Deselect All',

0 commit comments

Comments
 (0)