/** @type {AppStorage} */
import React, { Component } from 'react';
import { SafeAreaView } from 'react-navigation';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { LinearGradient } from 'expo';
import {
Icon,
Button,
FormLabel,
FormInput,
Card,
Text,
Header,
List,
ListItem,
} from 'react-native-elements';
import {
TouchableOpacity,
ActivityIndicator,
View,
StyleSheet,
Dimensions,
Image,
} from 'react-native';
import Carousel from 'react-native-snap-carousel';
let loc = require('./loc/');
/** @type {AppStorage} */
let BlueApp = require('./BlueApp');
const { height, width } = Dimensions.get('window');
const aspectRatio = height / width;
let isIpad;
if (aspectRatio > 1.6) {
isIpad = false;
} else {
isIpad = true;
}
export class BlueButton extends Component {
render() {
return (
);
}
/* icon={{name: 'home', type: 'octicon'}} */
}
export class SafeBlueArea extends Component {
render() {
return (
);
}
}
export class BlueCard extends Component {
render() {
return (
);
}
}
export class BlueText extends Component {
render() {
return (
);
}
}
export class BlueListItem extends Component {
render() {
return (
);
}
}
export class BlueFormLabel extends Component {
render() {
return (
);
}
}
export class BlueFormInput extends Component {
render() {
return (
);
}
}
export class BlueFormInputAddress extends Component {
render() {
return (
);
}
}
export class BlueHeader extends Component {
render() {
return (
);
}
}
export class BlueHeaderDefaultSub extends Component {
render() {
return (
{
// eslint-disable-next-line
this.props.leftText
}
}
rightComponent={
{
// eslint-disable-next-line
if (this.props.onClose) this.props.onClose();
}}
>
}
/>
);
}
}
export class BlueHeaderDefaultMain extends Component {
render() {
return (
{
// eslint-disable-next-line
this.props.leftText
}
}
rightComponent={
{
// eslint-disable-next-line
if (this.props.onClose) this.props.onClose();
}}
>
}
/>
);
}
}
export class BlueSpacing extends Component {
render() {
return (
);
}
}
export class BlueSpacing40 extends Component {
render() {
return (
);
}
}
export class BlueSpacingVariable extends Component {
render() {
if (isIpad) {
return ;
} else {
return ;
}
}
}
export class is {
static ipad() {
return isIpad;
}
}
export class BlueSpacing20 extends Component {
render() {
return ;
}
}
export class BlueList extends Component {
render() {
return (
);
}
}
export class BlueLoading extends Component {
render() {
return (
);
}
}
const stylesBlueIcon = StyleSheet.create({
container: {
flex: 1,
},
containerRefresh: {
flex: 1,
position: 'absolute',
right: 10,
},
box1: {
position: 'relative',
top: 15,
},
box: {
position: 'relative',
},
boxIncomming: {
position: 'relative',
},
ball: {
width: 30,
height: 30,
borderRadius: 15,
backgroundColor: '#ccddf9',
},
ballIncomming: {
width: 30,
height: 30,
borderRadius: 15,
backgroundColor: '#d2f8d6',
transform: [{ rotate: '-45deg' }],
},
ballReceive: {
width: 30,
height: 30,
borderBottomLeftRadius: 15,
backgroundColor: '#d2f8d6',
transform: [{ rotate: '-45deg' }],
},
ballOutgoing: {
width: 30,
height: 30,
borderRadius: 15,
backgroundColor: '#f8d2d2',
transform: [{ rotate: '225deg' }],
},
ballTransparrent: {
width: 30,
height: 30,
borderRadius: 15,
backgroundColor: 'transparent',
},
ballDimmed: {
width: 30,
height: 30,
borderRadius: 15,
backgroundColor: 'gray',
},
});
export class BluePlusIcon extends Component {
render() {
return (
);
}
}
export class BlueRefreshIcon extends Component {
render() {
return (
);
}
}
export class BlueTransactionIncommingIcon extends Component {
render() {
return (
);
}
}
export class BlueTransactionPendingIcon extends Component {
render() {
return (
);
}
}
export class BlueTransactionOutgoingIcon extends Component {
render() {
return (
);
}
}
//
export class BlueReceiveButtonIcon extends Component {
render() {
return (
{loc.receive.list.header}
);
}
}
export class BlueSendButtonIcon extends Component {
render() {
return (
{loc.send.list.header}
);
}
}
export class BluePlusIconDimmed extends Component {
render() {
return (
);
}
}
export class NewWalletPannel extends Component {
constructor(props) {
super(props);
// WalletsCarousel.handleClick = props.handleClick // because cant access `this` from _renderItem
// eslint-disable-next-line
this.handleClick = props.onPress;
}
render() {
return (
{
if (this.handleClick) {
this.handleClick();
}
}}
>
{loc.wallets.list.create_a_wallet}
{loc.wallets.list.create_a_wallet1}
{loc.wallets.list.create_a_wallet2}
);
}
}
let sliderWidth = width * 1;
let itemWidth = width * 0.82;
let sliderHeight = 175;
export class WalletsCarousel extends Component {
constructor(props) {
super(props);
// eslint-disable-next-line
WalletsCarousel.handleClick = props.handleClick; // because cant access `this` from _renderItem
// eslint-disable-next-line
this.onSnapToItem = props.onSnapToItem;
}
_renderItem({ item, index }) {
if (!item) {
return (
{
if (WalletsCarousel.handleClick) {
WalletsCarousel.handleClick(index);
}
}}
/>
);
}
return (
{
if (WalletsCarousel.handleClick) {
WalletsCarousel.handleClick(index);
}
}}
>
{item.getLabel()}
{item.getBalance()} BTC
latest transaction
{loc.transactionTimeToReadable(item.getLatestTransactionTime())}
);
}
render() {
return (
{
WalletsCarousel.carousel = c;
}}
renderItem={this._renderItem}
sliderWidth={sliderWidth}
itemWidth={itemWidth}
inactiveSlideScale={1}
inactiveSlideOpacity={0.7}
onSnapToItem={index => {
if (this.onSnapToItem) {
this.onSnapToItem(index);
}
console.log('snapped to card #', index);
}}
/>
);
}
}