diff --git a/packages/cozy-harvest-lib/src/components/AccountSelectBox/AccountSelectorHeader.tsx b/packages/cozy-harvest-lib/src/components/AccountSelectBox/AccountSelectorHeader.tsx index 6f2f253ecd..ff4494d72f 100644 --- a/packages/cozy-harvest-lib/src/components/AccountSelectBox/AccountSelectorHeader.tsx +++ b/packages/cozy-harvest-lib/src/components/AccountSelectBox/AccountSelectorHeader.tsx @@ -1,9 +1,11 @@ +import cx from 'classnames' import React from 'react' import DialogBackButton from 'cozy-ui/transpiled/react/CozyDialogs/DialogBackButton' import DialogTitle from 'cozy-ui/transpiled/react/Dialog/DialogTitle' import AccountSelectBox from './AccountSelectBox' +import { useDialogContext } from '../DialogContext' interface AccountSelectorHeaderProps { konnector: { slug: string } @@ -18,27 +20,40 @@ export const AccountSelectorHeader = ({ accountsAndTriggers, pushHistory, replaceHistory -}: AccountSelectorHeaderProps): JSX.Element => ( - <> - replaceHistory(`/accounts/${account._id}`)} - /> - - { - pushHistory(`/accounts/${option.account._id}`) - }} - onCreate={(): void => { - pushHistory('/new') - }} - variant="big" +}: AccountSelectorHeaderProps): JSX.Element => { + // @ts-expect-error IDK + const { dialogTitleProps } = useDialogContext() + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { className: dialogTitlePropsClassName, ...rest } = dialogTitleProps + + return ( + <> + replaceHistory(`/accounts/${account._id}`)} /> - - -) + + + { + pushHistory(`/accounts/${option.account._id}`) + }} + onCreate={(): void => { + pushHistory('/new') + }} + variant="big" + /> + + + ) +}