diff --git a/src/components/ConnectBankAccountButton.js b/src/components/ConnectBankAccountButton.js new file mode 100644 index 000000000000..b62d46170768 --- /dev/null +++ b/src/components/ConnectBankAccountButton.js @@ -0,0 +1,54 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import {View} from 'react-native'; +import * as ReimbursementAccount from '../libs/actions/ReimbursementAccount'; +import * as Expensicons from './Icon/Expensicons'; +import styles from '../styles/styles'; +import Button from './Button'; +import {withNetwork} from './OnyxProvider'; +import compose from '../libs/compose'; +import withLocalize, {withLocalizePropTypes} from './withLocalize'; +import networkPropTypes from './networkPropTypes'; +import Text from './Text'; + +const propTypes = { + ...withLocalizePropTypes, + + /** Information about the network */ + network: networkPropTypes.isRequired, + + /** PolicyID for navigating to bank account route of that policy */ + policyID: PropTypes.string.isRequired, + + /** Button styles, also applied for offline message wrapper */ + style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), +}; + +const defaultProps = { + style: [], +}; + +function ConnectBankAccountButton(props) { + return props.network.isOffline ? ( + + {`${props.translate('common.youAppearToBeOffline')} ${props.translate('common.thisFeatureRequiresInternet')}`} + + ) : ( +