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.

209 lines
4.6 KiB

7 years ago
/** @type {AppStorage} */
7 years ago
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, Dimensions } from 'react-native';
7 years ago
/** @type {AppStorage} */
7 years ago
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;
}
7 years ago
export class BlueButton extends Component {
7 years ago
render() {
7 years ago
return (
<Button
{...this.props}
7 years ago
style={{
marginTop: 20,
borderRadius: 6,
borderWidth: 0.7,
7 years ago
borderColor: BlueApp.settings.foregroundColor,
7 years ago
}}
7 years ago
borderRadius={10}
backgroundColor={BlueApp.settings.buttonBackground}
/>
7 years ago
);
7 years ago
}
/* icon={{name: 'home', type: 'octicon'}} */
}
export class SafeBlueArea extends Component {
7 years ago
render() {
7 years ago
return (
<SafeAreaView
{...this.props}
7 years ago
forceInset={{ horizontal: 'always' }}
style={{ flex: 1, backgroundColor: BlueApp.settings.brandingColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueCard extends Component {
7 years ago
render() {
7 years ago
return (
<Card
{...this.props}
7 years ago
titleStyle={{ color: BlueApp.settings.foregroundColor }}
7 years ago
containerStyle={{ backgroundColor: BlueApp.settings.brandingColor }}
wrapperStyle={{ backgroundColor: BlueApp.settings.brandingColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueText extends Component {
7 years ago
render() {
7 years ago
return <Text {...this.props} style={{ color: BlueApp.settings.foregroundColor }} />;
7 years ago
}
}
export class BlueListItem extends Component {
7 years ago
render() {
7 years ago
return (
<ListItem
{...this.props}
7 years ago
containerStyle={{
backgroundColor: BlueApp.settings.brandingColor,
7 years ago
borderBottomColor: BlueApp.settings.foregroundColor,
7 years ago
borderBottomWidth: 0.5,
}}
7 years ago
titleStyle={{ color: BlueApp.settings.foregroundColor, fontSize: 18 }}
subtitleStyle={{ color: BlueApp.settings.foregroundColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueFormLabel extends Component {
7 years ago
render() {
7 years ago
return <FormLabel {...this.props} labelStyle={{ color: BlueApp.settings.foregroundColor }} />;
7 years ago
}
}
export class BlueFormInput extends Component {
7 years ago
render() {
7 years ago
return (
<FormInput
{...this.props}
7 years ago
inputStyle={{ color: BlueApp.settings.foregroundColor }}
containerStyle={{ borderBottomColor: BlueApp.settings.foregroundColor, borderBottomWidth: 0.5 }}
7 years ago
/>
);
}
}
export class BlueFormInputAddress extends Component {
render() {
7 years ago
return (
<FormInput
{...this.props}
7 years ago
inputStyle={{ color: BlueApp.settings.foregroundColor, fontSize: (isIpad && 10) || 12 }}
containerStyle={{ borderBottomColor: BlueApp.settings.foregroundColor, borderBottomWidth: 0.5 }}
7 years ago
/>
);
7 years ago
}
}
export class BlueHeader extends Component {
7 years ago
render() {
7 years ago
return (
<Header
{...this.props}
backgroundColor={BlueApp.settings.brandingColor}
/>
7 years ago
);
7 years ago
}
}
export class BlueSpacing extends Component {
7 years ago
render() {
7 years ago
return (
<View
{...this.props}
7 years ago
style={{ height: 60, backgroundColor: BlueApp.settings.brandingColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueSpacing40 extends Component {
render() {
return (
<View
{...this.props}
style={{ height: 50, backgroundColor: BlueApp.settings.brandingColor }}
/>
);
}
}
7 years ago
export class BlueSpacing20 extends Component {
7 years ago
render() {
7 years ago
return (
<View
{...this.props}
7 years ago
style={{ height: 20, backgroundColor: BlueApp.settings.brandingColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueListView extends Component {
7 years ago
render() {
return <ListView {...this.props} />;
7 years ago
}
}
export class BlueList extends Component {
7 years ago
render() {
7 years ago
return (
<List
{...this.props}
7 years ago
containerStyle={{
backgroundColor: BlueApp.settings.brandingColor,
7 years ago
borderTopColor: BlueApp.settings.foregroundColor,
7 years ago
borderTopWidth: 1,
}}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueView extends Component {
7 years ago
render() {
7 years ago
return (
<View
{...this.props}
7 years ago
containerStyle={{ backgroundColor: BlueApp.settings.brandingColor }}
7 years ago
/>
7 years ago
);
7 years ago
}
}
export class BlueLoading extends Component {
7 years ago
render() {
7 years ago
return (
7 years ago
<SafeBlueArea>
<View style={{ flex: 1, paddingTop: 200 }}>
7 years ago
<ActivityIndicator />
</View>
</SafeBlueArea>
7 years ago
);
7 years ago
}
}