Visualize disabled action buttons
This commit is contained in:
@@ -38,6 +38,11 @@ export default class ActionButtonFooter extends Component {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.menu}>
|
<View style={styles.menu}>
|
||||||
{buttons.map(({ title, action, disabledCondition, icon }, i) => {
|
{buttons.map(({ title, action, disabledCondition, icon }, i) => {
|
||||||
|
const textStyle = disabledCondition ? styles.menuTextInActive : styles.menuText
|
||||||
|
const iconStyle = disabledCondition ?
|
||||||
|
Object.assign({}, iconStyles.menuIcon, iconStyles.menuIconInactive) :
|
||||||
|
iconStyles.menuIcon
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={action}
|
onPress={action}
|
||||||
@@ -45,8 +50,8 @@ export default class ActionButtonFooter extends Component {
|
|||||||
disabled={disabledCondition}
|
disabled={disabledCondition}
|
||||||
key={i.toString()}
|
key={i.toString()}
|
||||||
>
|
>
|
||||||
<Icon name={icon} {...iconStyles.menuIcon} />
|
<Icon name={icon} {...iconStyle} />
|
||||||
<Text style={styles.menuText}>
|
<Text style={textStyle}>
|
||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ export default StyleSheet.create({
|
|||||||
menuText: {
|
menuText: {
|
||||||
color: fontOnPrimaryColor
|
color: fontOnPrimaryColor
|
||||||
},
|
},
|
||||||
|
menuTextInActive: {
|
||||||
|
color: 'lightgrey'
|
||||||
|
},
|
||||||
headerCycleDay: {
|
headerCycleDay: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between'
|
justifyContent: 'space-between'
|
||||||
@@ -177,5 +180,8 @@ export const iconStyles = {
|
|||||||
menuIcon: {
|
menuIcon: {
|
||||||
size: 20,
|
size: 20,
|
||||||
color: fontOnPrimaryColor
|
color: fontOnPrimaryColor
|
||||||
|
},
|
||||||
|
menuIconInactive: {
|
||||||
|
color: 'lightgrey'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user