Skip to content

Commit

Permalink
Merge pull request #6788 from mateusbra/rename-ExpensifyButton
Browse files Browse the repository at this point in the history
Rename expensify button
  • Loading branch information
puneetlath authored Dec 17, 2021
2 parents 0a603b8 + bc5f5ed commit d012bea
Show file tree
Hide file tree
Showing 33 changed files with 76 additions and 76 deletions.
8 changes: 4 additions & 4 deletions STORYBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ Here's an example story:

```javascript
import React from 'react';
import ExpensifyButton from '../components/ExpensifyButton';
import Button from '../components/Button';

const story = {
// Title field will determine how the story displays in the sidebar
title: 'Components/ExpensifyButton',
component: ExpensifyButton,
title: 'Components/Button',
component: Button,
};

// Optional `args` are passed which determine the props the example component will have
const Template = args => <ExpensifyButton {...args} />;
const Template = args => <Button {...args} />;

// Each story must be exported with a named export
const Default = Template.bind({});
Expand Down
2 changes: 1 addition & 1 deletion STYLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Any array of styles associated with a single type of React element that has at l
- If a reusable style has 3 or more modifiers it should be refactored into a component with props to modify the styles e.g.

```jsx
<ExpensifyButton title="Submit" success large />
<Button title="Submit" success large />
```

## Inline Styles
Expand Down
4 changes: 2 additions & 2 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import themeColors from '../styles/themes/default';
import addEncryptedAuthTokenToURL from '../libs/addEncryptedAuthTokenToURL';
import compose from '../libs/compose';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import HeaderWithCloseButton from './HeaderWithCloseButton';
import fileDownload from '../libs/fileDownload';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
Expand Down Expand Up @@ -153,7 +153,7 @@ class AttachmentModal extends PureComponent {

{/* If we have an onConfirm method show a confirmation button */}
{this.props.onConfirm && (
<ExpensifyButton
<Button
success
style={[styles.buttonConfirm]}
textStyles={[styles.buttonConfirmText]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const propTypes = {
* @example
* <AttachmentPicker>
* {({openPicker}) => (
* <ExpensifyButton
* <Button
* onPress={() => {
* openPicker({
* onPicked: (file) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/BigNumberPad.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {View} from 'react-native';
import _ from 'underscore';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import ControlSelection from '../libs/ControlSelection';

const propTypes = {
Expand Down Expand Up @@ -54,7 +54,7 @@ class BigNumberPad extends React.Component {
// avoid unccessary space before the first column.
const marginLeft = columnIndex > 0 ? styles.ml3 : {};
return (
<ExpensifyButton
<Button
key={column}
style={[styles.flex1, marginLeft]}
text={column}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const defaultProps = {
shouldRemoveLeftBorderRadius: false,
};

class ExpensifyButton extends Component {
class Button extends Component {
constructor(props) {
super(props);
this.additionalStyles = _.isArray(this.props.style) ? this.props.style : [this.props.style];
Expand Down Expand Up @@ -205,7 +205,7 @@ class ExpensifyButton extends Component {
}
}

ExpensifyButton.propTypes = propTypes;
ExpensifyButton.defaultProps = defaultProps;
Button.propTypes = propTypes;
Button.defaultProps = defaultProps;

export default ExpensifyButton;
export default Button;
6 changes: 3 additions & 3 deletions src/components/ButtonWithDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import styles from '../styles/styles';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import themeColors from '../styles/themes/default';
Expand All @@ -29,15 +29,15 @@ const defaultProps = {

const ButtonWithDropdown = props => (
<View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter]}>
<ExpensifyButton
<Button
success
onPress={props.onButtonPress}
text={props.buttonText}
isLoading={props.isLoading}
shouldRemoveRightBorderRadius
style={[styles.flex1]}
/>
<ExpensifyButton
<Button
success
style={[styles.buttonDropdown]}
onPress={props.onDropdownPress}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ButtonWithMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {View} from 'react-native';
import _ from 'underscore';
import styles from '../styles/styles';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import ButtonWithDropdown from './ButtonWithDropdown';
import PopoverMenu from './PopoverMenu';

Expand Down Expand Up @@ -66,7 +66,7 @@ class ButtonWithMenu extends PureComponent {
}}
/>
) : (
<ExpensifyButton
<Button
success
isDisabled={this.props.isDisabled}
style={[styles.w100]}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ConfirmModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import CONST from '../CONST';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import compose from '../libs/compose';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import ExpensifyText from './ExpensifyText';

const propTypes = {
Expand Down Expand Up @@ -75,7 +75,7 @@ const ConfirmModal = props => (
</ExpensifyText>
) : (props.prompt)}

<ExpensifyButton
<Button
success
danger={props.danger}
style={[styles.mt4]}
Expand All @@ -85,7 +85,7 @@ const ConfirmModal = props => (
/>
{props.shouldShowCancelButton
&& (
<ExpensifyButton
<Button
style={[styles.mt3]}
onPress={props.onCancel}
text={props.cancelText || props.translate('common.no')}
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormAlertWithSubmitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styles from '../styles/styles';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import colors from '../styles/colors';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import TextLink from './TextLink';
import ExpensifyText from './ExpensifyText';
Expand Down Expand Up @@ -102,7 +102,7 @@ const FormAlertWithSubmitButton = (props) => {
{getAlertPrompt()}
</View>
)}
<ExpensifyButton
<Button
success
pressOnEnter
text={props.buttonText}
Expand Down
4 changes: 2 additions & 2 deletions src/components/InboxCallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';
import Tooltip from './Tooltip';
import ExpensifyButton from './ExpensifyButton';
import Button from './Button';
import * as Expensicons from './Icon/Expensicons';

const propTypes = {
Expand All @@ -24,7 +24,7 @@ const InboxCallButton = props => (
text={props.translate('requestCallPage.callButtonTooltip')}
containerStyles={[styles.justifyContentCenter, styles.alignItemsCenter]}
>
<ExpensifyButton
<Button
onPress={() => {
Navigation.navigate(ROUTES.getRequestCallRoute(props.taskID));
}}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/EnablePayments/OnfidoStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ONYXKEYS from '../../ONYXKEYS';
import * as BankAccounts from '../../libs/actions/BankAccounts';
import Navigation from '../../libs/Navigation/Navigation';
import CONST from '../../CONST';
import ExpensifyButton from '../../components/ExpensifyButton';
import Button from '../../components/Button';
import HeaderWithCloseButton from '../../components/HeaderWithCloseButton';
import styles from '../../styles/styles';
import TextLink from '../../components/TextLink';
Expand Down Expand Up @@ -113,7 +113,7 @@ class OnfidoStep extends React.Component {
.
</ExpensifyText>
</View>
<ExpensifyButton
<Button
success
text={this.props.translate('common.continue')}
isLoading={this.props.walletOnfidoData.loading}
Expand All @@ -130,7 +130,7 @@ class OnfidoStep extends React.Component {
<ExpensifyText style={[styles.h3, styles.textStrong, styles.mb2]}>
{this.props.walletOnfidoData.error}
</ExpensifyText>
<ExpensifyButton
<Button
success
text={this.props.translate('onfidoStep.tryAgain')}
onPress={() => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/EnablePayments/TermsStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HeaderWithCloseButton from '../../components/HeaderWithCloseButton';
import Navigation from '../../libs/Navigation/Navigation';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import styles from '../../styles/styles';
import ExpensifyButton from '../../components/ExpensifyButton';
import Button from '../../components/Button';
import * as BankAccounts from '../../libs/actions/BankAccounts';
import CONST from '../../CONST';
import TextLink from '../../components/TextLink';
Expand Down Expand Up @@ -106,7 +106,7 @@ class TermsStep extends React.Component {
{this.props.translate('termsStep.termsMustBeAccepted')}
</ExpensifyText>
)}
<ExpensifyButton
<Button
success
style={styles.mb4}
text={this.props.translate('termsStep.enablePayments')}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ScreenWrapper from '../components/ScreenWrapper';
import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator';
import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import compose from '../libs/compose';
import ExpensifyButton from '../components/ExpensifyButton';
import Button from '../components/Button';
import KeyboardAvoidingView from '../components/KeyboardAvoidingView';
import FixedFooter from '../components/FixedFooter';
import personalDetailsPropType from './personalDetailsPropType';
Expand Down Expand Up @@ -265,7 +265,7 @@ class NewChatPage extends Component {
/>
{this.props.isGroupChat && lodashGet(this.state, 'selectedOptions', []).length > 0 && (
<FixedFooter>
<ExpensifyButton
<Button
success
onPress={this.createGroup}
style={[styles.w100]}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import ONYXKEYS from '../ONYXKEYS';
import compose from '../libs/compose';
import FullNameInputRow from '../components/FullNameInputRow';
import ExpensifyButton from '../components/ExpensifyButton';
import Button from '../components/Button';
import FixedFooter from '../components/FixedFooter';
import CONST from '../CONST';
import Growl from '../libs/Growl';
Expand Down Expand Up @@ -243,7 +243,7 @@ class RequestCallPage extends Component {
</View>
</ScrollView>
<FixedFooter>
<ExpensifyButton
<Button
success
onPress={this.onSubmit}
style={[styles.w100]}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/SetPasswordPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import styles from '../styles/styles';
import * as Session from '../libs/actions/Session';
import ONYXKEYS from '../ONYXKEYS';
import ExpensifyButton from '../components/ExpensifyButton';
import Button from '../components/Button';
import SignInPageLayout from './signin/SignInPageLayout';
import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import compose from '../libs/compose';
Expand Down Expand Up @@ -106,7 +106,7 @@ class SetPasswordPage extends Component {
/>
</View>
<View>
<ExpensifyButton
<Button
success
style={[styles.mb2]}
text={this.props.translate('setPasswordPage.setPassword')}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/report/MarkerBadge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {PureComponent} from 'react';
import {Animated, View} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../../../../styles/styles';
import ExpensifyButton from '../../../../components/ExpensifyButton';
import Button from '../../../../components/Button';
import ExpensifyText from '../../../../components/ExpensifyText';
import Icon from '../../../../components/Icon';
import * as Expensicons from '../../../../components/Icon/Expensicons';
Expand Down Expand Up @@ -78,7 +78,7 @@ class MarkerBadge extends PureComponent {
styles.alignItemsCenter,
]}
>
<ExpensifyButton
<Button
success
small
onPress={this.props.onClick}
Expand All @@ -102,7 +102,7 @@ class MarkerBadge extends PureComponent {
)}
shouldRemoveRightBorderRadius
/>
<ExpensifyButton
<Button
success
small
style={[styles.buttonDropdown]}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as ReportScrollManager from '../../../libs/ReportScrollManager';
import toggleReportActionComposeView from '../../../libs/toggleReportActionComposeView';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import ExpensifyButton from '../../../components/ExpensifyButton';
import Button from '../../../components/Button';
import ReportActionComposeFocusManager from '../../../libs/ReportActionComposeFocusManager';
import compose from '../../../libs/compose';

Expand Down Expand Up @@ -163,13 +163,13 @@ class ReportActionItemMessageEdit extends React.Component {
/>
</View>
<View style={[styles.flexRow, styles.mt1]}>
<ExpensifyButton
<Button
small
style={[styles.mr2]}
onPress={this.deleteDraft}
text={this.props.translate('common.cancel')}
/>
<ExpensifyButton
<Button
small
success
style={[styles.mr2]}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import compose from '../../libs/compose';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import CONST from '../../CONST';
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView';
import ExpensifyButton from '../../components/ExpensifyButton';
import Button from '../../components/Button';
import FixedFooter from '../../components/FixedFooter';
import * as IOU from '../../libs/actions/IOU';

Expand Down Expand Up @@ -218,7 +218,7 @@ class IOUCurrencySelection extends Component {
</View>
</View>
<FixedFooter>
<ExpensifyButton
<Button
success
isDisabled={!this.props.iou.selectedCurrencyCode}
style={[styles.w100]}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Navigation from '../../../libs/Navigation/Navigation';
import ROUTES from '../../../ROUTES';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import compose from '../../../libs/compose';
import ExpensifyButton from '../../../components/ExpensifyButton';
import Button from '../../../components/Button';
import ExpensifyText from '../../../components/ExpensifyText';
import CONST from '../../../CONST';

Expand Down Expand Up @@ -215,7 +215,7 @@ class IOUAmountPage extends React.Component {
/>
) : <View />}

<ExpensifyButton
<Button
success
style={[styles.w100, styles.mt5]}
onPress={() => this.props.onStepComplete(this.state.amount)}
Expand Down
Loading

0 comments on commit d012bea

Please sign in to comment.