Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 3e8b9c3

Browse files
committed
Implement Password view for mobile
1 parent 9b06958 commit 3e8b9c3

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

src/component/pin-entry.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const pinEntryStyles = StyleSheet.create({
1717
},
1818
});
1919

20-
export const PinBubbles = ({ pin }) => (
21-
<View style={pinEntryStyles.wrapper}>
20+
export const PinBubbles = ({ pin, style }) => (
21+
<View style={[pinEntryStyles.wrapper, style]}>
2222
<PinBubble char={pin[0]} />
2323
<PinBubble char={pin[1]} />
2424
<PinBubble char={pin[2]} />
@@ -30,6 +30,7 @@ export const PinBubbles = ({ pin }) => (
3030

3131
PinBubbles.propTypes = {
3232
pin: PropTypes.string.isRequired,
33+
style: View.propTypes.style,
3334
};
3435

3536
//

src/view/password-mobile.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import { observer } from 'mobx-react';
4+
import PropTypes from 'prop-types';
5+
import Background from '../component/background';
6+
import MainContent from '../component/main-content';
7+
import BoltIcon from '../asset/icon/lightning-bolt';
8+
import LightningWord from '../asset/icon/lightning-word';
9+
import { Text } from '../component/text';
10+
import { FormStretcher } from '../component/form';
11+
import { PinBubbles, PinKeyboard } from '../component/pin-entry';
12+
13+
//
14+
// Set Password View (Mobile)
15+
//
16+
17+
const styles = StyleSheet.create({
18+
content: {
19+
paddingLeft: 20,
20+
paddingRight: 20,
21+
},
22+
boltWrapper: {
23+
marginTop: 50,
24+
},
25+
wordWrapper: {
26+
marginTop: 35,
27+
},
28+
bubbles: {
29+
marginTop: 10,
30+
},
31+
});
32+
33+
const SetPasswordView = ({ store, wallet }) => (
34+
<Background image="purple-gradient-bg">
35+
<MainContent style={styles.content}>
36+
<View style={styles.boltWrapper}>
37+
<BoltIcon height={64 * 1.3} width={126 * 1.3} />
38+
</View>
39+
<View style={styles.wordWrapper}>
40+
<LightningWord height={31.2} width={245.7} />
41+
</View>
42+
<FormStretcher>
43+
<Text>Unlock with your pin</Text>
44+
<PinBubbles pin={store.wallet.password} style={styles.bubbles} />
45+
</FormStretcher>
46+
<PinKeyboard
47+
onInput={digit => wallet.pushPinDigit({ digit, param: 'password' })}
48+
onBackspace={() => wallet.popPinDigit({ param: 'password' })}
49+
/>
50+
</MainContent>
51+
</Background>
52+
);
53+
54+
SetPasswordView.propTypes = {
55+
store: PropTypes.object.isRequired,
56+
wallet: PropTypes.object.isRequired,
57+
};
58+
59+
export default observer(SetPasswordView);

0 commit comments

Comments
 (0)