Skip to content

Commit a73fbe4

Browse files
committed
Story gor change passcode view and screen locked view
1 parent f5458ec commit a73fbe4

File tree

7 files changed

+9837
-0
lines changed

7 files changed

+9837
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React, { useEffect } from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
4+
import ChangePasscodeView from './ChangePasscodeView';
5+
import EventEmitter from '../lib/methods/helpers/events';
6+
import { CHANGE_PASSCODE_EMITTER } from '../lib/constants/localAuthentication';
7+
8+
const styles = StyleSheet.create({
9+
wrapper: {
10+
flex: 1
11+
}
12+
});
13+
14+
export default {
15+
title: 'Views/ChangePasscodeView'
16+
};
17+
18+
interface IStoryWrapperProps {
19+
force?: boolean;
20+
}
21+
22+
const StoryWrapper = ({ force = false }: IStoryWrapperProps) => {
23+
useEffect(() => {
24+
// Emit the event to show the ChangePasscodeView
25+
EventEmitter.emit(CHANGE_PASSCODE_EMITTER, {
26+
submit: () => {},
27+
cancel: () => {},
28+
force
29+
});
30+
}, [force]);
31+
32+
return (
33+
<View style={styles.wrapper}>
34+
<ChangePasscodeView />
35+
</View>
36+
);
37+
};
38+
39+
export const Default = () => <StoryWrapper />;
40+
41+
export const Forced = () => <StoryWrapper force />;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { generateSnapshots } from '../../.rnstorybook/generateSnapshots';
2+
import * as stories from './ChangePasscodeView.stories';
3+
4+
generateSnapshots(stories);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React, { useEffect } from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
4+
import ScreenLockedView from './ScreenLockedView';
5+
import EventEmitter from '../lib/methods/helpers/events';
6+
import { LOCAL_AUTHENTICATE_EMITTER } from '../lib/constants/localAuthentication';
7+
8+
const styles = StyleSheet.create({
9+
wrapper: {
10+
flex: 1
11+
}
12+
});
13+
14+
export default {
15+
title: 'Views/ScreenLockedView'
16+
};
17+
18+
interface IStoryWrapperProps {
19+
hasBiometry?: boolean;
20+
force?: boolean;
21+
}
22+
23+
const StoryWrapper = ({ hasBiometry = false, force = false }: IStoryWrapperProps) => {
24+
useEffect(() => {
25+
// Emit the event to show the ScreenLockedView
26+
EventEmitter.emit(LOCAL_AUTHENTICATE_EMITTER, {
27+
submit: () => {},
28+
cancel: () => {},
29+
hasBiometry,
30+
force
31+
});
32+
}, [hasBiometry, force]);
33+
34+
return (
35+
<View style={styles.wrapper}>
36+
<ScreenLockedView />
37+
</View>
38+
);
39+
};
40+
41+
export const Default = () => <StoryWrapper />;
42+
43+
export const WithBiometry = () => <StoryWrapper hasBiometry />;
44+
45+
export const WithCloseButton = () => <StoryWrapper force />;
46+
47+
export const WithBiometryAndClose = () => <StoryWrapper hasBiometry force />;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { generateSnapshots } from '../../.rnstorybook/generateSnapshots';
2+
import * as stories from './ScreenLockedView.stories';
3+
4+
generateSnapshots(stories);

0 commit comments

Comments
 (0)