Files
inji-wallet/screens/BiometricScreen.tsx
jaswanthkumartw 0e667bd46d Injimob-3651: revert all the branding changes (#2151)
* Revert "[INJIMOB-3622] Fix alignment in history screen  (#2140)"

This reverts commit a0b08914e5.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "Injimob [3622] [3627] - BANNER ISSUE AND BRANDING CHANGES ISSUES  (#2130)"

This reverts commit 522104811c.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "[INJIMOB-3633][INJIMOB-3636] fix icon bg color across app (#2134)"

This reverts commit d8d718693d.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* Revert "[INJIMOB-3633] fix search bar clear icon not apperaing (#2133)"

This reverts commit 6a202b11af.

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: revert all the branding changes

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

* [INJIMOB-3651]: update all the snapshot

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>

---------

Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com>
2025-11-28 18:59:15 +05:30

67 lines
2.0 KiB
TypeScript

import React from 'react';
import {useTranslation} from 'react-i18next';
import {TouchableOpacity} from 'react-native';
import {Button, Centered, Column} from '../components/ui';
import {Theme} from '../components/ui/styleUtils';
import {RootRouteProps} from '../routes';
import {useBiometricScreen} from './BiometricScreenController';
import {Passcode} from '../components/Passcode';
import {
getEventType,
incrementRetryCount,
resetRetryCount,
} from '../shared/telemetry/TelemetryUtils';
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
import {SvgImage} from '../components/ui/svg';
export const BiometricScreen: React.FC<RootRouteProps> = props => {
const {t} = useTranslation('BiometricScreen');
const controller = useBiometricScreen(props);
const handlePasscodeMismatch = (error: string) => {
incrementRetryCount(
getEventType(props.route.params?.setup),
TelemetryConstants.Screens.passcode,
);
controller.onError(error);
};
const handleOnSuccess = () => {
resetRetryCount();
controller.onSuccess();
};
return (
<Column
fill
pY={32}
pX={32}
backgroundColor={Theme.Colors.whiteBackgroundColor}>
<Centered fill>
<TouchableOpacity onPress={controller.useBiometrics}>
{SvgImage.fingerprintIcon(180)}
</TouchableOpacity>
</Centered>
<Button
title={t('unlock')}
margin="8 0"
type="gradient"
onPress={controller.useBiometrics}
disabled={controller.isSuccessBio}
/>
{controller.isReEnabling && (
<Passcode
message="Enter your passcode to re-enable biometrics authentication."
onSuccess={handleOnSuccess}
onError={handlePasscodeMismatch}
storedPasscode={controller.storedPasscode}
onDismiss={() => controller.onDismiss()}
error={controller.error}
salt={controller.passcodeSalt}
/>
)}
</Column>
);
};