mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
* [injimob-3604]: changes according to new style guide Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [injimob-3604]: changes according to new style guide Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> # Conflicts: # components/KebabPopUp.tsx # components/VC/common/VCItemField.tsx # components/ui/svg.tsx # components/ui/themes/DefaultTheme.ts # locales/ara.json # locales/en.json # locales/fil.json # locales/hin.json # locales/kan.json # locales/tam.json * [injimob-3604]: changes according to review comments Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [injimob-3604]: changes according to review comments Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [injimob-3604]: changes according to review comments Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [injimob-3604]: changes according to review comments Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * [injimob-3604]: removed the debug.keystore file Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> --------- Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> Signed-off-by: jaswanthkumartw <jaswanthkumar.p@thoughtworks.com>
67 lines
2.0 KiB
TypeScript
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 BiometricIcon from '../components/BiometricIcon';
|
|
|
|
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}>
|
|
<BiometricIcon size={108} />
|
|
</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>
|
|
);
|
|
};
|