import React from 'react'; import { LinearGradient } from 'expo'; import { RkButton, RkText, RkComponent, } from 'react-native-ui-kitten'; export class GradientButton extends RkComponent { componentName = 'GradientButton'; typeMapping = { button: {}, gradient: {}, text: {}, }; renderContent = (textStyle) => { const hasText = this.props.text === undefined; return hasText ? this.props.children : this.renderText(textStyle); }; renderText = (textStyle) => ( {this.props.text} ); render() { const { button, gradient, text: textStyle } = this.defineStyles(); const { style, rkType, ...restProps } = this.props; const colors = this.props.colors || this.extractNonStyleValue(gradient, 'colors'); return ( {this.renderContent(textStyle)} ); } }