Skip to content

Commit

Permalink
Merge pull request #3854 from Expensify/vit-updateEditPhotoButton
Browse files Browse the repository at this point in the history
Update the height of Edit profile button
  • Loading branch information
HorusGoul authored Jul 2, 2021
2 parents 039b671 + 3fad24e commit 5653309
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const propTypes = {
/** The text for the button label */
text: PropTypes.string,

/** Small sized button */
small: PropTypes.bool,

/** Large sized button */
large: PropTypes.bool,

Expand Down Expand Up @@ -53,6 +56,7 @@ const defaultProps = {
text: '',
isLoading: false,
isDisabled: false,
small: false,
large: false,
onPress: () => {},
style: [],
Expand Down Expand Up @@ -81,6 +85,7 @@ const Button = (props) => {
selectable={false}
style={[
styles.buttonText,
props.small && styles.buttonSmallText,
props.large && styles.buttonLargeText,
props.success && styles.buttonSuccessText,
props.danger && styles.buttonDangerText,
Expand All @@ -105,6 +110,7 @@ const Button = (props) => {
shouldDim={pressed}
style={[
styles.button,
props.small ? styles.buttonSmall : undefined,
props.large ? styles.buttonLarge : undefined,
props.success ? styles.buttonSuccess : undefined,
props.danger ? styles.buttonDanger : undefined,
Expand Down
9 changes: 8 additions & 1 deletion src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,20 @@ class ProfilePage extends Component {
{({openPicker}) => (
<>
<Button
small
style={[styles.alignSelfCenter, styles.mt3]}
onPress={() => this.setState({isEditPhotoMenuVisible: true})}
ContentComponent={() => (
<View style={[styles.flexRow]}>
<Icon src={DownArrow} />
<View style={styles.justifyContentCenter}>
<Text style={[styles.headerText, styles.ml2]}>
<Text
style={[
styles.headerText,
styles.buttonSmallText,
styles.ml2,
]}
>
{this.props.translate('profilePage.editPhoto')}
</Text>
</View>
Expand Down
12 changes: 6 additions & 6 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ const styles = {
paddingLeft: 12,
},

buttonLargeText: {
fontSize: variables.fontSizeLarge,
lineHeight: 18,
buttonSmallText: {
fontSize: variables.fontSizeSmall,
lineHeight: 16,
fontFamily: fontFamily.GTA_BOLD,
fontWeight: fontWeightBold,
textAlign: 'center',
},

buttonSmallText: {
fontSize: variables.fontSizeSmall,
lineHeight: 16,
buttonLargeText: {
fontSize: variables.fontSizeLarge,
lineHeight: 18,
fontFamily: fontFamily.GTA_BOLD,
fontWeight: fontWeightBold,
textAlign: 'center',
Expand Down

0 comments on commit 5653309

Please sign in to comment.