Skip to content

Commit

Permalink
feat: add alert before skip pin code
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaelsousa committed Sep 26, 2022
1 parent 6e391a1 commit a283b0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
19 changes: 15 additions & 4 deletions src/screens/PinLocker/pin.locker.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {useTheme} from 'styled-components/native';
import {SkipText, styles} from './styles';
import useMyNavigation from '../../common/hooks/useMyNavigation';
import usePinLockerController from './pin.locker.controller';
import {Alert, View} from 'react-native';

const PinLockerView: React.FC = () => {
const {colors} = useTheme();
Expand Down Expand Up @@ -46,6 +47,7 @@ const PinLockerView: React.FC = () => {
return (
<Container>
<PINCode
// styleMainContainer={{backgroundColor: 'red'}}
touchIDDisabled={true}
key={'pin'}
status={pinStatus}
Expand Down Expand Up @@ -80,13 +82,22 @@ const PinLockerView: React.FC = () => {
buttonComponentLockedPage={() => null}
/>
{pinStatus === 'choose' && (
<SkipText color="brand" size={16} onPress={setToNotAskToSetPinAgain}>
<SkipText
color="brand"
size={16}
onPress={() =>
Alert.alert(
'🚧 Are you sure?',
'This prevents unauthorized access.',
[
{text: 'cancel'},
{onPress: setToNotAskToSetPinAgain, text: 'proceed'},
],
)
}>
Skip
</SkipText>
)}
{/**
* //TODO: add a radio button to not ask to enter pin code again next time
*/}
</Container>
);
};
Expand Down
5 changes: 3 additions & 2 deletions src/screens/PinLocker/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const styles = StyleSheet.create({
});

export const SkipText = styled(Text)`
position: absolute;
bottom: 50px;
align-self: center;
padding: 20px;
min-height: 14px;
margin-bottom: 50px;
`;

0 comments on commit a283b0b

Please sign in to comment.