Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Perronef5 committed Oct 14, 2024
1 parent c7b9d61 commit c757a39
Show file tree
Hide file tree
Showing 43 changed files with 350 additions and 445 deletions.
2 changes: 1 addition & 1 deletion src/components/AccountIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { memo, useMemo } from 'react'
import Jazzicon, { IJazziconProps } from 'react-native-jazzicon'
import { getJazzSeed } from '../utils/accountUtils'
import { useAccountStorage } from '@storage/AccountStorageProvider'
import { useAsync } from 'react-async-hook'
import { getJazzSeed } from '../utils/accountUtils'
import { ImageBox } from '.'

type Props = { address?: string; size: number } & Omit<
Expand Down
6 changes: 3 additions & 3 deletions src/components/AddressBookSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import ContactsList from '@features/addressBook/ContactsList'
import { CSAccount } from '@storage/cloudStorage'
import { Portal } from '@gorhom/portal'
import { useTranslation } from 'react-i18next'
import HeliumBottomSheet from './HeliumBottomSheet'
import { SafeAreaBox, Text } from '.'
import { SendNavigationProp } from '@services/WalletService/pages/SendPage/SentPageNavigator'
import { AddressBookNavigationProp } from '@features/addressBook/addressBookTypes'
import HeliumBottomSheet from './HeliumBottomSheet'
import { SafeAreaBox, Text } from '.'

export type AddressBookRef = {
showAddressBook: (opts: { address?: string; index?: number }) => void
Expand Down Expand Up @@ -99,7 +99,7 @@ const AddressBookSelector = forwardRef(
params: undefined,
})
bottomSheetModalRef.current?.close()
}, [navigation, address])
}, [navigation])

