diff --git a/src/CONST.ts b/src/CONST.ts index 0297f7bc0d5a..fb1c2a385d89 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1794,6 +1794,11 @@ const CONST = { XERO: 'xero', NETSUITE: 'netsuite', }, + NAME_USER_FRIENDLY: { + netsuite: 'NetSuite', + quickbooksOnline: 'Quickbooks Online', + xero: 'Xero', + }, SYNC_STAGE_NAME: { STARTING_IMPORT_QBO: 'startingImportQBO', STARTING_IMPORT_XERO: 'startingImportXero', diff --git a/src/components/AccountingConnectionConfirmationModal.tsx b/src/components/AccountingConnectionConfirmationModal.tsx new file mode 100644 index 000000000000..c472f215b6df --- /dev/null +++ b/src/components/AccountingConnectionConfirmationModal.tsx @@ -0,0 +1,30 @@ +import React from 'react'; +import useLocalize from '@hooks/useLocalize'; +import type {ConnectionName} from '@src/types/onyx/Policy'; +import ConfirmModal from './ConfirmModal'; + +type AccountingConnectionConfirmationModalProps = { + integrationToConnect: ConnectionName; + onConfirm: () => void; + onCancel: () => void; +}; + +function AccountingConnectionConfirmationModal({integrationToConnect, onCancel, onConfirm}: AccountingConnectionConfirmationModalProps) { + const {translate} = useLocalize(); + + return ( + + ); +} + +AccountingConnectionConfirmationModal.displayName = 'AccountingConnectionConfirmationModal'; +export default AccountingConnectionConfirmationModal; diff --git a/src/components/ConnectToNetSuiteButton/index.tsx b/src/components/ConnectToNetSuiteButton/index.tsx new file mode 100644 index 000000000000..fc948503a127 --- /dev/null +++ b/src/components/ConnectToNetSuiteButton/index.tsx @@ -0,0 +1,54 @@ +import React, {useState} from 'react'; +import AccountingConnectionConfirmationModal from '@components/AccountingConnectionConfirmationModal'; +import Button from '@components/Button'; +import useLocalize from '@hooks/useLocalize'; +import useNetwork from '@hooks/useNetwork'; +import useThemeStyles from '@hooks/useThemeStyles'; +import {removePolicyConnection} from '@libs/actions/connections'; +import Navigation from '@libs/Navigation/Navigation'; +import CONST from '@src/CONST'; +import ROUTES from '@src/ROUTES'; +import type {ConnectToNetSuiteButtonProps} from './types'; + +function ConnectToNetSuiteButton({policyID, shouldDisconnectIntegrationBeforeConnecting, integrationToDisconnect}: ConnectToNetSuiteButtonProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + const {isOffline} = useNetwork(); + + const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); + + return ( + <> +