From 092068f15b6247fd83d212d5cf1ff0f79821a9a6 Mon Sep 17 00:00:00 2001 From: Luis Perrone Date: Sat, 7 Dec 2024 17:41:02 -0600 Subject: [PATCH] Fix lint --- src/app/NavigationHelper.ts | 3 +- src/features/ledger/getDeviceAnimation.ts | 1 + .../import/ImportReplaceWordModal.tsx | 1 - .../settings/ConfirmSignoutScreen.tsx | 30 +------------------ src/features/settings/RevealWordsScreen.tsx | 3 -- .../stickers/components/HotspotSticker.tsx | 20 ++----------- src/hooks/useDerivationAccounts.ts | 3 +- 7 files changed, 7 insertions(+), 54 deletions(-) diff --git a/src/app/NavigationHelper.ts b/src/app/NavigationHelper.ts index e887d1886..56964fce2 100644 --- a/src/app/NavigationHelper.ts +++ b/src/app/NavigationHelper.ts @@ -1,5 +1,5 @@ import { createNavigationContainerRef } from '@react-navigation/native' -import { AccountsServiceStackParamList } from 'src/app/services/AccountsService' +import { AccountsServiceStackParamList } from 'src/app/services/AccountsService/pages/YourWalletsPage' import { RootStackParamList } from './rootTypes' export const navigationRef = createNavigationContainerRef() @@ -8,5 +8,6 @@ export const navToImportAccount = ( params: AccountsServiceStackParamList['ReImportAccountNavigator'], ) => { if (!navigationRef.isReady()) return + // eslint-disable-next-line @typescript-eslint/no-explicit-any navigationRef.navigate('ReImportAccountNavigator' as any, params as any) } diff --git a/src/features/ledger/getDeviceAnimation.ts b/src/features/ledger/getDeviceAnimation.ts index 96836dcf5..d345bda98 100644 --- a/src/features/ledger/getDeviceAnimation.ts +++ b/src/features/ledger/getDeviceAnimation.ts @@ -21,6 +21,7 @@ export type Animations = { [modelId in DeviceModelId]: Record> } +// @ts-expect-error Halp const animations: Animations = { nanoS: { plugAndPinCode: { diff --git a/src/features/onboarding/import/ImportReplaceWordModal.tsx b/src/features/onboarding/import/ImportReplaceWordModal.tsx index 35ef755a3..30f5752ad 100644 --- a/src/features/onboarding/import/ImportReplaceWordModal.tsx +++ b/src/features/onboarding/import/ImportReplaceWordModal.tsx @@ -87,7 +87,6 @@ const ImportReplaceWordModal = ({ // eslint-disable-next-line react/no-array-index-key key={`${matchingWord}.${idx}`} fullWord={matchingWord} - matchingText={word.toLowerCase()} onPress={handleWordSelect} /> ))} diff --git a/src/features/settings/ConfirmSignoutScreen.tsx b/src/features/settings/ConfirmSignoutScreen.tsx index 26c93b4ff..56ec45f2b 100644 --- a/src/features/settings/ConfirmSignoutScreen.tsx +++ b/src/features/settings/ConfirmSignoutScreen.tsx @@ -1,14 +1,12 @@ -import React, { useCallback, useMemo, useState } from 'react' +import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import { useNavigation } from '@react-navigation/native' import { ActivityIndicator, Alert, Platform } from 'react-native' import { useAsync } from 'react-async-hook' -import useAlert from '@hooks/useAlert' import { useColors } from '@config/theme/themeHooks' import Box from '@components/Box' import { WalletNavigationProp } from '@services/WalletService/pages/WalletPage' import { useAccountStorage } from '@config/storage/AccountStorageProvider' -import { useAppStorage } from '@config/storage/AppStorageProvider' import { getSecureAccount } from '@config/storage/secureStorage' import { SettingsNavigationProp } from './settingsTypes' import ConfirmWordsScreen from '../onboarding/create/ConfirmWordsScreen' @@ -20,9 +18,7 @@ const ConfirmSignoutScreen = () => { WalletNavigationProp & SettingsNavigationProp >() const rootNav = useNavigation() - const { showOKCancelAlert } = useAlert() const { currentAccount, signOut, accounts } = useAccountStorage() - const { pin } = useAppStorage() const colors = useColors() const [mnemonic, setMnemonic] = useState() @@ -33,11 +29,6 @@ const ConfirmSignoutScreen = () => { setMnemonic(secureAccount?.mnemonic) }, [currentAccount]) - const isPinRequired = useMemo( - () => pin !== undefined && pin.status !== 'off', - [pin], - ) - const onWordsConfirmed = useCallback(() => { navigation.goBack() const currentAddress = currentAccount?.address @@ -88,24 +79,6 @@ const ConfirmSignoutScreen = () => { ) }, [accounts, currentAccount, navigation, rootNav, signOut, t]) - const onForgotWords = useCallback(async () => { - navigation.goBack() - const decision = await showOKCancelAlert({ - title: t('settings.confirmSignout.forgotAlert.title'), - message: t('settings.confirmSignout.forgotAlert.body'), - }) - if (!decision) return - - if (isPinRequired) { - navigation.push('SettingsConfirmPin', { - pin: pin?.value || '', - action: 'revealWords', - }) - } else { - navigation.push('RevealWords') - } - }, [isPinRequired, navigation, pin, showOKCancelAlert, t]) - if (!mnemonic) return null return ( @@ -115,7 +88,6 @@ const ConfirmSignoutScreen = () => { title={t('settings.confirmSignout.title')} mnemonic={mnemonic} onComplete={onWordsConfirmed} - onForgotWords={onForgotWords} /> ) : ( diff --git a/src/features/settings/RevealWordsScreen.tsx b/src/features/settings/RevealWordsScreen.tsx index ed436a114..645bbc3e8 100644 --- a/src/features/settings/RevealWordsScreen.tsx +++ b/src/features/settings/RevealWordsScreen.tsx @@ -1,7 +1,6 @@ import React, { memo, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useAsync } from 'react-async-hook' -import { useNavigation } from '@react-navigation/native' import { useAccountStorage } from '@config/storage/AccountStorageProvider' import Box from '@components/Box' import BackScreen from '@components/BackScreen' @@ -13,7 +12,6 @@ import ScrollBox from '@components/ScrollBox' const RevealWordsScreen = () => { const { currentAccount } = useAccountStorage() const { t } = useTranslation() - const navigation = useNavigation() const [mnemonic, setMnemonic] = useState() useAsync(async () => { @@ -58,7 +56,6 @@ const RevealWordsScreen = () => { diff --git a/src/features/stickers/components/HotspotSticker.tsx b/src/features/stickers/components/HotspotSticker.tsx index 8e475ada5..9015bc264 100644 --- a/src/features/stickers/components/HotspotSticker.tsx +++ b/src/features/stickers/components/HotspotSticker.tsx @@ -1,13 +1,6 @@ /* eslint-disable max-len */ import React from 'react' -import { - Group, - ImageSVG, - Shadow, - Circle, - Skia, - rect, -} from '@shopify/react-native-skia' +import { Group, ImageSVG, Skia } from '@shopify/react-native-skia' import type { StickerProps } from './Sticker' // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -45,18 +38,9 @@ const svg = Skia.SVG.MakeFromString( const size = { width: 213, height: 209 } -const src = rect(0, 0, svg.width(), svg.height()) -const dst = rect(0, 0, size.width, size.height) - -const Sticker = ({ matrix, dragged }: StickerProps) => { +const Sticker = ({ matrix }: StickerProps) => { return ( - {/* {dragged?.value && ( */} - {/* - - - */} - {/* )} */} ) diff --git a/src/hooks/useDerivationAccounts.ts b/src/hooks/useDerivationAccounts.ts index f0c4e4275..35e402a3c 100644 --- a/src/hooks/useDerivationAccounts.ts +++ b/src/hooks/useDerivationAccounts.ts @@ -1,5 +1,5 @@ import { Keypair as HeliumKeypair, Mnemonic } from '@helium/crypto' -import { Asset, getAssetsByOwner, truthy } from '@helium/spl-utils' +import { Asset, truthy } from '@helium/spl-utils' import { AccountInfo, Keypair, @@ -14,7 +14,6 @@ import { useEffect, useMemo, useState } from 'react' import Config from 'react-native-config' import { retryWithBackoff } from '@utils/retryWithBackoff' import { useSolana } from '@features/solana/SolanaProvider' -import { TOKEN_PROGRAM_ID } from '@solana/spl-token' export const solanaDerivation = (account = -1, change: number | undefined) => { if (account === -1) {