Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions src/lib/components/ui/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,35 +179,37 @@ class Modal extends React.Component {
)}
</div>
{modalBody()}
<div className={styles.footer}>
<Toolbar justify="center" dense>
{actions.map((action) => (
<ToolbarItem key={action.label}>
<Button
{...transferProps(action)}
clickHandler={action.clickHandler}
disabled={action.disabled}
id={action.id || undefined}
label={action.label}
loadingIcon={action.loadingIcon}
ref={this.submitButtonRef}
type="button"
variant={action.variant}
/>
</ToolbarItem>
))}
{closeHandler && (
<ToolbarItem>
<Button
clickHandler={closeHandler}
label={translations.close}
priority="flat"
{...(id && { id: `${id}__closeModalFooterButton` })}
/>
</ToolbarItem>
)}
</Toolbar>
</div>
{(actions.length || closeHandler) && (
<div className={styles.footer}>
<Toolbar justify="center" dense>
{actions.map((action) => (
<ToolbarItem key={action.label}>
<Button
{...transferProps(action)}
clickHandler={action.clickHandler}
disabled={action.disabled}
id={action.id || undefined}
label={action.label}
loadingIcon={action.loadingIcon}
ref={this.submitButtonRef}
type="button"
variant={action.variant}
/>
</ToolbarItem>
))}
{closeHandler && (
<ToolbarItem>
<Button
clickHandler={closeHandler}
label={translations.close}
priority="flat"
{...(id && { id: `${id}__closeModalFooterButton` })}
/>
</ToolbarItem>
)}
</Toolbar>
</div>
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,20 +823,6 @@ exports[`rendering renders correctly with mandatory props only 1`] = `
</ScrollView>
</WithTranslationContextComponent>
</div>
<div
className="footer"
>
<Toolbar
align="top"
dense={true}
justify="center"
nowrap={false}
>
<div
className="toolbar isDense isAlignedToTop isJustifiedToCenter"
/>
</Toolbar>
</div>
</div>
</div>
</Modal>
Expand Down Expand Up @@ -923,13 +909,6 @@ exports[`rendering renders correctly with portal id 1`] = `
/>
</div>
</div>
<div
class="footer"
>
<div
class="toolbar isDense isAlignedToTop isJustifiedToCenter"
/>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -1041,20 +1020,6 @@ exports[`rendering renders correctly with portal id 1`] = `
</ScrollView>
</WithTranslationContextComponent>
</div>
<div
className="footer"
>
<Toolbar
align="top"
dense={true}
justify="center"
nowrap={false}
>
<div
className="toolbar isDense isAlignedToTop isJustifiedToCenter"
/>
</Toolbar>
</div>
</div>
</div>
</Portal>
Expand Down