mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
* Revert "[INJIMOB-3622] Fix alignment in history screen (#2140)" This reverts commita0b08914e5. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "Injimob [3622] [3627] - BANNER ISSUE AND BRANDING CHANGES ISSUES (#2130)" This reverts commit522104811c. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "[INJIMOB-3633][INJIMOB-3636] fix icon bg color across app (#2134)" This reverts commitd8d718693d. Signed-off-by: jaswanthkumarpolisetty <jaswanthkumar.p@thoughtworks.com> * Revert "[INJIMOB-3633] fix search bar clear icon not apperaing (#2133)" This reverts commit6a202b11af. 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>
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 {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>
|
|
);
|
|
};
|