@@ -4,6 +4,7 @@ import * as React from 'react'
44import { Text , StyleSheet , Platform } from 'react-native'
55import Icon from 'react-native-vector-icons/Entypo'
66import type { ViewType } from '../views'
7+ import LinearGradient from 'react-native-linear-gradient'
78import { Touchable } from '../components/touchable'
89import * as c from '../components/colors'
910
@@ -15,6 +16,22 @@ type Props = {
1516export function HomeScreenButton ( { view, onPress} : Props ) {
1617 const style = { backgroundColor : view . tint }
1718
19+ if ( view . gradient ) {
20+ return (
21+ < Touchable onPress = { onPress } >
22+ < LinearGradient
23+ colors = { view . gradient }
24+ end = { { x : 1 , y : 0.85 } }
25+ start = { { x : 0 , y : 0.05 } }
26+ style = { [ styles . rectangle ] }
27+ >
28+ < Icon name = { view . icon } size = { 32 } style = { styles . rectangleButtonIcon } />
29+ < Text style = { styles . rectangleButtonText } > { view . title } </ Text >
30+ </ LinearGradient >
31+ </ Touchable >
32+ )
33+ }
34+
1835 return (
1936 < Touchable
2037 accessibilityComponentType = "button"
@@ -55,9 +72,11 @@ const styles = StyleSheet.create({
5572 // Text styling in buttons
5673 rectangleButtonIcon : {
5774 color : c . white ,
75+ backgroundColor : c . transparent ,
5876 } ,
5977 rectangleButtonText : {
6078 color : c . white ,
79+ backgroundColor : c . transparent ,
6180 fontFamily : Platform . OS === 'ios' ? 'System' : 'sans-serif-condensed' ,
6281 fontSize : 14 ,
6382 } ,
0 commit comments