|
| 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