cozy-ui
cozy-ui copied to clipboard
Dialogs / CozyDialogs : buttons logic is repeated on all dialog types
All cozyDialogs are implementing the same logic for buttons
{!fullScreen && onClose && (
<DialogCloseButton
onClick={onClose}
data-test-id={`modal-close-button-${id}`}
/>
)}
{!fullScreen && onBack && (
<DialogBackButton
onClick={onBack}
data-test-id={`modal-back-button-${id}`}
/>
)}
{fullScreen && onBackOrClose && (
<DialogBackButton
data-test-id={`modal-backclose-button-${id}`}
onClick={onBackOrClose}
/>
)}
We should find a way to refactor this.
More info : https://github.com/cozy/cozy-ui/pull/1905#discussion_r717379228