You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.2 KiB

7 years ago
import React, { Component } from 'react';
7 years ago
import { TextInput } from 'react-native';
7 years ago
import Ionicons from 'react-native-vector-icons/Ionicons';
import QRCode from 'react-native-qrcode';
import {
7 years ago
BlueLoading,
BlueButton,
SafeBlueArea,
BlueCard,
BlueSpacing,
} from '../../BlueComponents';
7 years ago
import PropTypes from 'prop-types';
let BlueApp = require('../../BlueApp');
7 years ago
export default class ReceiveDetails extends Component {
static navigationOptions = {
tabBarLabel: 'Receive',
tabBarIcon: ({ tintColor, focused }) => (
<Ionicons
name={focused ? 'ios-cash' : 'ios-cash-outline'}
size={26}
style={{ color: tintColor }}
/>
),
7 years ago
};
7 years ago
constructor(props) {
super(props);
7 years ago
let address = props.navigation.state.params.address;
7 years ago
this.state = {
isLoading: true,
7 years ago
address: address,
};
console.log(JSON.stringify(address));
7 years ago
}
async componentDidMount() {
7 years ago
console.log('wallets/details - componentDidMount');
7 years ago
this.setState({
isLoading: false,
7 years ago
});
7 years ago
}
render() {
if (this.state.isLoading) {
7 years ago
return <BlueLoading />;
7 years ago
}
return (
7 years ago
<SafeBlueArea
forceInset={{ horizontal: 'always' }}
style={{ flex: 1, paddingTop: 20 }}
>
<BlueSpacing />
<BlueCard
title={'Share this address with payer'}
style={{ alignItems: 'center', flex: 1 }}
>
<TextInput
style={{ marginBottom: 20, color: 'white' }}
editable
value={this.state.address}
/>
7 years ago
<QRCode
value={this.state.address}
size={312}
7 years ago
bgColor="white"
fgColor={BlueApp.settings.brandingColor}
/>
7 years ago
</BlueCard>
<BlueButton
7 years ago
icon={{ name: 'arrow-left', type: 'octicon' }}
7 years ago
backgroundColor={BlueApp.settings.brandingColor}
7 years ago
onPress={() => this.props.navigation.goBack()}
7 years ago
title="Go back"
/>
</SafeBlueArea>
);
}
}
7 years ago
ReceiveDetails.propTypes = {
navigation: PropTypes.shape({
goBack: PropTypes.function,
state: PropTypes.shape({
params: PropTypes.shape({
address: PropTypes.string,
}),
}),
}),
};