import React, { Component } from 'react'
import { StyleSheet, View, Text, Image, TouchableOpacity, TouchableWithoutFeedback, ViewStyle, StyleProp, GestureResponderEvent } from 'react-native'
import LinearGradient from 'react-native-linear-gradient';

export interface Props {
    isOpacity?: boolean
    text: string
    style?: StyleProp<ViewStyle> | undefined;
    onPress: ((event: GestureResponderEvent) => void) | undefined;
    onLongPress: ((event: GestureResponderEvent) => void) | undefined;
}

export interface State {

}

export default class GradientButton extends React.Component<Props, State> {
    constructor(props: Props | Readonly<Props>) {
        super(props);

    }
    componentDidMount() {

    }

    componentWillUnmount() {
    }

    public readonly state: Readonly<State> = {

    }

    render() {
        let { isOpacity, text, style, onPress, onLongPress } = this.props;
        return (
            <LinearGradient colors={['#4c669f', '#3b5998', '#192f6a']} >
                <TouchableOpacity style={[style]} onPress={onPress} onLongPress={onLongPress}>
                    <Text>{text ? text : null}</Text>
                </TouchableOpacity>
            </LinearGradient>
        );
    }
}
const styles = StyleSheet.create({
    main: {

    }
})