AppIcon props update
This commit is contained in:
@@ -3,30 +3,25 @@ import PropTypes from 'prop-types'
|
|||||||
import { StyleSheet } from 'react-native'
|
import { StyleSheet } from 'react-native'
|
||||||
import Icon from 'react-native-vector-icons/Entypo'
|
import Icon from 'react-native-vector-icons/Entypo'
|
||||||
|
|
||||||
import { Colors, Sizes } from '../../styles/redesign'
|
import { Sizes } from '../../styles/redesign'
|
||||||
|
|
||||||
const AppIcon = ({ isCTA, name }) => {
|
const AppIcon = ({ color, name }) => {
|
||||||
const style = isCTA ? styles.iconCTA : styles.icon
|
const style = [styles.icon, { color }]
|
||||||
|
|
||||||
return <Icon name={name} style={style}/>
|
return <Icon name={name} style={style}/>
|
||||||
}
|
}
|
||||||
|
|
||||||
AppIcon.propTypes = {
|
AppIcon.propTypes = {
|
||||||
isCTA: PropTypes.bool,
|
color: PropTypes.string,
|
||||||
name: PropTypes.string.isRequired
|
name: PropTypes.string.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
AppIcon.defaultProps = {
|
AppIcon.defaultProps = {
|
||||||
isCTA: true
|
isCTA: 'black'
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
icon: {
|
icon: {
|
||||||
color: 'black',
|
|
||||||
fontSize: Sizes.subtitle
|
|
||||||
},
|
|
||||||
iconCTA: {
|
|
||||||
color: Colors.orange,
|
|
||||||
fontSize: Sizes.subtitle
|
fontSize: Sizes.subtitle
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
|
|||||||
import AppIcon from '../common/app-icon'
|
import AppIcon from '../common/app-icon'
|
||||||
import MenuItem from './menu-item'
|
import MenuItem from './menu-item'
|
||||||
|
|
||||||
import { Sizes } from '../../styles/redesign'
|
import { Colors, Sizes } from '../../styles/redesign'
|
||||||
import settingsLabels from '../../i18n/en/settings'
|
import settingsLabels from '../../i18n/en/settings'
|
||||||
|
|
||||||
const { menuItems } = settingsLabels
|
const { menuItems } = settingsLabels
|
||||||
@@ -21,7 +21,7 @@ const SideMenu = ({ shouldShowMenu, toggleMenu }) => {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{!shouldShowMenu &&
|
{!shouldShowMenu &&
|
||||||
<TouchableOpacity onPress={toggleMenu}>
|
<TouchableOpacity onPress={toggleMenu}>
|
||||||
<AppIcon name={'dots-three-vertical'} isCTA/>
|
<AppIcon name={'dots-three-vertical'} color={Colors.orange}/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
}
|
}
|
||||||
{shouldShowMenu &&
|
{shouldShowMenu &&
|
||||||
@@ -34,7 +34,7 @@ const SideMenu = ({ shouldShowMenu, toggleMenu }) => {
|
|||||||
<View style={styles.blackBackground}></View>
|
<View style={styles.blackBackground}></View>
|
||||||
<View style={styles.menu}>
|
<View style={styles.menu}>
|
||||||
<TouchableOpacity onPress={toggleMenu} style={styles.iconContainer}>
|
<TouchableOpacity onPress={toggleMenu} style={styles.iconContainer}>
|
||||||
<AppIcon name={'cross'} isCTA={false}/>
|
<AppIcon name={'cross'} color={'black'}/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{settingsMenuItems.map(item =>
|
{settingsMenuItems.map(item =>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const MenuItem = ({ item, last, navigate }) => {
|
|||||||
<AppText style={styles.title}>{item.name}</AppText>
|
<AppText style={styles.title}>{item.name}</AppText>
|
||||||
{item.text.length > 0 && <AppText>{item.text}</AppText>}
|
{item.text.length > 0 && <AppText>{item.text}</AppText>}
|
||||||
</View>
|
</View>
|
||||||
<AppIcon name={'chevron-right'} isCTA/>
|
<AppIcon name={'chevron-right'} color={Colors.orange}/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</Segment>
|
</Segment>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user