import * as React from 'react';
import { View } from 'react-native';
import {
Paragraph,
Button,
Caption,
withTheme,
Text,
Subheading,
} from 'react-native-paper';
import { ActivityIndicator, Flex } from '@ant-design/react-native';
function MyButton(props) {
const {
children,
onPress,
outline,
text,
size,
type,
theme,
block,
style,
left,
width,
height,
radius,
disabled,
loading,
} = props;
let { fontColor, color } = props;
const { colors } = theme;
let contentStyle = {};
let mode = 'contained';
let childNode;
let dark = true;
switch (type) {
case 'primary':
color = colors.primary;
if (disabled) {
color = '#8E8E8E';
}
break;
case 'info':
if (outline || text) {
color = colors.info;
} else {
color = colors.lightInfo;
fontColor = colors.info;
}
break;
case 'danger':
color = colors.error;
break;
default:
color = color || colors.primary;
break;
}
if (outline) {
mode = 'outlined';
dark = false;
}
if (text) {
mode = 'text';
dark = false;
}
switch (size) {
case 'mini':
contentStyle = { height: 25 };
childNode = () => (