-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1672 from Maftalion/matt-settings-menu
[User Settings] Implement Settings Menu Selectors
- Loading branch information
Showing
20 changed files
with
538 additions
and
208 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from 'react'; | ||
import { | ||
View, Text, Pressable, | ||
} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import styles from '../styles/styles'; | ||
import themeColors from '../styles/themes/default'; | ||
import Icon from './Icon'; | ||
import {ArrowRight} from './Icon/Expensicons'; | ||
|
||
const propTypes = { | ||
// Function to fire when component is pressed | ||
onPress: PropTypes.func.isRequired, | ||
|
||
// Icon to display on the left side of component | ||
icon: PropTypes.func.isRequired, | ||
|
||
// Text to display for the item | ||
title: PropTypes.string.isRequired, | ||
|
||
// Boolean whether to display the ArrowRight icon | ||
shouldShowRightArrow: PropTypes.bool, | ||
}; | ||
|
||
const defaultProps = { | ||
shouldShowRightArrow: false, | ||
}; | ||
|
||
const MenuItem = ({ | ||
onPress, | ||
icon, | ||
title, | ||
shouldShowRightArrow, | ||
}) => ( | ||
<Pressable | ||
onPress={onPress} | ||
style={({hovered}) => ([ | ||
styles.createMenuItem, | ||
hovered && {backgroundColor: themeColors.buttonHoveredBG}, | ||
])} | ||
> | ||
<View style={styles.flexRow}> | ||
<View style={styles.createMenuIcon}> | ||
<Icon src={icon} /> | ||
</View> | ||
<View style={styles.justifyContentCenter}> | ||
<Text style={[styles.createMenuText, styles.ml3]}> | ||
{title} | ||
</Text> | ||
</View> | ||
</View> | ||
{shouldShowRightArrow && ( | ||
<View style={styles.createMenuIcon}> | ||
<Icon src={ArrowRight} /> | ||
</View> | ||
)} | ||
</Pressable> | ||
); | ||
|
||
MenuItem.propTypes = propTypes; | ||
MenuItem.defaultProps = defaultProps; | ||
MenuItem.displayName = 'MenuItem'; | ||
|
||
export default MenuItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.