Skip to content

Commit

Permalink
Merge pull request #10470 from thesahindia/thesahindia/CTA-button
Browse files Browse the repository at this point in the history
Reduce the height of green CTA button
  • Loading branch information
Beamanator authored Aug 30, 2022
2 parents 2617708 + c4217b7 commit 0229523
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 47 deletions.
6 changes: 0 additions & 6 deletions src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ const propTypes = {
/** medium sized button */
medium: PropTypes.bool,

/** Extra large sized button */
extraLarge: PropTypes.bool,

/** Indicates whether the button should be disabled and in the loading state */
isLoading: PropTypes.bool,

Expand Down Expand Up @@ -123,7 +120,6 @@ const defaultProps = {
small: false,
large: false,
medium: false,
extraLarge: false,
onPress: () => {},
onLongPress: () => {},
onPressIn: () => {},
Expand Down Expand Up @@ -191,7 +187,6 @@ class Button extends Component {
this.props.small && styles.buttonSmallText,
this.props.medium && styles.buttonMediumText,
this.props.large && styles.buttonLargeText,
this.props.extraLarge && styles.buttonExtraLargeText,
this.props.success && styles.buttonSuccessText,
this.props.danger && styles.buttonDangerText,
...this.props.textStyles,
Expand Down Expand Up @@ -271,7 +266,6 @@ class Button extends Component {
this.props.small ? styles.buttonSmall : undefined,
this.props.medium ? styles.buttonMedium : undefined,
this.props.large ? styles.buttonLarge : undefined,
this.props.extraLarge ? styles.buttonExtraLarge : undefined,
this.props.success ? styles.buttonSuccess : undefined,
this.props.danger ? styles.buttonDanger : undefined,
(this.props.isDisabled && this.props.success) ? styles.buttonSuccessDisabled : undefined,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ReimbursementAccount/BankAccountStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ class BankAccountStep extends React.Component {
text={this.props.translate('bankAccount.connectOnlineWithPlaid')}
onPress={() => BankAccounts.setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID)}
disabled={this.props.isPlaidDisabled || !validated}
style={[styles.mt5, styles.mh3]}
iconStyles={[styles.mr5]}
style={[styles.mt5, styles.buttonCTA]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
success
extraLarge
large
/>
{this.props.error && (
<Text style={[styles.formError, styles.mh5]}>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ReimbursementAccount/ValidationStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ class ValidationStep extends React.Component {
text={this.props.translate('validationStep.letsChatCTA')}
onPress={Report.navigateToConciergeChat}
icon={Expensicons.ChatBubble}
style={[styles.mt4, styles.mh3]}
iconStyles={[styles.mr5]}
style={[styles.mt4, styles.buttonCTA]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
<MenuItem
Expand Down
6 changes: 3 additions & 3 deletions src/pages/settings/Payments/PaymentMethodList.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class PaymentMethodList extends Component {
type: BUTTON,
text: this.props.translate('paymentMethodList.addPaymentMethod'),
icon: Expensicons.CreditCard,
style: [styles.mh4],
iconStyles: [styles.mr4],
style: [styles.buttonCTA],
iconStyles: [styles.buttonCTAIcon],
onPress: e => this.props.onPress(e),
isDisabled: this.props.isLoadingPayments,
shouldShowRightIcon: true,
Expand Down Expand Up @@ -245,7 +245,7 @@ class PaymentMethodList extends Component {
iconStyles={item.iconStyles}
success={item.success}
shouldShowRightIcon={item.shouldShowRightIcon}
extraLarge
large
/>
)}
</FormAlertWrapper>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/workspace/WorkspaceBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ class WorkspaceBankAccountPage extends React.Component {
text={this.props.translate('workspace.bankAccount.continueWithSetup')}
onPress={this.navigateToBankAccountRoute}
icon={Expensicons.Bank}
style={[styles.mh3, styles.mt2]}
iconStyles={[styles.mr5]}
style={[styles.mt2, styles.buttonCTA]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
<MenuItem
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/bills/WorkspaceBillsNoVBAView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const WorkspaceBillsNoVBAView = props => (
onPress={() => ReimbursementAccount.navigateToBankAccountRoute(props.policyID)}
icon={Expensicons.Bank}
style={[styles.mt4]}
iconStyles={[styles.mr5]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
</Section>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/card/WorkspaceCardNoVBAView.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const WorkspaceCardNoVBAView = props => (
style={[styles.mt6]}
iconStyles={[styles.mr5]}
shouldShowRightIcon
extraLarge
large
success
/>
</Section>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/invoices/WorkspaceInvoicesNoVBAView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const WorkspaceInvoicesNoVBAView = props => (
onPress={() => ReimbursementAccount.navigateToBankAccountRoute(props.policyID)}
icon={Expensicons.Bank}
style={[styles.mt4]}
iconStyles={[styles.mr5]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
</Section>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/reimburse/WorkspaceReimburseView.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ class WorkspaceReimburseView extends React.Component {
onPress={() => ReimbursementAccount.navigateToBankAccountRoute(this.props.policyID)}
icon={Expensicons.Bank}
style={[styles.mt4]}
iconStyles={[styles.mr5]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
</Section>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/travel/WorkspaceTravelNoVBAView.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const WorkspaceTravelNoVBAView = props => (
onPress={() => ReimbursementAccount.navigateToBankAccountRoute(props.policyID)}
icon={Expensicons.Bank}
style={[styles.mt4]}
iconStyles={[styles.mr5]}
iconStyles={[styles.buttonCTAIcon]}
shouldShowRightIcon
extraLarge
large
success
/>
</Section>
Expand Down
30 changes: 11 additions & 19 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,9 @@ const styles = {
borderRadius: variables.componentBorderRadius,
height: variables.componentSizeLarge,
paddingTop: 8,
paddingRight: 12,
paddingRight: 14,
paddingBottom: 8,
paddingLeft: 12,
backgroundColor: themeColors.buttonDefaultBG,
},

buttonExtraLarge: {
borderRadius: variables.componentBorderRadius,
height: variables.componentSizeExtraLarge,
paddingTop: 12,
paddingRight: 18,
paddingBottom: 12,
paddingLeft: 18,
paddingLeft: 14,
backgroundColor: themeColors.buttonDefaultBG,
},

Expand All @@ -418,13 +408,6 @@ const styles = {
textAlign: 'center',
},

buttonExtraLargeText: {
fontSize: variables.fontSizeMedium,
fontFamily: fontFamily.GTA_BOLD,
fontWeight: fontWeightBold,
textAlign: 'center',
},

buttonSuccess: {
backgroundColor: themeColors.buttonSuccessBG,
borderWidth: 0,
Expand Down Expand Up @@ -473,6 +456,15 @@ const styles = {
borderBottomLeftRadius: 0,
},

buttonCTA: {
paddingVertical: 6,
...spacing.mh4,
},

buttonCTAIcon: {
marginRight: 22,
},

buttonConfirm: {
margin: 20,
},
Expand Down
1 change: 0 additions & 1 deletion src/styles/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default {
componentSizeNormal: 40,
inputComponentSizeNormal: 42,
componentSizeLarge: 52,
componentSizeExtraLarge: 64,
componentBorderRadius: 8,
componentBorderRadiusSmall: 4,
componentBorderRadiusNormal: 8,
Expand Down

0 comments on commit 0229523

Please sign in to comment.