Skip to content

Commit

Permalink
fix(HarvestModal): Make closable to avoid use getting stuck into AA
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Apr 3, 2024
1 parent 79bc63f commit c4a6261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ducks/settings/HarvestBankAccountSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const HarvestBankAccountSettings = ({
<HarvestVaultProvider>
<VaultUnlockProvider>
<HarvestTrackingProvider>
<HarvestModal>
<HarvestModal onDismiss={onDismiss}>
<HarvestSwitch
initialFragment={`/accounts/${connectionId}`}
routes={[
Expand Down
4 changes: 3 additions & 1 deletion src/ducks/settings/HarvestModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Dialog from 'cozy-ui/transpiled/react/Dialog'
import { withStyles } from 'cozy-ui/transpiled/react/styles'
import { useVaultUnlockContext } from 'cozy-keys-lib'
import { useDialogContext } from 'cozy-harvest-lib/dist/components/DialogContext'
import { DialogCloseButton } from 'cozy-ui/transpiled/react/CozyDialogs'

const withHarvestDialogStyles = () => {
/**
Expand Down Expand Up @@ -36,7 +37,7 @@ const withHarvestDialogStyles = () => {
/**
* This component copies the functionality of the modal in Harvest and its Routes component.
*/
const HarvestModal = ({ children }) => {
const HarvestModal = ({ children, onDismiss }) => {
const { showingUnlockForm } = useVaultUnlockContext()
const dialogContext = useDialogContext()

Expand All @@ -46,6 +47,7 @@ const HarvestModal = ({ children }) => {

return (
<Dialog disableRestoreFocus {...dialogContext.dialogProps}>
<DialogCloseButton onClick={onDismiss} />
{children}
</Dialog>
)
Expand Down

0 comments on commit c4a6261

Please sign in to comment.