Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Perronef5 committed Dec 7, 2024
1 parent 06b90b0 commit 092068f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 54 deletions.
3 changes: 2 additions & 1 deletion src/app/NavigationHelper.ts
Original file line number Diff line number Diff line change
@@ -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<RootStackParamList>()
Expand All @@ -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)
}
1 change: 1 addition & 0 deletions src/features/ledger/getDeviceAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type Animations = {
[modelId in DeviceModelId]: Record<string, Record<string, AnimationRecord>>
}

// @ts-expect-error Halp
const animations: Animations = {
nanoS: {
plugAndPinCode: {
Expand Down
1 change: 0 additions & 1 deletion src/features/onboarding/import/ImportReplaceWordModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
))}
Expand Down
30 changes: 1 addition & 29 deletions src/features/settings/ConfirmSignoutScreen.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -20,9 +18,7 @@ const ConfirmSignoutScreen = () => {
WalletNavigationProp & SettingsNavigationProp
>()
const rootNav = useNavigation<RootNavigationProp>()
const { showOKCancelAlert } = useAlert()
const { currentAccount, signOut, accounts } = useAccountStorage()
const { pin } = useAppStorage()
const colors = useColors()

const [mnemonic, setMnemonic] = useState<string[]>()
Expand All @@ -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
Expand Down Expand Up @@ -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 (
Expand All @@ -115,7 +88,6 @@ const ConfirmSignoutScreen = () => {
title={t('settings.confirmSignout.title')}
mnemonic={mnemonic}
onComplete={onWordsConfirmed}
onForgotWords={onForgotWords}
/>
) : (
<Box flex={1} justifyContent="center" alignItems="center">
Expand Down
3 changes: 0 additions & 3 deletions src/features/settings/RevealWordsScreen.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -13,7 +12,6 @@ import ScrollBox from '@components/ScrollBox'
const RevealWordsScreen = () => {
const { currentAccount } = useAccountStorage()
const { t } = useTranslation()
const navigation = useNavigation()
const [mnemonic, setMnemonic] = useState<string[]>()

useAsync(async () => {
Expand Down Expand Up @@ -58,7 +56,6 @@ const RevealWordsScreen = () => {
<RevealWords
mnemonic={mnemonic || []}
ListHeaderComponent={ListHeaderComponent}
onDone={navigation.goBack}
/>
</BackScreen>
</ScrollBox>
Expand Down
20 changes: 2 additions & 18 deletions src/features/stickers/components/HotspotSticker.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 (
<Group matrix={matrix}>
{/* {dragged?.value && ( */}
{/* <Circle cx={size.width / 2} cy={size.height / 2} r={size.width / 3}>
<Shadow dx={0} dy={0} blur={24} color="black" />
<Shadow dx={0} dy={0} blur={24} color="black" />
</Circle> */}
{/* )} */}
<ImageSVG svg={svg} width={size.width} height={size.height} x={0} y={0} />
</Group>
)
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/useDerivationAccounts.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit 092068f

Please sign in to comment.