return (
<Portal>
Expand Down
88 changes: 45 additions & 43 deletions src/components/BalanceText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,50 +62,52 @@ const BalanceText = ({
)
}

const BalanceChange = ({ change }: { change: number }) => {
return (
<Text adjustsFontSizeToFit variant="textLgSemibold" color="fg.quinary-400">
{`$${change.toFixed(2).toLocaleString()}`}
</Text>
)
}
// TODO: Bring this back once we are tracking balances on the wallet api
// const BalanceChange = ({ change }: { change: number }) => {
// return (
// <Text adjustsFontSizeToFit variant="textLgSemibold" color="fg.quinary-400">
// {`$${change.toFixed(2).toLocaleString()}`}
// </Text>
// )
// }

const PercentageContainer = ({
percentage,
type,
}: {
percentage: number
type: 'up' | 'down' | 'neutral'
}) => {
const backgroundColor = useMemo(() => {
switch (type) {
case 'up':
return 'green.light-500'
case 'down':
return 'error.500'
case 'neutral':
return 'fg.quinary-400'
}
}, [type])
// TODO: Bring this back once we are tracking balances on the wallet api
// const PercentageContainer = ({
// percentage,
// type,
// }: {
// percentage: number
// type: 'up' | 'down' | 'neutral'
// }) => {
// const backgroundColor = useMemo(() => {
// switch (type) {
// case 'up':
// return 'green.light-500'
// case 'down':
// return 'error.500'
// case 'neutral':
// return 'fg.quinary-400'
// }
// }, [type])

return (
<Box
flexDirection="row"
alignItems="flex-end"
backgroundColor={backgroundColor}
borderRadius="md"
paddingHorizontal="xs"
paddingVertical="1"
>
<Text
adjustsFontSizeToFit
variant="textLgSemibold"
color="primaryBackground"
>
{`+${percentage.toFixed(2)}%`}
</Text>
</Box>
)
}
// return (
// <Box
// flexDirection="row"
// alignItems="flex-end"
// backgroundColor={backgroundColor}
// borderRadius="md"
// paddingHorizontal="xs"
// paddingVertical="1"
// >
// <Text
// adjustsFontSizeToFit
// variant="textLgSemibold"
// color="primaryBackground"
// >
// {`+${percentage.toFixed(2)}%`}
// </Text>
// </Box>
// )
// }

export default memo(BalanceText)
123 changes: 0 additions & 123 deletions src/components/Balancer.tsx

This file was deleted.

16 changes: 11 additions & 5 deletions src/components/HNTKeyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,12 @@ const HNTKeyboardSelector = forwardRef(
return <HandleBasic marginTop="2" marginBottom="4" />
}
return (
<Box flexDirection="row" margin="4" marginBottom="0">
<Box
flexDirection="row"
margin="4"
marginBottom="0"
paddingHorizontal={'xl'}

Check failure on line 333 in src/components/HNTKeyboard.tsx

View workflow job for this annotation

GitHub Actions / build

Curly braces are unnecessary here
>
<Box flex={1} />
<Box
width={58}
Expand All @@ -338,18 +343,18 @@ const HNTKeyboardSelector = forwardRef(
<TouchableOpacityBox
marginBottom="2"
onPress={handleSetMax}
backgroundColor={maxEnabled ? 'base.white' : 'transparent'}
borderColor={maxEnabled ? 'transparent' : 'cardBackground'}
backgroundColor={maxEnabled ? 'primaryText' : 'transparent'}
borderColor={maxEnabled ? 'transparent' : 'border.primary'}
borderWidth={1.5}
borderRadius="2xl"
paddingVertical="xs"
paddingHorizontal="3"
>
<Text
variant="textMdMedium"
variant="textMdSemibold"
textAlign="center"
alignSelf="flex-end"
color={maxEnabled ? 'base.black' : 'secondaryText'}
color={maxEnabled ? 'primaryBackground' : 'primaryText'}
>
{t('payment.max')}
</Text>
Expand Down Expand Up @@ -452,6 +457,7 @@ const HNTKeyboardSelector = forwardRef(
<ThemeProvider theme={lightTheme}>
<BottomSheetModalProvider>
<HeliumBottomSheet
handleComponent={renderHandle}
onChange={handleChange}
ref={bottomSheetModalRef}
index={-1}
Expand Down
9 changes: 5 additions & 4 deletions src/components/SegmentedControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import { BoxProps } from '@shopify/restyle'
import { GestureResponderEvent, LayoutChangeEvent } from 'react-native'
import { SvgProps } from 'react-native-svg'
import { useColors } from '@theme/themeHooks'
import { useAnimatedStyle, withTiming } from 'react-native-reanimated'
import { Theme } from '../theme/theme'
import { Box, ReAnimatedBox, Text } from '.'
import TouchableOpacityBox from './TouchableOpacityBox'
import { useAnimatedStyle, withTiming } from 'react-native-reanimated'
import { debounce as lodashDebounce } from 'lodash'

type Option = {
value: string | number
Expand Down Expand Up @@ -57,12 +56,14 @@ const SegmentedItem = ({
if (!hasTouched) return initialBackgroundColor

return 'transparent'
}, [initialBackgroundColor, selected])
}, [initialBackgroundColor, hasTouched])

const onPressHandler = useCallback(
(event: GestureResponderEvent) => {
setHasTouched(true)
onSelected && onSelected(event)
if (onSelected) {
onSelected(event)
}
},
[onSelected],
)
Expand Down
2 changes: 1 addition & 1 deletion src/features/account/AccountManageTokenListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import BackScreen from '@components/BackScreen'
import ScrollBox from '@components/ScrollBox'
import { BoxProps } from '@shopify/restyle'
import { Theme } from '@theme/theme'
import { NavBarHeight } from '@components/ServiceNavBar'
import { useSolana } from '../../solana/SolanaProvider'
import { syncTokenAccounts } from '../../store/slices/balancesSlice'
import { useAppDispatch } from '../../store/store'
import AccountTokenCurrencyBalance from './AccountTokenCurrencyBalance'
import { NavBarHeight } from '@components/ServiceNavBar'

const CheckableTokenListItem = ({
bottomBorder,
Expand Down
6 changes: 3 additions & 3 deletions src/features/account/AccountTokenScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { View } from 'react-native'
import { FlatList } from 'react-native-gesture-handler'
import ScrollBox from '@components/ScrollBox'
import { WalletStackParamList } from '@services/WalletService/pages/WalletPage/WalletPageNavigator'
import { PublicKey } from '@solana/web3.js'
import { useSolana } from '../../solana/SolanaProvider'
import { useAccountStorage } from '../../storage/AccountStorageProvider'
import { Activity } from '../../types/activity'
Expand All @@ -34,7 +35,6 @@ import TransactionDetailSelector, {
} from './TransactionDetail'
import TxnListItem from './TxnListItem'
import useSolanaActivityList from './useSolanaActivityList'
import { PublicKey } from '@solana/web3.js'
import { TokenListGovItem } from './TokenListItem'

const MIN_BOTTOM_BAR_HEIGHT = 80
Expand Down Expand Up @@ -218,7 +218,7 @@ const AccountTokenScreen = () => {
<Box alignItems="center" marginBottom="4">
<TokenIcon img={json?.image} size={50} />
</Box>
<Box paddingHorizontal={'2'}>
<Box paddingHorizontal="2">
<AccountTokenBalance marginTop="2" mint={mint} />
{!!symbol && (
<AccountTokenCurrencyBalance
Expand Down Expand Up @@ -273,7 +273,7 @@ const AccountTokenScreen = () => {
</>
)}

{isGovMint && <TokenListGovItem mint={mint} marginBottom={'4'} />}
{isGovMint && <TokenListGovItem mint={mint} marginBottom="4" />}
</Box>
)
}, [
Expand Down
Loading

0 comments on commit c757a39

Please sign in to comment.