2019-01-09 14:45:02 +01:00
|
|
|
/* eslint react/prop-types: 0 */
|
2018-01-30 23:42:38 +01:00
|
|
|
/** @type {AppStorage} */
|
2018-03-17 21:39:21 +01:00
|
|
|
import React, { Component } from 'react';
|
2018-06-25 00:22:46 +02:00
|
|
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
2018-12-25 15:16:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-09-22 13:26:45 +02:00
|
|
|
import { Icon, Button, FormLabel, FormInput, Text, Header, List, ListItem } from 'react-native-elements';
|
2018-12-12 04:33:28 +01:00
|
|
|
import {
|
|
|
|
TouchableOpacity,
|
|
|
|
TouchableWithoutFeedback,
|
|
|
|
Animated,
|
|
|
|
ActivityIndicator,
|
|
|
|
View,
|
2019-01-21 16:57:02 +01:00
|
|
|
UIManager,
|
2018-12-12 04:33:28 +01:00
|
|
|
StyleSheet,
|
|
|
|
Dimensions,
|
|
|
|
Image,
|
|
|
|
SafeAreaView,
|
|
|
|
Clipboard,
|
|
|
|
Platform,
|
2019-01-21 14:55:39 +01:00
|
|
|
LayoutAnimation,
|
2018-12-23 05:13:58 +01:00
|
|
|
TextInput,
|
2018-12-12 04:33:28 +01:00
|
|
|
} from 'react-native';
|
2018-12-11 23:52:46 +01:00
|
|
|
import LinearGradient from 'react-native-linear-gradient';
|
2019-01-25 05:46:03 +01:00
|
|
|
import { LightningCustodianWallet } from './class';
|
2018-06-25 00:22:46 +02:00
|
|
|
import Carousel from 'react-native-snap-carousel';
|
2018-12-11 23:52:46 +01:00
|
|
|
import DeviceInfo from 'react-native-device-info';
|
2018-12-25 15:16:23 +01:00
|
|
|
import { BitcoinUnit } from './models/bitcoinUnits';
|
2019-01-24 08:36:01 +01:00
|
|
|
import NavigationService from './NavigationService';
|
2019-01-25 05:46:03 +01:00
|
|
|
import WalletGradient from './class/walletGradient';
|
2018-06-25 00:22:46 +02:00
|
|
|
let loc = require('./loc/');
|
2018-05-22 19:10:53 +02:00
|
|
|
/** @type {AppStorage} */
|
2018-03-17 21:39:21 +01:00
|
|
|
let BlueApp = require('./BlueApp');
|
2018-05-12 22:27:34 +02:00
|
|
|
const { height, width } = Dimensions.get('window');
|
|
|
|
const aspectRatio = height / width;
|
|
|
|
let isIpad;
|
|
|
|
if (aspectRatio > 1.6) {
|
|
|
|
isIpad = false;
|
|
|
|
} else {
|
|
|
|
isIpad = true;
|
|
|
|
}
|
2018-01-30 23:42:38 +01:00
|
|
|
|
|
|
|
export class BlueButton extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2019-01-25 07:12:07 +01:00
|
|
|
const backgroundColor = this.props.disabled ? '#99a0ab' : '#ccddf9';
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
2019-01-24 20:31:30 +01:00
|
|
|
<TouchableOpacity
|
2018-03-17 21:39:21 +01:00
|
|
|
style={{
|
2019-01-24 20:31:30 +01:00
|
|
|
flex: 1,
|
2018-03-17 21:39:21 +01:00
|
|
|
borderWidth: 0.7,
|
2018-06-30 15:36:13 +02:00
|
|
|
borderColor: 'transparent',
|
2019-01-25 07:12:07 +01:00
|
|
|
backgroundColor: backgroundColor,
|
2019-01-24 20:31:30 +01:00
|
|
|
minHeight: 45,
|
|
|
|
height: 45,
|
|
|
|
borderRadius: 25,
|
|
|
|
minWidth: width / 1.5,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
2018-03-17 21:39:21 +01:00
|
|
|
}}
|
2019-01-24 19:44:33 +01:00
|
|
|
{...this.props}
|
2019-01-24 20:31:30 +01:00
|
|
|
>
|
|
|
|
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
{this.props.icon && <Icon name={this.props.icon.name} type={this.props.icon.type} color={this.props.icon.color} />}
|
2019-01-25 07:12:07 +01:00
|
|
|
{this.props.title && <Text style={{ marginHorizontal: 8, fontSize: 16, color: '#0c2550' }}>{this.props.title}</Text>}
|
2019-01-24 20:31:30 +01:00
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
2018-07-14 20:54:27 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BitcoinButton extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
|
|
|
// eslint-disable-next-line
|
|
|
|
if (this.props.onPress) this.props.onPress();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
// eslint-disable-next-line
|
|
|
|
borderColor: (this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2',
|
|
|
|
borderWidth: 0.5,
|
|
|
|
borderRadius: 5,
|
|
|
|
backgroundColor: '#f5f5f5',
|
|
|
|
// eslint-disable-next-line
|
|
|
|
width: this.props.style.width,
|
|
|
|
// eslint-disable-next-line
|
|
|
|
height: this.props.style.height,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={{ paddingTop: 30 }}>
|
|
|
|
<Icon name="btc" size={32} type="font-awesome" color={(this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2'} />
|
|
|
|
<Text style={{ textAlign: 'center', color: (this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2' }}>
|
2018-07-28 21:14:08 +02:00
|
|
|
{loc.wallets.add.bitcoin}
|
2018-07-14 20:54:27 +02:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class LightningButton extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
|
|
|
// eslint-disable-next-line
|
|
|
|
if (this.props.onPress) this.props.onPress();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
// eslint-disable-next-line
|
|
|
|
borderColor: (this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2',
|
|
|
|
borderWidth: 0.5,
|
|
|
|
borderRadius: 5,
|
|
|
|
backgroundColor: '#f5f5f5',
|
|
|
|
// eslint-disable-next-line
|
|
|
|
width: this.props.style.width,
|
|
|
|
// eslint-disable-next-line
|
|
|
|
height: this.props.style.height,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={{ paddingTop: 30 }}>
|
|
|
|
<Icon name="bolt" size={32} type="font-awesome" color={(this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2'} />
|
|
|
|
<Text style={{ textAlign: 'center', color: (this.props.active && BlueApp.settings.foregroundColor) || '#d2d2d2' }}>
|
2018-12-17 21:02:33 +01:00
|
|
|
{loc.wallets.add.lightning}
|
2018-07-14 20:54:27 +02:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueButtonLink extends Component {
|
|
|
|
render() {
|
|
|
|
// eslint-disable-next-line
|
|
|
|
this.props.buttonStyle = this.props.buttonStyle || {};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Button
|
|
|
|
activeOpacity={0.1}
|
|
|
|
delayPressIn={0}
|
|
|
|
{...this.props}
|
|
|
|
style={{
|
|
|
|
marginTop: 20,
|
|
|
|
borderWidth: 0.7,
|
|
|
|
borderColor: 'transparent',
|
|
|
|
}}
|
|
|
|
buttonStyle={{
|
2018-09-18 08:48:53 +02:00
|
|
|
height: 45,
|
2018-07-22 16:49:59 +02:00
|
|
|
width: width / 1.5,
|
2018-07-14 20:54:27 +02:00
|
|
|
}}
|
|
|
|
backgroundColor="transparent"
|
2018-06-30 15:36:13 +02:00
|
|
|
color="#0c2550"
|
2018-01-30 23:42:38 +01:00
|
|
|
/>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-11 23:52:46 +01:00
|
|
|
export const BlueNavigationStyle = (navigation, withNavigationCloseButton = false, customCloseButtonFunction = undefined) => ({
|
2018-10-29 23:11:48 +01:00
|
|
|
headerStyle: {
|
|
|
|
backgroundColor: '#FFFFFF',
|
|
|
|
borderBottomWidth: 0,
|
2018-12-11 23:52:46 +01:00
|
|
|
elevation: 0,
|
2018-10-29 23:11:48 +01:00
|
|
|
},
|
|
|
|
headerTitleStyle: {
|
|
|
|
fontWeight: '600',
|
|
|
|
color: '#0c2550',
|
|
|
|
},
|
|
|
|
headerTintColor: '#0c2550',
|
|
|
|
headerRight: withNavigationCloseButton ? (
|
2018-12-11 23:52:46 +01:00
|
|
|
<TouchableOpacity
|
|
|
|
style={{ width: 40, height: 40, padding: 14 }}
|
|
|
|
onPress={customCloseButtonFunction === undefined ? () => navigation.goBack(null) : customCloseButtonFunction}
|
|
|
|
>
|
2018-11-10 00:44:34 +01:00
|
|
|
<Image style={{ alignSelf: 'center' }} source={require('./img/close.png')} />
|
2018-10-29 23:11:48 +01:00
|
|
|
</TouchableOpacity>
|
|
|
|
) : null,
|
|
|
|
headerBackTitle: null,
|
|
|
|
});
|
|
|
|
|
2018-09-29 06:58:09 +02:00
|
|
|
export const BlueCopyToClipboardButton = ({ stringToCopy }) => {
|
|
|
|
return (
|
|
|
|
<TouchableOpacity {...this.props} onPress={() => Clipboard.setString(stringToCopy)}>
|
|
|
|
<Text style={{ fontSize: 13, fontWeight: '400', color: '#68bbe1' }}>{loc.transactions.details.copy}</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2019-01-21 14:55:39 +01:00
|
|
|
export class BlueCopyTextToClipboard extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
text: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
text: '',
|
|
|
|
};
|
|
|
|
|
|
|
|
state = { hasTappedText: false };
|
|
|
|
|
2019-01-21 16:57:02 +01:00
|
|
|
constructor() {
|
|
|
|
super();
|
2019-01-25 07:12:07 +01:00
|
|
|
if (Platform.OS === 'android') UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
|
2019-01-21 16:57:02 +01:00
|
|
|
}
|
|
|
|
|
2019-01-21 14:55:39 +01:00
|
|
|
copyToClipboard = () => {
|
|
|
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.spring, () => {
|
|
|
|
Clipboard.setString(this.props.text);
|
|
|
|
setTimeout(() => {
|
|
|
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
|
|
|
|
this.setState({ hasTappedText: false });
|
|
|
|
}, 1000);
|
|
|
|
});
|
|
|
|
this.setState({ hasTappedText: true });
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View style={{ justifyContent: 'center', alignItems: 'center', paddingHorizontal: 16 }}>
|
|
|
|
<TouchableOpacity onPress={this.copyToClipboard} disabled={this.state.hasTappedText}>
|
|
|
|
<Text style={styleCopyTextToClipboard.address} numberOfLines={0}>
|
|
|
|
{this.props.text}
|
|
|
|
</Text>
|
|
|
|
{this.state.hasTappedText && (
|
|
|
|
<Text style={styleCopyTextToClipboard.address} numberOfLines={0}>
|
|
|
|
{loc.wallets.xpub.copiedToClipboard}
|
|
|
|
</Text>
|
|
|
|
)}
|
|
|
|
</TouchableOpacity>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const styleCopyTextToClipboard = StyleSheet.create({
|
|
|
|
address: {
|
|
|
|
marginVertical: 32,
|
|
|
|
fontSize: 15,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
textAlign: 'center',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2018-01-30 23:42:38 +01:00
|
|
|
export class SafeBlueArea extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
|
|
|
<SafeAreaView
|
|
|
|
{...this.props}
|
2018-03-17 21:39:21 +01:00
|
|
|
forceInset={{ horizontal: 'always' }}
|
|
|
|
style={{ flex: 1, backgroundColor: BlueApp.settings.brandingColor }}
|
2018-01-30 23:42:38 +01:00
|
|
|
/>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueCard extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-09-22 13:26:45 +02:00
|
|
|
return <View {...this.props} style={{ padding: 20 }} />;
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueText extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-09-01 01:28:19 +02:00
|
|
|
return (
|
|
|
|
<Text
|
2019-01-24 20:48:40 +01:00
|
|
|
style={{
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
|
|
|
|
2018-09-01 01:28:19 +02:00
|
|
|
// eslint-disable-next-line
|
2019-01-24 20:48:40 +01:00
|
|
|
...this.props.style,
|
|
|
|
}}
|
2018-12-11 23:52:46 +01:00
|
|
|
{...this.props}
|
2018-09-01 01:28:19 +02:00
|
|
|
/>
|
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
2018-07-14 20:54:27 +02:00
|
|
|
export class BlueTextCentered extends Component {
|
|
|
|
render() {
|
|
|
|
return <Text {...this.props} style={{ color: BlueApp.settings.foregroundColor, textAlign: 'center' }} />;
|
|
|
|
}
|
|
|
|
}
|
2018-01-30 23:42:38 +01:00
|
|
|
|
|
|
|
export class BlueListItem extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
|
|
|
<ListItem
|
2018-09-29 00:17:26 +02:00
|
|
|
bottomDivider
|
2018-05-06 19:36:48 +02:00
|
|
|
containerStyle={{
|
2018-06-25 00:22:46 +02:00
|
|
|
backgroundColor: 'transparent',
|
2018-09-29 00:17:26 +02:00
|
|
|
borderBottomStartRadius: 20,
|
|
|
|
borderBottomEndRadius: 20,
|
|
|
|
borderBottomColor: '#ededed',
|
2018-05-06 19:36:48 +02:00
|
|
|
}}
|
2018-06-25 00:22:46 +02:00
|
|
|
titleStyle={{
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: '500',
|
|
|
|
}}
|
|
|
|
subtitleStyle={{ color: '#9aa0aa' }}
|
2018-09-29 17:35:04 +02:00
|
|
|
subtitleNumberOfLines={1}
|
2018-09-30 10:31:09 +02:00
|
|
|
{...this.props}
|
2018-01-30 23:42:38 +01:00
|
|
|
/>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueFormLabel extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-07-14 20:54:27 +02:00
|
|
|
return <FormLabel {...this.props} labelStyle={{ color: BlueApp.settings.foregroundColor, fontWeight: '400' }} />;
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueFormInput extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-05-06 19:14:22 +02:00
|
|
|
return (
|
|
|
|
<FormInput
|
|
|
|
{...this.props}
|
2018-07-22 16:49:59 +02:00
|
|
|
inputStyle={{ color: BlueApp.settings.foregroundColor, maxWidth: width - 105 }}
|
|
|
|
containerStyle={{
|
|
|
|
marginTop: 5,
|
|
|
|
borderColor: '#d2d2d2',
|
|
|
|
borderBottomColor: '#d2d2d2',
|
|
|
|
borderWidth: 0.5,
|
|
|
|
borderBottomWidth: 0.5,
|
|
|
|
backgroundColor: '#f5f5f5',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueFormMultiInput extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-12-23 05:13:58 +01:00
|
|
|
<TextInput
|
2018-07-22 16:49:59 +02:00
|
|
|
multiline
|
2018-11-01 20:44:39 +01:00
|
|
|
underlineColorAndroid="transparent"
|
2018-07-22 16:49:59 +02:00
|
|
|
numberOfLines={4}
|
2018-12-23 05:13:58 +01:00
|
|
|
style={{
|
2018-07-14 20:54:27 +02:00
|
|
|
marginTop: 5,
|
2018-12-23 05:13:58 +01:00
|
|
|
marginHorizontal: 20,
|
2018-07-14 20:54:27 +02:00
|
|
|
borderColor: '#d2d2d2',
|
|
|
|
borderBottomColor: '#d2d2d2',
|
|
|
|
borderWidth: 0.5,
|
2018-05-22 19:12:16 +02:00
|
|
|
borderBottomWidth: 0.5,
|
2018-07-14 20:54:27 +02:00
|
|
|
backgroundColor: '#f5f5f5',
|
2018-12-23 05:13:58 +01:00
|
|
|
height: 200,
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
2018-05-22 19:12:16 +02:00
|
|
|
}}
|
2018-12-23 05:13:58 +01:00
|
|
|
autoCorrect={false}
|
|
|
|
autoCapitalize="none"
|
|
|
|
spellCheck={false}
|
2018-12-22 17:51:07 +01:00
|
|
|
{...this.props}
|
2018-05-06 19:14:22 +02:00
|
|
|
/>
|
|
|
|
);
|
2018-05-06 19:12:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueFormInputAddress extends Component {
|
|
|
|
render() {
|
2018-05-06 19:14:22 +02:00
|
|
|
return (
|
|
|
|
<FormInput
|
|
|
|
{...this.props}
|
2018-05-22 19:12:16 +02:00
|
|
|
inputStyle={{
|
2018-08-19 00:10:12 +02:00
|
|
|
maxWidth: width - 110,
|
2018-05-22 19:12:16 +02:00
|
|
|
color: BlueApp.settings.foregroundColor,
|
2018-07-18 00:43:23 +02:00
|
|
|
fontSize: (isIpad && 10) || ((is.iphone8() && 12) || 14),
|
2018-05-22 19:12:16 +02:00
|
|
|
}}
|
|
|
|
containerStyle={{
|
2018-07-18 00:43:23 +02:00
|
|
|
marginTop: 5,
|
|
|
|
borderColor: '#d2d2d2',
|
|
|
|
borderBottomColor: '#d2d2d2',
|
|
|
|
borderWidth: 0.5,
|
2018-05-22 19:12:16 +02:00
|
|
|
borderBottomWidth: 0.5,
|
2018-07-18 00:43:23 +02:00
|
|
|
backgroundColor: '#f5f5f5',
|
2018-05-22 19:12:16 +02:00
|
|
|
}}
|
2018-05-06 19:14:22 +02:00
|
|
|
/>
|
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueHeader extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
|
|
|
<Header
|
|
|
|
{...this.props}
|
2018-06-25 00:22:46 +02:00
|
|
|
backgroundColor="transparent"
|
|
|
|
outerContainerStyles={{
|
|
|
|
borderBottomColor: 'transparent',
|
|
|
|
borderBottomWidth: 0,
|
|
|
|
}}
|
2018-06-28 03:43:28 +02:00
|
|
|
statusBarProps={{ barStyle: 'default' }}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueHeaderDefaultSub extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<SafeAreaView style={{ backgroundColor: '#FFFFFF' }}>
|
2018-09-19 03:59:16 +02:00
|
|
|
<Header
|
|
|
|
backgroundColor="#FFFFFF"
|
|
|
|
outerContainerStyles={{
|
|
|
|
borderBottomColor: 'transparent',
|
|
|
|
borderBottomWidth: 0,
|
|
|
|
}}
|
|
|
|
statusBarProps={{ barStyle: 'default' }}
|
|
|
|
leftComponent={
|
|
|
|
<Text
|
2018-10-04 03:49:29 +02:00
|
|
|
adjustsFontSizeToFit
|
2018-09-19 03:59:16 +02:00
|
|
|
style={{
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 34,
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{
|
|
|
|
// eslint-disable-next-line
|
|
|
|
this.props.leftText
|
|
|
|
}
|
|
|
|
</Text>
|
|
|
|
}
|
|
|
|
rightComponent={
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={() => {
|
|
|
|
// eslint-disable-next-line
|
|
|
|
if (this.props.onClose) this.props.onClose();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={stylesBlueIcon.box}>
|
|
|
|
<View style={stylesBlueIcon.ballTransparrent}>
|
2018-11-01 20:44:39 +01:00
|
|
|
<Image source={require('./img/close.png')} />
|
2018-09-19 03:59:16 +02:00
|
|
|
</View>
|
2018-06-28 03:43:28 +02:00
|
|
|
</View>
|
2018-09-19 03:59:16 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
}
|
2018-09-30 10:31:09 +02:00
|
|
|
{...this.props}
|
2018-09-19 03:59:16 +02:00
|
|
|
/>
|
|
|
|
</SafeAreaView>
|
2018-06-28 03:43:28 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueHeaderDefaultMain extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<SafeAreaView style={{ backgroundColor: '#FFFFFF' }}>
|
2018-09-30 11:56:32 +02:00
|
|
|
<Header
|
|
|
|
{...this.props}
|
|
|
|
backgroundColor="#FFFFFF"
|
|
|
|
outerContainerStyles={{
|
|
|
|
borderBottomColor: 'transparent',
|
|
|
|
borderBottomWidth: 0,
|
|
|
|
}}
|
|
|
|
statusBarProps={{ barStyle: 'default' }}
|
|
|
|
leftComponent={
|
|
|
|
<Text
|
2018-10-04 03:49:29 +02:00
|
|
|
numberOfLines={0}
|
2018-09-30 11:56:32 +02:00
|
|
|
style={{
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 34,
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{
|
|
|
|
// eslint-disable-next-line
|
|
|
|
this.props.leftText
|
|
|
|
}
|
|
|
|
</Text>
|
|
|
|
}
|
|
|
|
rightComponent={
|
|
|
|
<TouchableOpacity
|
|
|
|
onPress={this.props.onNewWalletPress}
|
|
|
|
style={{
|
|
|
|
height: 48,
|
|
|
|
alignSelf: 'flex-end',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<BluePlusIcon />
|
|
|
|
</TouchableOpacity>
|
|
|
|
}
|
|
|
|
/>
|
2018-09-19 03:59:16 +02:00
|
|
|
</SafeAreaView>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueSpacing extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-07-07 15:04:32 +02:00
|
|
|
return <View {...this.props} style={{ height: 60, backgroundColor: BlueApp.settings.brandingColor }} />;
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
2018-06-29 00:17:14 +02:00
|
|
|
|
2018-05-12 22:27:34 +02:00
|
|
|
export class BlueSpacing40 extends Component {
|
|
|
|
render() {
|
2018-07-07 15:04:32 +02:00
|
|
|
return <View {...this.props} style={{ height: 50, backgroundColor: BlueApp.settings.brandingColor }} />;
|
2018-05-12 22:27:34 +02:00
|
|
|
}
|
|
|
|
}
|
2018-01-30 23:42:38 +01:00
|
|
|
|
2018-06-29 00:17:14 +02:00
|
|
|
export class BlueSpacingVariable extends Component {
|
|
|
|
render() {
|
|
|
|
if (isIpad) {
|
|
|
|
return <BlueSpacing40 {...this.props} />;
|
|
|
|
} else {
|
|
|
|
return <BlueSpacing {...this.props} />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class is {
|
|
|
|
static ipad() {
|
|
|
|
return isIpad;
|
|
|
|
}
|
2018-07-18 00:43:23 +02:00
|
|
|
|
|
|
|
static iphone8() {
|
2018-11-10 00:44:34 +01:00
|
|
|
if (Platform.OS !== 'ios') {
|
|
|
|
return false;
|
|
|
|
}
|
2018-12-11 23:52:46 +01:00
|
|
|
return DeviceInfo.getDeviceId() === 'iPhone10,4';
|
2018-07-18 00:43:23 +02:00
|
|
|
}
|
2018-06-29 00:17:14 +02:00
|
|
|
}
|
|
|
|
|
2018-01-30 23:42:38 +01:00
|
|
|
export class BlueSpacing20 extends Component {
|
2018-06-25 00:22:46 +02:00
|
|
|
render() {
|
|
|
|
return <View {...this.props} style={{ height: 20, opacity: 0 }} />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueList extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
2018-06-25 00:22:46 +02:00
|
|
|
<List
|
2018-01-30 23:42:38 +01:00
|
|
|
{...this.props}
|
2018-06-25 00:22:46 +02:00
|
|
|
containerStyle={{
|
|
|
|
backgroundColor: BlueApp.settings.brandingColor,
|
|
|
|
borderTopColor: 'transparent',
|
|
|
|
borderTopWidth: 0,
|
2018-09-22 13:26:45 +02:00
|
|
|
flex: 1,
|
2018-06-25 00:22:46 +02:00
|
|
|
}}
|
2018-01-30 23:42:38 +01:00
|
|
|
/>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
export class BlueLoading extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-06-25 00:22:46 +02:00
|
|
|
return (
|
|
|
|
<SafeBlueArea>
|
|
|
|
<View style={{ flex: 1, paddingTop: 200 }}>
|
|
|
|
<ActivityIndicator />
|
|
|
|
</View>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
const stylesBlueIcon = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
box1: {
|
|
|
|
position: 'relative',
|
|
|
|
top: 15,
|
|
|
|
},
|
2018-06-28 03:43:28 +02:00
|
|
|
box: {
|
2018-09-19 03:59:16 +02:00
|
|
|
alignSelf: 'flex-end',
|
|
|
|
paddingHorizontal: 14,
|
|
|
|
paddingTop: 8,
|
2018-06-28 03:43:28 +02:00
|
|
|
},
|
2018-06-25 00:22:46 +02:00
|
|
|
boxIncomming: {
|
|
|
|
position: 'relative',
|
|
|
|
},
|
|
|
|
ball: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: '#ccddf9',
|
|
|
|
},
|
|
|
|
ballIncomming: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: '#d2f8d6',
|
2018-12-31 23:29:36 +01:00
|
|
|
transform: [{ rotate: '-45deg' }],
|
|
|
|
},
|
|
|
|
ballIncommingWithoutRotate: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: '#d2f8d6',
|
2018-06-25 00:22:46 +02:00
|
|
|
},
|
|
|
|
ballReceive: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderBottomLeftRadius: 15,
|
|
|
|
backgroundColor: '#d2f8d6',
|
|
|
|
transform: [{ rotate: '-45deg' }],
|
|
|
|
},
|
|
|
|
ballOutgoing: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: '#f8d2d2',
|
2018-12-31 23:29:36 +01:00
|
|
|
transform: [{ rotate: '225deg' }],
|
2018-06-25 00:22:46 +02:00
|
|
|
},
|
2018-12-28 22:43:38 +01:00
|
|
|
ballOutgoingWithoutRotate: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: '#f8d2d2',
|
|
|
|
},
|
2018-06-25 00:22:46 +02:00
|
|
|
ballTransparrent: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
},
|
|
|
|
ballDimmed: {
|
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
borderRadius: 15,
|
|
|
|
backgroundColor: 'gray',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
export class BluePlusIcon extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
2018-06-25 00:22:46 +02:00
|
|
|
<View {...this.props} style={stylesBlueIcon.container}>
|
|
|
|
<View style={stylesBlueIcon.box1}>
|
|
|
|
<View style={stylesBlueIcon.ball}>
|
|
|
|
<Ionicons
|
|
|
|
{...this.props}
|
|
|
|
name={'ios-add'}
|
|
|
|
size={26}
|
|
|
|
style={{
|
|
|
|
color: BlueApp.settings.foregroundColor,
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
left: 8,
|
|
|
|
top: 1,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
export class BlueTransactionIncommingIcon extends Component {
|
2018-03-17 21:39:21 +01:00
|
|
|
render() {
|
2018-01-30 23:42:38 +01:00
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-06-25 00:22:46 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
|
|
|
<View style={stylesBlueIcon.ballIncomming}>
|
2018-07-07 23:15:14 +02:00
|
|
|
<Icon {...this.props} name="arrow-down" size={16} type="font-awesome" color="#37c0a1" iconStyle={{ left: 0, top: 8 }} />
|
2018-06-25 00:22:46 +02:00
|
|
|
</View>
|
2018-01-30 23:42:38 +01:00
|
|
|
</View>
|
2018-06-25 00:22:46 +02:00
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueTransactionPendingIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-09-25 23:22:11 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
2018-06-25 00:22:46 +02:00
|
|
|
<View style={stylesBlueIcon.ball}>
|
|
|
|
<Icon
|
|
|
|
{...this.props}
|
|
|
|
name="ellipsis-h"
|
|
|
|
size={16}
|
|
|
|
type="font-awesome"
|
|
|
|
color={BlueApp.settings.foregroundColor}
|
|
|
|
iconStyle={{ left: 0, top: 6 }}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-28 22:43:38 +01:00
|
|
|
export class BlueTransactionExpiredIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View {...this.props}>
|
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
|
|
|
<View style={stylesBlueIcon.ballOutgoingWithoutRotate}>
|
2018-12-28 23:16:30 +01:00
|
|
|
<Icon {...this.props} name="hourglass-end" size={16} type="font-awesome" color="#d0021b" iconStyle={{ left: 0, top: 6 }} />
|
2018-12-28 22:43:38 +01:00
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-01 01:28:19 +02:00
|
|
|
export class BlueTransactionOnchainIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-09-01 01:28:19 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
|
|
|
<View style={stylesBlueIcon.ballIncomming}>
|
|
|
|
<Icon
|
|
|
|
{...this.props}
|
|
|
|
name="link"
|
|
|
|
size={16}
|
|
|
|
type="font-awesome"
|
|
|
|
color="#37c0a1"
|
|
|
|
iconStyle={{ left: 0, top: 7, transform: [{ rotate: '-45deg' }] }}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-05 00:18:24 +02:00
|
|
|
export class BlueTransactionOffchainIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-09-05 00:18:24 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
2018-12-31 23:29:36 +01:00
|
|
|
<View style={stylesBlueIcon.ballOutgoingWithoutRotate}>
|
2018-12-29 02:15:59 +01:00
|
|
|
<Icon {...this.props} name="bolt" size={16} type="font-awesome" color="#d0021b" iconStyle={{ left: 0, top: 7 }} />
|
2018-09-05 00:18:24 +02:00
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueTransactionOffchainIncomingIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-09-05 00:18:24 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
2018-12-31 23:29:36 +01:00
|
|
|
<View style={stylesBlueIcon.ballIncommingWithoutRotate}>
|
2018-12-29 02:15:59 +01:00
|
|
|
<Icon {...this.props} name="bolt" size={16} type="font-awesome" color="#37c0a1" iconStyle={{ left: 0, top: 7 }} />
|
2018-09-05 00:18:24 +02:00
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
export class BlueTransactionOutgoingIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-22 13:26:45 +02:00
|
|
|
<View {...this.props}>
|
2018-06-25 00:22:46 +02:00
|
|
|
<View style={stylesBlueIcon.boxIncomming}>
|
|
|
|
<View style={stylesBlueIcon.ballOutgoing}>
|
2018-07-07 23:15:14 +02:00
|
|
|
<Icon {...this.props} name="arrow-down" size={16} type="font-awesome" color="#d0021b" iconStyle={{ left: 0, top: 8 }} />
|
2018-06-25 00:22:46 +02:00
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-29 00:17:14 +02:00
|
|
|
//
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
export class BlueReceiveButtonIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-29 00:17:26 +02:00
|
|
|
<TouchableOpacity {...this.props}>
|
2019-01-05 03:14:23 +01:00
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flex: 1,
|
2019-01-05 03:46:10 +01:00
|
|
|
minWidth: 130,
|
2019-01-05 03:14:23 +01:00
|
|
|
backgroundColor: '#ccddf9',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
|
2018-06-25 00:22:46 +02:00
|
|
|
<View
|
|
|
|
style={{
|
2018-10-20 23:10:21 +02:00
|
|
|
minWidth: 30,
|
|
|
|
minHeight: 30,
|
2019-01-05 03:14:23 +01:00
|
|
|
left: 5,
|
2018-06-25 00:22:46 +02:00
|
|
|
backgroundColor: 'transparent',
|
|
|
|
transform: [{ rotate: '-45deg' }],
|
2018-09-29 00:17:26 +02:00
|
|
|
alignItems: 'center',
|
2019-01-05 03:14:23 +01:00
|
|
|
marginBottom: -11,
|
2018-06-25 00:22:46 +02:00
|
|
|
}}
|
|
|
|
>
|
2019-01-05 03:14:23 +01:00
|
|
|
<Icon {...this.props} name="arrow-down" size={16} type="font-awesome" color="#2f5fb3" />
|
2018-06-25 00:22:46 +02:00
|
|
|
</View>
|
|
|
|
<Text
|
|
|
|
style={{
|
2018-06-30 15:36:13 +02:00
|
|
|
color: '#2f5fb3',
|
2018-06-29 00:17:14 +02:00
|
|
|
fontSize: (isIpad && 10) || 16,
|
2018-06-25 00:22:46 +02:00
|
|
|
fontWeight: '500',
|
|
|
|
left: 5,
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
}}
|
|
|
|
>
|
2019-01-05 03:14:23 +01:00
|
|
|
{loc.receive.header}
|
2018-06-25 00:22:46 +02:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class BlueSendButtonIcon extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-09-29 00:17:26 +02:00
|
|
|
<TouchableOpacity {...this.props}>
|
2019-01-05 03:14:23 +01:00
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flex: 1,
|
2019-01-05 03:46:10 +01:00
|
|
|
minWidth: 130,
|
2019-01-05 03:14:23 +01:00
|
|
|
backgroundColor: '#ccddf9',
|
2019-01-05 03:46:10 +01:00
|
|
|
alignItems: 'center',
|
2019-01-05 03:14:23 +01:00
|
|
|
}}
|
|
|
|
>
|
2019-01-05 03:46:10 +01:00
|
|
|
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}>
|
2018-06-25 00:22:46 +02:00
|
|
|
<View
|
|
|
|
style={{
|
2018-10-20 23:10:21 +02:00
|
|
|
minWidth: 30,
|
|
|
|
minHeight: 30,
|
2018-06-25 00:22:46 +02:00
|
|
|
left: 5,
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
transform: [{ rotate: '225deg' }],
|
2019-01-05 03:14:23 +01:00
|
|
|
marginBottom: 11,
|
2018-06-25 00:22:46 +02:00
|
|
|
}}
|
|
|
|
>
|
2019-01-05 03:14:23 +01:00
|
|
|
<Icon {...this.props} name="arrow-down" size={16} type="font-awesome" color="#2f5fb3" />
|
2018-06-25 00:22:46 +02:00
|
|
|
</View>
|
|
|
|
<Text
|
|
|
|
style={{
|
2018-06-30 15:36:13 +02:00
|
|
|
color: '#2f5fb3',
|
2018-06-29 00:17:14 +02:00
|
|
|
fontSize: (isIpad && 10) || 16,
|
2018-06-25 00:22:46 +02:00
|
|
|
fontWeight: '500',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
}}
|
|
|
|
>
|
2019-01-05 03:14:23 +01:00
|
|
|
{loc.send.header}
|
2018-06-25 00:22:46 +02:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-01 01:28:19 +02:00
|
|
|
export class ManageFundsBigButton extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
2018-10-02 05:40:23 +02:00
|
|
|
<TouchableOpacity {...this.props}>
|
2019-01-05 03:14:23 +01:00
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flex: 1,
|
|
|
|
width: 168,
|
|
|
|
backgroundColor: '#ccddf9',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
|
2018-09-01 01:28:19 +02:00
|
|
|
<View
|
|
|
|
style={{
|
2019-01-05 03:14:23 +01:00
|
|
|
minWidth: 30,
|
|
|
|
minHeight: 30,
|
|
|
|
right: 5,
|
2018-09-01 01:28:19 +02:00
|
|
|
backgroundColor: 'transparent',
|
|
|
|
transform: [{ rotate: '90deg' }],
|
|
|
|
}}
|
|
|
|
>
|
2018-10-02 05:40:23 +02:00
|
|
|
<Icon {...this.props} name="link" size={16} type="font-awesome" color="#2f5fb3" />
|
2018-09-01 01:28:19 +02:00
|
|
|
</View>
|
|
|
|
<Text
|
|
|
|
style={{
|
|
|
|
color: '#2f5fb3',
|
|
|
|
fontSize: (isIpad && 10) || 16,
|
|
|
|
fontWeight: '500',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
}}
|
|
|
|
>
|
2018-10-04 00:32:42 +02:00
|
|
|
{loc.lnd.title}
|
2018-09-01 01:28:19 +02:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
export class BluePlusIconDimmed extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View {...this.props} style={stylesBlueIcon.container}>
|
|
|
|
<View style={stylesBlueIcon.box1}>
|
|
|
|
<View style={stylesBlueIcon.ballDimmed}>
|
|
|
|
<Ionicons
|
|
|
|
{...this.props}
|
|
|
|
name={'ios-add'}
|
|
|
|
size={26}
|
|
|
|
style={{
|
|
|
|
color: 'white',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
left: 8,
|
|
|
|
top: 1,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-11 23:52:46 +01:00
|
|
|
export class NewWalletPanel extends Component {
|
2018-06-25 00:22:46 +02:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
// WalletsCarousel.handleClick = props.handleClick // because cant access `this` from _renderItem
|
|
|
|
// eslint-disable-next-line
|
|
|
|
this.handleClick = props.onPress;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TouchableOpacity
|
|
|
|
{...this.props}
|
|
|
|
onPress={() => {
|
|
|
|
if (this.handleClick) {
|
|
|
|
this.handleClick();
|
|
|
|
}
|
|
|
|
}}
|
2018-11-10 00:44:34 +01:00
|
|
|
style={{ marginVertical: 17 }}
|
2018-06-25 00:22:46 +02:00
|
|
|
>
|
|
|
|
<LinearGradient
|
2019-01-25 05:46:03 +01:00
|
|
|
colors={WalletGradient.createWallet}
|
2018-06-25 00:22:46 +02:00
|
|
|
style={{
|
|
|
|
padding: 15,
|
|
|
|
borderRadius: 10,
|
2018-12-11 23:52:46 +01:00
|
|
|
minHeight: 164,
|
2018-06-25 00:22:46 +02:00
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<BluePlusIconDimmed />
|
|
|
|
<Text
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 20,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{loc.wallets.list.create_a_wallet}
|
|
|
|
</Text>
|
|
|
|
<Text style={{ backgroundColor: 'transparent' }} />
|
|
|
|
<Text
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontSize: 13,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{loc.wallets.list.create_a_wallet1}
|
|
|
|
</Text>
|
|
|
|
<Text
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontSize: 13,
|
|
|
|
color: '#9aa0aa',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{loc.wallets.list.create_a_wallet2}
|
|
|
|
</Text>
|
|
|
|
</LinearGradient>
|
|
|
|
</TouchableOpacity>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-09 06:25:36 +02:00
|
|
|
const sliderWidth = width * 1;
|
|
|
|
const itemWidth = width * 0.82;
|
|
|
|
const sliderHeight = 190;
|
2018-06-25 00:22:46 +02:00
|
|
|
|
|
|
|
export class WalletsCarousel extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
// eslint-disable-next-line
|
|
|
|
WalletsCarousel.handleClick = props.handleClick; // because cant access `this` from _renderItem
|
2018-12-11 23:52:46 +01:00
|
|
|
WalletsCarousel.handleLongPress = props.handleLongPress;
|
2018-06-25 00:22:46 +02:00
|
|
|
// eslint-disable-next-line
|
|
|
|
this.onSnapToItem = props.onSnapToItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
_renderItem({ item, index }) {
|
2018-12-12 04:33:28 +01:00
|
|
|
let scaleValue = new Animated.Value(1.0);
|
|
|
|
|
|
|
|
this.onPressedIn = () => {
|
2018-12-14 05:31:13 +01:00
|
|
|
Animated.spring(scaleValue, { toValue: 0.9, duration: 100, useNativeDriver: Platform.OS === 'android' }).start();
|
2018-12-12 04:33:28 +01:00
|
|
|
};
|
|
|
|
this.onPressedOut = () => {
|
2018-12-13 17:50:18 +01:00
|
|
|
Animated.spring(scaleValue, { toValue: 1.0, duration: 100, useNativeDriver: Platform.OS === 'android' }).start();
|
2018-12-12 04:33:28 +01:00
|
|
|
};
|
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
if (!item) {
|
|
|
|
return (
|
2018-12-11 23:52:46 +01:00
|
|
|
<NewWalletPanel
|
2018-06-25 00:22:46 +02:00
|
|
|
onPress={() => {
|
|
|
|
if (WalletsCarousel.handleClick) {
|
|
|
|
WalletsCarousel.handleClick(index);
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
2018-07-14 21:53:43 +02:00
|
|
|
|
2018-06-25 00:22:46 +02:00
|
|
|
return (
|
2018-12-12 04:33:28 +01:00
|
|
|
<Animated.View
|
|
|
|
style={{ paddingRight: 10, marginVertical: 17, transform: [{ scale: scaleValue }] }}
|
2018-12-11 23:52:46 +01:00
|
|
|
shadowOpacity={40 / 100}
|
|
|
|
shadowOffset={{ width: 0, height: 0 }}
|
|
|
|
shadowRadius={5}
|
|
|
|
>
|
2018-12-12 04:33:28 +01:00
|
|
|
<TouchableWithoutFeedback
|
|
|
|
onPressIn={this.onPressedIn}
|
|
|
|
onPressOut={this.onPressedOut}
|
2018-12-11 23:52:46 +01:00
|
|
|
onLongPress={WalletsCarousel.handleLongPress}
|
2018-11-02 14:53:35 +01:00
|
|
|
onPress={() => {
|
|
|
|
if (WalletsCarousel.handleClick) {
|
2019-01-25 05:46:03 +01:00
|
|
|
WalletsCarousel.handleClick(index);
|
2018-11-02 14:53:35 +01:00
|
|
|
}
|
|
|
|
}}
|
2018-09-29 00:17:26 +02:00
|
|
|
>
|
2018-11-02 14:53:35 +01:00
|
|
|
<LinearGradient
|
|
|
|
shadowColor="#000000"
|
2019-01-25 05:46:03 +01:00
|
|
|
colors={WalletGradient.gradientsFor(item.type)}
|
2018-11-10 00:44:34 +01:00
|
|
|
style={{
|
|
|
|
padding: 15,
|
|
|
|
borderRadius: 10,
|
2018-12-11 23:52:46 +01:00
|
|
|
minHeight: 164,
|
2018-11-10 00:44:34 +01:00
|
|
|
elevation: 5,
|
|
|
|
}}
|
2018-06-25 00:22:46 +02:00
|
|
|
>
|
2018-11-02 14:53:35 +01:00
|
|
|
<Image
|
2018-12-28 16:52:06 +01:00
|
|
|
source={(LightningCustodianWallet.type === item.type && require('./img/lnd-shape.png')) || require('./img/btc-shape.png')}
|
2018-11-02 14:53:35 +01:00
|
|
|
style={{
|
|
|
|
width: 99,
|
|
|
|
height: 94,
|
|
|
|
position: 'absolute',
|
|
|
|
bottom: 0,
|
|
|
|
right: 0,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Text style={{ backgroundColor: 'transparent' }} />
|
|
|
|
<Text
|
|
|
|
numberOfLines={1}
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontSize: 19,
|
|
|
|
color: '#fff',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{item.getLabel()}
|
|
|
|
</Text>
|
|
|
|
<Text
|
|
|
|
numberOfLines={1}
|
|
|
|
adjustsFontSizeToFit
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 36,
|
|
|
|
color: '#fff',
|
|
|
|
}}
|
|
|
|
>
|
2019-01-06 22:23:14 +01:00
|
|
|
{loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit(), true)}
|
2018-11-02 14:53:35 +01:00
|
|
|
</Text>
|
|
|
|
<Text style={{ backgroundColor: 'transparent' }} />
|
|
|
|
<Text
|
|
|
|
numberOfLines={1}
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontSize: 13,
|
|
|
|
color: '#fff',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{loc.wallets.list.latest_transaction}
|
|
|
|
</Text>
|
|
|
|
<Text
|
|
|
|
numberOfLines={1}
|
|
|
|
style={{
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
fontWeight: 'bold',
|
|
|
|
fontSize: 16,
|
|
|
|
color: '#fff',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{loc.transactionTimeToReadable(item.getLatestTransactionTime())}
|
|
|
|
</Text>
|
|
|
|
</LinearGradient>
|
2018-12-12 04:33:28 +01:00
|
|
|
</TouchableWithoutFeedback>
|
|
|
|
</Animated.View>
|
2018-06-25 00:22:46 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2018-10-09 06:25:36 +02:00
|
|
|
<Carousel
|
|
|
|
{...this.props}
|
|
|
|
ref={c => {
|
|
|
|
WalletsCarousel.carousel = c;
|
|
|
|
}}
|
|
|
|
renderItem={this._renderItem}
|
|
|
|
sliderWidth={sliderWidth}
|
|
|
|
sliderHeight={sliderHeight}
|
|
|
|
itemWidth={itemWidth}
|
|
|
|
inactiveSlideScale={1}
|
|
|
|
inactiveSlideOpacity={0.7}
|
2018-11-02 14:53:35 +01:00
|
|
|
contentContainerCustomStyle={{ left: -20 }}
|
2018-10-09 06:25:36 +02:00
|
|
|
onSnapToItem={index => {
|
|
|
|
if (this.onSnapToItem) {
|
|
|
|
this.onSnapToItem(index);
|
|
|
|
}
|
|
|
|
console.log('snapped to card #', index);
|
|
|
|
}}
|
|
|
|
/>
|
2018-03-17 21:39:21 +01:00
|
|
|
);
|
2018-01-30 23:42:38 +01:00
|
|
|
}
|
|
|
|
}
|
2018-12-25 15:16:23 +01:00
|
|
|
|
2019-01-24 08:36:01 +01:00
|
|
|
export class BlueAddressInput extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
isLoading: PropTypes.bool,
|
|
|
|
onChangeText: PropTypes.func,
|
|
|
|
onBarScanned: PropTypes.func,
|
|
|
|
address: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
isLoading: false,
|
|
|
|
address: '',
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View
|
|
|
|
style={{
|
|
|
|
flexDirection: 'row',
|
|
|
|
borderColor: '#d2d2d2',
|
|
|
|
borderBottomColor: '#d2d2d2',
|
|
|
|
borderWidth: 1.0,
|
|
|
|
borderBottomWidth: 0.5,
|
|
|
|
backgroundColor: '#f5f5f5',
|
|
|
|
minHeight: 44,
|
|
|
|
height: 44,
|
|
|
|
marginHorizontal: 20,
|
|
|
|
alignItems: 'center',
|
|
|
|
marginVertical: 8,
|
|
|
|
borderRadius: 4,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<TextInput
|
|
|
|
onChangeText={text => {
|
|
|
|
this.props.onChangeText(text);
|
|
|
|
}}
|
|
|
|
placeholder={loc.send.details.address}
|
|
|
|
numberOfLines={1}
|
|
|
|
value={this.props.address}
|
|
|
|
style={{ flex: 1, marginHorizontal: 8, minHeight: 33 }}
|
|
|
|
editable={!this.props.isLoading}
|
|
|
|
/>
|
|
|
|
<TouchableOpacity
|
|
|
|
disabled={this.props.isLoading}
|
|
|
|
onPress={() => NavigationService.navigate('ScanQrAddress', { onBarScanned: this.props.onBarScanned })}
|
|
|
|
style={{
|
|
|
|
width: 75,
|
|
|
|
height: 36,
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
backgroundColor: '#bebebe',
|
|
|
|
borderRadius: 4,
|
|
|
|
paddingVertical: 4,
|
|
|
|
paddingHorizontal: 8,
|
|
|
|
marginHorizontal: 4,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Icon name="qrcode" size={22} type="font-awesome" color="#FFFFFF" />
|
|
|
|
<Text style={{ color: '#FFFFFF' }}>{loc.send.details.scan}</Text>
|
|
|
|
</TouchableOpacity>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-25 15:16:23 +01:00
|
|
|
export class BlueBitcoinAmount extends Component {
|
|
|
|
static propTypes = {
|
|
|
|
isLoading: PropTypes.bool,
|
2018-12-29 17:25:31 +01:00
|
|
|
amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
2018-12-25 15:16:23 +01:00
|
|
|
onChangeText: PropTypes.func,
|
|
|
|
disabled: PropTypes.bool,
|
2019-01-06 07:39:39 +01:00
|
|
|
unit: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
unit: BitcoinUnit.BTC,
|
2018-12-25 15:16:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2018-12-29 17:25:31 +01:00
|
|
|
const amount = typeof this.props.amount === 'number' ? this.props.amount.toString() : this.props.amount;
|
|
|
|
|
2018-12-25 15:16:23 +01:00
|
|
|
return (
|
2019-01-06 10:30:32 +01:00
|
|
|
<TouchableWithoutFeedback disabled={this.props.pointerEvents === 'none'} onPress={() => this.textInput.focus()}>
|
2019-01-04 04:28:15 +01:00
|
|
|
<View>
|
|
|
|
<View style={{ flexDirection: 'row', justifyContent: 'center', paddingTop: 16, paddingBottom: 16 }}>
|
|
|
|
<TextInput
|
2019-01-06 21:21:04 +01:00
|
|
|
{...this.props}
|
2019-01-04 04:28:15 +01:00
|
|
|
keyboardType="numeric"
|
2019-01-06 21:21:04 +01:00
|
|
|
onChangeText={text => {
|
2019-01-06 21:55:50 +01:00
|
|
|
text = text.replace(',', '.');
|
2019-01-06 21:21:04 +01:00
|
|
|
text = this.props.unit === BitcoinUnit.BTC ? text.replace(/[^0-9.]/g, '') : text.replace(/[^0-9]/g, '');
|
2019-01-07 01:41:25 +01:00
|
|
|
text = text.replace(/(\..*)\./g, '$1');
|
|
|
|
if (text.startsWith('.')) {
|
|
|
|
text = '0.';
|
|
|
|
}
|
2019-01-06 21:21:04 +01:00
|
|
|
this.props.onChangeText(text);
|
|
|
|
}}
|
2019-01-04 04:28:15 +01:00
|
|
|
placeholder="0"
|
|
|
|
maxLength={10}
|
|
|
|
ref={textInput => (this.textInput = textInput)}
|
|
|
|
editable={!this.props.isLoading && !this.props.disabled}
|
|
|
|
value={amount}
|
2019-01-25 07:12:07 +01:00
|
|
|
autoFocus={this.props.pointerEvents !== 'none'}
|
2019-01-04 04:28:15 +01:00
|
|
|
placeholderTextColor={this.props.disabled ? '#99a0ab' : '#0f5cc0'}
|
|
|
|
style={{
|
|
|
|
color: this.props.disabled ? '#99a0ab' : '#0f5cc0',
|
|
|
|
fontSize: 36,
|
|
|
|
fontWeight: '600',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Text
|
|
|
|
style={{
|
|
|
|
color: this.props.disabled ? '#99a0ab' : '#0f5cc0',
|
|
|
|
fontSize: 16,
|
|
|
|
marginHorizontal: 4,
|
|
|
|
paddingBottom: 6,
|
|
|
|
fontWeight: '600',
|
|
|
|
alignSelf: 'flex-end',
|
|
|
|
}}
|
|
|
|
>
|
2019-01-06 07:39:39 +01:00
|
|
|
{' ' + this.props.unit}
|
2019-01-04 04:28:15 +01:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
<View style={{ alignItems: 'center', marginBottom: 22, marginTop: 4 }}>
|
|
|
|
<Text style={{ fontSize: 18, color: '#d4d4d4', fontWeight: '600' }}>
|
2019-01-06 07:39:39 +01:00
|
|
|
{loc.formatBalance(
|
2019-01-06 20:34:01 +01:00
|
|
|
this.props.unit === BitcoinUnit.BTC ? amount || 0 : loc.formatBalanceWithoutSuffix(amount || 0, BitcoinUnit.BTC, false),
|
2019-01-06 07:39:39 +01:00
|
|
|
BitcoinUnit.LOCAL_CURRENCY,
|
2019-01-06 20:34:01 +01:00
|
|
|
false,
|
2019-01-06 07:39:39 +01:00
|
|
|
)}
|
2019-01-04 04:28:15 +01:00
|
|
|
</Text>
|
|
|
|
</View>
|
2018-12-25 15:16:23 +01:00
|
|
|
</View>
|
2019-01-04 03:06:02 +01:00
|
|
|
</TouchableWithoutFeedback>
|
2018-12-25 15:16:23 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|