diff --git a/src/features/account/TokenListItem.tsx b/src/features/account/TokenListItem.tsx index fcd2500c2..98dc8d26f 100644 --- a/src/features/account/TokenListItem.tsx +++ b/src/features/account/TokenListItem.tsx @@ -26,6 +26,7 @@ import { useAsync } from 'react-async-hook' import { useSolana } from '../../solana/SolanaProvider' import { HomeNavigationProp } from '../home/homeTypes' import AccountTokenCurrencyBalance from './AccountTokenCurrencyBalance' +import { ServiceSheetNavigationProp } from '@services/serviceSheetTypes' export const ITEM_HEIGHT = 72 type Props = { @@ -198,7 +199,7 @@ const PercentChange = ({ } export const TokenListGovItem = ({ mint }: { mint: PublicKey }) => { - const navigation = useNavigation() + const navigation = useNavigation() const { anchorProvider, connection } = useSolana() const wallet = useCurrentWallet() const { triggerImpact } = useHaptic() @@ -274,7 +275,7 @@ export const TokenListGovItem = ({ mint }: { mint: PublicKey }) => { const handleNavigation = useCallback(() => { triggerImpact('light') // eslint-disable-next-line @typescript-eslint/no-explicit-any - ;(navigation as any).navigate('Governance', { + ;(navigation as any).navigate('GovernanceService', { screen: 'PositionsScreen', initial: false, params: { mint: mintStr }, diff --git a/src/features/governance/GovernanceWrapper.tsx b/src/features/governance/GovernanceWrapper.tsx index ebe3f2d9d..e255c1a8f 100644 --- a/src/features/governance/GovernanceWrapper.tsx +++ b/src/features/governance/GovernanceWrapper.tsx @@ -5,15 +5,12 @@ import UserStar from '@assets/images/userStar.svg' import { ReAnimatedBox } from '@components/AnimatedBox' import Box from '@components/Box' import CircleLoader from '@components/CircleLoader' -import SafeAreaBox from '@components/SafeAreaBox' import { Select } from '@components/Select' -import Text from '@components/Text' import { RouteProp, useNavigation, useRoute } from '@react-navigation/native' import { useGovernance } from '@storage/GovernanceProvider' import React, { useEffect, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' import { Animated } from 'react-native' -import { Edge } from 'react-native-safe-area-context' import { GovernanceNavigationProp, GovernanceStackParamList, @@ -33,7 +30,6 @@ export const GovernanceWrapper: React.FC< const { t } = useTranslation() const route = useRoute() const navigation = useNavigation() - const safeEdges = useMemo(() => ['top'] as Edge[], []) const { loading, hasUnseenProposals } = useGovernance() const anim = useRef(new Animated.Value(1)) const setSelectedTab = useSetTab() diff --git a/src/features/governance/PositionsScreen.tsx b/src/features/governance/PositionsScreen.tsx index d4f230918..a88f8d906 100644 --- a/src/features/governance/PositionsScreen.tsx +++ b/src/features/governance/PositionsScreen.tsx @@ -39,9 +39,14 @@ import GovernanceWrapper from './GovernanceWrapper' import LockTokensModal, { LockTokensModalFormValues } from './LockTokensModal' import { PositionsList } from './PositionsList' import { VotingPowerCard } from './VotingPowerCard' +import { ScrollView } from 'react-native' +import { useSafeAreaInsets } from 'react-native-safe-area-context' +import { useSpacing } from '@theme/themeHooks' export const PositionsScreen = () => { const { t } = useTranslation() + const { bottom } = useSafeAreaInsets() + const spacing = useSpacing() const wallet = useCurrentWallet() const { walletSignBottomSheetRef } = useWalletSign() const [isLockModalOpen, setIsLockModalOpen] = useState(false) @@ -234,82 +239,83 @@ export const PositionsScreen = () => { } return ( - - - - } /> - - {showError && ( + + + + + } /> + + {showError && ( + + + {showError} + + + )} - - {showError} - + setIsLockModalOpen(true)} + disabled={claimingAllRewards || loading} + /> + {HNT_MINT.equals(mint) && ( + <> + + + )} - )} - - setIsLockModalOpen(true)} - disabled={claimingAllRewards || loading} - /> - {HNT_MINT.equals(mint) && ( - <> - - - + {claimingAllRewards && ( + + )} + {isLockModalOpen && ( + setIsLockModalOpen(false)} + onSubmit={handleLockTokens} + /> )} - {claimingAllRewards && } - {isLockModalOpen && ( - setIsLockModalOpen(false)} - onSubmit={handleLockTokens} - /> - )} - - + + ) } diff --git a/src/features/governance/VotersScreen.tsx b/src/features/governance/VotersScreen.tsx index a32d2d279..77c51d7fb 100644 --- a/src/features/governance/VotersScreen.tsx +++ b/src/features/governance/VotersScreen.tsx @@ -19,7 +19,7 @@ import BN from 'bn.js' import { times } from 'lodash' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' -import { FlatList, Image, RefreshControl } from 'react-native' +import { FlatList, Image, RefreshControl, ScrollView } from 'react-native' import { useDebounce } from 'use-debounce' import { GovernanceNavigationProp } from './governanceTypes' import { GovernanceWrapper } from './GovernanceWrapper' @@ -80,7 +80,7 @@ export default function VotersScreen() { width="100%" justifyContent="center" alignItems="center" - mb="4" + marginVertical="4" > {t('gov.voters.noneFound')} @@ -159,31 +159,39 @@ export default function VotersScreen() { const { primaryText } = useColors() return ( - - - {t('gov.voters.title')} - - - - } - onEndReached={handleOnEndReached} - /> - + + + + {t('gov.voters.title')} + + + + } + onEndReached={handleOnEndReached} + /> + + ) }