@@ -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+ start = { { x : 0 , y : 0.05 } }
24+ end = { { x : 1 , y : 0.85 } }
25+ colors = { view . gradient }
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"
@@ -56,9 +73,11 @@ const styles = StyleSheet.create({
5673 // Text styling in buttons
5774 rectangleButtonIcon : {
5875 color : c . white ,
76+ backgroundColor : c . transparent ,
5977 } ,
6078 rectangleButtonText : {
6179 color : c . white ,
80+ backgroundColor : c . transparent ,
6281 // marginTop: cellVerticalPadding / 2,
6382 fontFamily : Platform . OS === 'ios' ? 'System' : 'sans-serif-condensed' ,
6483 // textAlign: 'center',
0 commit comments