Skip to content

Commit df20ab3

Browse files
committed
Fix login scene lint warnings
1 parent f04d402 commit df20ab3

9 files changed

Lines changed: 21 additions & 29 deletions

eslint.config.mjs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ export default [
239239
'src/components/rows/TxCryptoAmountRow.tsx',
240240
'src/components/scenes/AssetSettingsScene.tsx',
241241
'src/components/scenes/ChangeMiningFeeScene.tsx',
242-
'src/components/scenes/ChangePasswordScene.tsx',
243-
'src/components/scenes/ChangePinScene.tsx',
244-
'src/components/scenes/ChangeUsernameScene.tsx',
245-
'src/components/scenes/CoinRankingDetailsScene.tsx',
246242

247243
'src/components/scenes/ConfirmScene.tsx',
248244
'src/components/scenes/CreateWalletAccountSelectScene.tsx',
@@ -285,19 +281,17 @@ export default [
285281
'src/components/scenes/Loans/LoanDetailsScene.tsx',
286282
'src/components/scenes/Loans/LoanManageScene.tsx',
287283
'src/components/scenes/Loans/LoanStatusScene.tsx',
288-
'src/components/scenes/LoginScene.tsx',
284+
289285
'src/components/scenes/ManageTokensScene.tsx',
290286
'src/components/scenes/MigrateWalletCalculateFeeScene.tsx',
291287
'src/components/scenes/MigrateWalletCompletionScene.tsx',
292288

293289
'src/components/scenes/NotificationCenterScene.tsx',
294290
'src/components/scenes/NotificationScene.tsx',
295-
'src/components/scenes/OtpRepairScene.tsx',
291+
296292
'src/components/scenes/OtpSettingsScene.tsx',
297-
'src/components/scenes/PasswordRecoveryScene.tsx',
298-
'src/components/scenes/PromotionSettingsScene.tsx',
299293

300-
'src/components/scenes/SecurityAlertsScene.tsx',
294+
'src/components/scenes/PromotionSettingsScene.tsx',
301295

302296
'src/components/scenes/SpendingLimitsScene.tsx',
303297
'src/components/scenes/Staking/EarnScene.tsx',
@@ -312,7 +306,6 @@ export default [
312306
'src/components/scenes/TransactionDetailsScene.tsx',
313307

314308
'src/components/scenes/TransactionsExportScene.tsx',
315-
'src/components/scenes/UpgradeUsernameScreen.tsx',
316309

317310
'src/components/scenes/WalletRestoreScene.tsx',
318311
'src/components/scenes/WcConnectionsScene.tsx',

src/components/scenes/ChangePasswordScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SceneWrapper } from '../common/SceneWrapper'
1010

1111
interface Props extends EdgeAppSceneProps<'changePassword'> {}
1212

13-
export const ChangePasswordScene = (props: Props) => {
13+
export const ChangePasswordScene: React.FC<Props> = props => {
1414
const { navigation } = props
1515
const account = useSelector(state => state.core.account)
1616
const context = useSelector(state => state.core.context)

src/components/scenes/ChangePinScene.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import { SceneWrapper } from '../common/SceneWrapper'
1010

1111
interface Props extends EdgeAppSceneProps<'changePin'> {}
1212

13-
export const ChangePinScene = (props: Props) => {
13+
export const ChangePinScene: React.FC<Props> = props => {
1414
const { navigation } = props
1515
const account = useSelector(state => state.core.account)
1616
const context = useSelector(state => state.core.context)
1717
const dispatch = useDispatch()
1818

19-
const handleComplete = () => {
19+
const handleComplete = useHandler(() => {
2020
logActivity(`PIN Changed: ${account.username}`)
2121
navigation.goBack()
22-
}
22+
})
2323

2424
const handleLogEvent = useHandler((event, values) => {
2525
dispatch(logEvent(event, values))

src/components/scenes/ChangeUsernameScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { SceneWrapper } from '../common/SceneWrapper'
99

1010
interface Props extends EdgeAppSceneProps<'changeUsername'> {}
1111

12-
export const ChangeUsernameScene = (props: Props) => {
12+
export const ChangeUsernameScene: React.FC<Props> = props => {
1313
const { navigation, route } = props
1414
const { password } = route.params
1515
const dispatch = useDispatch()

src/components/scenes/LoginScene.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ export interface LoginParams {
3434
loginUiInitialRoute?: InitialRouteName
3535
}
3636

37-
// Sneak the BlurView over to the login UI:
38-
// @ts-expect-error
37+
// @ts-expect-error Sneak the BlurView over to the login UI:
3938
global.ReactNativeBlurView = BlurView
4039

4140
interface Props extends RootSceneProps<'login'> {}
4241

4342
let firstRun = true
4443

45-
export function LoginScene(props: Props) {
44+
export const LoginScene: React.FC<Props> = props => {
4645
const { navigation, route } = props
4746
const {
4847
experimentConfig,
@@ -82,7 +81,7 @@ export function LoginScene(props: Props) {
8281
initializeAccount(navigation as NavigationBase, account)
8382
)
8483
})
85-
.catch(error => {
84+
.catch((error: unknown) => {
8685
showError(error)
8786
})
8887
}
@@ -94,7 +93,7 @@ export function LoginScene(props: Props) {
9493
initializeAccount(navigation as NavigationBase, account)
9594
)
9695
})
97-
.catch(error => {
96+
.catch((error: unknown) => {
9897
showError(error)
9998
})
10099
}
@@ -115,7 +114,7 @@ export function LoginScene(props: Props) {
115114
initializeAccount(navigation as NavigationBase, account)
116115
)
117116
})
118-
.catch(error => {
117+
.catch((error: unknown) => {
119118
showError(error)
120119
})
121120
}
@@ -129,8 +128,8 @@ export function LoginScene(props: Props) {
129128
() => ({
130129
callback() {
131130
Keyboard.dismiss()
132-
showHelpModal(navigation as NavigationBase).catch(err => {
133-
showDevError(err)
131+
showHelpModal(navigation as NavigationBase).catch((error: unknown) => {
132+
showDevError(error)
134133
})
135134
},
136135
text: lstrings.string_help
@@ -153,8 +152,8 @@ export function LoginScene(props: Props) {
153152
})
154153

155154
const handleSendLogs = useHandler(() => {
156-
dispatch(showSendLogsModal()).catch(err => {
157-
showError(err)
155+
dispatch(showSendLogsModal()).catch((error: unknown) => {
156+
showError(error)
158157
})
159158
})
160159

src/components/scenes/OtpRepairScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface OtpRepairParams {
1515

1616
interface Props extends EdgeAppSceneProps<'otpRepair'> {}
1717

18-
export const OtpRepairScene = (props: Props) => {
18+
export const OtpRepairScene: React.FC<Props> = props => {
1919
const { navigation, route } = props
2020
const { otpError } = route.params
2121
const account = useSelector(state => state.core.account)

src/components/scenes/PasswordRecoveryScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SceneWrapper } from '../common/SceneWrapper'
1010

1111
interface Props extends EdgeAppSceneProps<'passwordRecovery'> {}
1212

13-
export const ChangeRecoveryScene = (props: Props) => {
13+
export const ChangeRecoveryScene: React.FC<Props> = props => {
1414
const { navigation } = props
1515
const account = useSelector(state => state.core.account)
1616
const context = useSelector(state => state.core.context)

src/components/scenes/SecurityAlertsScene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { SceneWrapper } from '../common/SceneWrapper'
99

1010
interface Props extends EdgeAppSceneProps<'securityAlerts'> {}
1111

12-
export const SecurityAlertsScene = (props: Props) => {
12+
export const SecurityAlertsScene: React.FC<Props> = props => {
1313
const { navigation } = props
1414
const account = useSelector(state => state.core.account)
1515
const context = useSelector(state => state.core.context)

src/components/scenes/UpgradeUsernameScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { SceneWrapper } from '../common/SceneWrapper'
1111

1212
interface Props extends EdgeAppSceneProps<'upgradeUsername'> {}
1313

14-
export const UpgradeUsernameScene = (props: Props) => {
14+
export const UpgradeUsernameScene: React.FC<Props> = props => {
1515
const { navigation } = props
1616
const account = useSelector(state => state.core.account)
1717
const context = useSelector(state => state.core.context)

0 commit comments

Comments
 (0)