BlueWallet/screen/receive/details.js

92 lines
2.3 KiB
JavaScript
Raw Normal View History

2018-03-17 21:39:21 +01:00
let BlueApp = require('../../BlueApp');
2018-01-30 23:42:38 +01:00
import React, { Component } from 'react';
2018-03-17 21:39:21 +01:00
import { ActivityIndicator, View, TextInput } from 'react-native';
2018-01-30 23:42:38 +01:00
import Ionicons from 'react-native-vector-icons/Ionicons';
2018-03-17 21:39:21 +01:00
import { SafeAreaView } from 'react-navigation';
import { Icon, Card, Header } from 'react-native-elements';
2018-01-30 23:42:38 +01:00
import QRCode from 'react-native-qrcode';
2018-03-17 21:39:21 +01:00
import { List, Button, ListItem } from 'react-native-elements';
2018-01-30 23:42:38 +01:00
import {
2018-03-17 21:39:21 +01:00
BlueLoading,
BlueSpacing20,
BlueList,
BlueButton,
SafeBlueArea,
BlueCard,
BlueText,
BlueListItem,
BlueHeader,
BlueFormInput,
BlueSpacing,
} from '../../BlueComponents';
2018-01-30 23:42:38 +01:00
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 }}
/>
),
2018-03-17 21:39:21 +01:00
};
2018-01-30 23:42:38 +01:00
constructor(props) {
super(props);
2018-03-17 21:39:21 +01:00
let address = props.navigation.state.params.address;
2018-01-30 23:42:38 +01:00
this.state = {
isLoading: true,
2018-03-17 21:39:21 +01:00
address: address,
};
console.log(JSON.stringify(address));
2018-01-30 23:42:38 +01:00
}
async componentDidMount() {
2018-03-17 21:39:21 +01:00
console.log('wallets/details - componentDidMount');
2018-01-30 23:42:38 +01:00
this.setState({
isLoading: false,
2018-03-17 21:39:21 +01:00
});
2018-01-30 23:42:38 +01:00
}
render() {
2018-03-17 21:39:21 +01:00
const { navigate } = this.props.navigation;
2018-01-30 23:42:38 +01:00
if (this.state.isLoading) {
2018-03-17 21:39:21 +01:00
return <BlueLoading />;
2018-01-30 23:42:38 +01:00
}
return (
2018-03-17 21:39:21 +01:00
<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}
/>
2018-01-30 23:42:38 +01:00
<QRCode
value={this.state.address}
size={312}
2018-03-17 21:39:21 +01:00
bgColor="white"
fgColor={BlueApp.settings.brandingColor}
/>
2018-01-30 23:42:38 +01:00
</BlueCard>
<BlueButton
2018-03-17 21:39:21 +01:00
icon={{ name: 'arrow-left', type: 'octicon' }}
2018-01-30 23:42:38 +01:00
backgroundColor={BlueApp.settings.buttonBackground}
2018-03-17 21:39:21 +01:00
onPress={() => this.props.navigation.goBack()}
2018-01-30 23:42:38 +01:00
title="Go back"
/>
</SafeBlueArea>
);
}
}