BlueWallet/BlueComponents.js

170 lines
3.6 KiB
JavaScript
Raw Normal View History

2018-01-30 23:42:38 +01:00
/** @type {AppStorage} */
2018-03-17 21:39:21 +01:00
import React, { Component } from 'react';
import { SafeAreaView } from 'react-navigation';
import {
Button,
FormLabel,
FormInput,
Card,
Text,
Header,
List,
ListItem,
} from 'react-native-elements';
import { ActivityIndicator, ListView, View } from 'react-native';
let BlueApp = require('./BlueApp');
2018-01-30 23:42:38 +01:00
export class BlueButton extends Component {
2018-03-17 21:39:21 +01:00
render() {
2018-01-30 23:42:38 +01:00
return (
<Button
{...this.props}
2018-03-17 21:39:21 +01:00
style={{
marginTop: 20,
borderRadius: 6,
borderWidth: 0.7,
borderColor: '#ffffff',
}}
2018-01-30 23:42:38 +01:00
borderRadius={10}
backgroundColor={BlueApp.settings.buttonBackground}
/>
2018-03-17 21:39:21 +01:00
);
2018-01-30 23:42:38 +01:00
}
/* icon={{name: 'home', type: 'octicon'}} */
}
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-01-30 23:42:38 +01:00
return (
<Card
{...this.props}
2018-03-17 21:39:21 +01:00
titleStyle={{ color: 'white' }}
containerStyle={{ backgroundColor: BlueApp.settings.buttonBackground }}
wrapperStyle={{ backgroundColor: BlueApp.settings.buttonBackground }}
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 BlueText extends Component {
2018-03-17 21:39:21 +01:00
render() {
return <Text {...this.props} style={{ color: 'white' }} />;
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
{...this.props}
2018-03-17 21:39:21 +01:00
containerStyle={{ backgroundColor: BlueApp.settings.brandingColor }}
titleStyle={{ color: 'white', fontSize: 18 }}
subtitleStyle={{ color: 'white' }}
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() {
return <FormLabel {...this.props} labelStyle={{ color: 'white' }} />;
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:12:14 +02:00
return <FormInput {...this.props} inputStyle={{ color: 'white', }} containerStyle={{ borderBottomColor: 'white', borderBottomWidth: 0.5, }} />;
}
}
export class BlueFormInputAddress extends Component {
render() {
return <FormInput {...this.props} inputStyle={{ color: 'white', fontSize : 12, }} containerStyle={{ borderBottomColor: 'white', borderBottomWidth: 0.5, }} />;
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}
backgroundColor={BlueApp.settings.brandingColor}
/>
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-01-30 23:42:38 +01:00
return (
<View
{...this.props}
2018-03-17 21:39:21 +01:00
style={{ height: 60, 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 BlueSpacing20 extends Component {
2018-03-17 21:39:21 +01:00
render() {
2018-01-30 23:42:38 +01:00
return (
<View
{...this.props}
2018-03-17 21:39:21 +01:00
style={{ height: 20, 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 BlueListView extends Component {
2018-03-17 21:39:21 +01:00
render() {
return <ListView {...this.props} />;
2018-01-30 23:42:38 +01:00
}
}
export class BlueList extends Component {
2018-03-17 21:39:21 +01:00
render() {
2018-01-30 23:42:38 +01:00
return (
<List
{...this.props}
2018-03-17 21:39:21 +01:00
containerStyle={{ 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 BlueView extends Component {
2018-03-17 21:39:21 +01:00
render() {
2018-01-30 23:42:38 +01:00
return (
<View
{...this.props}
2018-03-17 21:39:21 +01:00
containerStyle={{ 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 BlueLoading extends Component {
2018-03-17 21:39:21 +01:00
render() {
2018-01-30 23:42:38 +01:00
return (
2018-03-17 21:39:21 +01:00
<SafeBlueArea>
<View style={{ flex: 1, paddingTop: 200 }}>
2018-01-30 23:42:38 +01:00
<ActivityIndicator />
</View>
</SafeBlueArea>
2018-03-17 21:39:21 +01:00
);
2018-01-30 23:42:38 +01:00
}
}