Skip to content

Commit

Permalink
custom footer inside of css.footer
Browse files Browse the repository at this point in the history
  • Loading branch information
mapmeld committed Dec 11, 2023
1 parent 34ae859 commit fb14381
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
7 changes: 2 additions & 5 deletions src/DesignKit.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ ul.sections {
font-weight: bold;
}
.modalFooter {
border-top: solid var(--theme-stroke-width) var(--theme-surface-border);
display: flex;
flex-direction: row;
padding-block: 8px;
padding-inline: 16px;
justify-content: space-between;
width: 100%;
}
52 changes: 27 additions & 25 deletions src/kit/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,32 +135,34 @@ export const Modal: React.FC<ModalProps> = ({
className={classes.join(' ')}
closeIcon={<Icon name="close" size="small" title="Close modal" />}
footer={
footer ?? (
<div className={css.footer}>
<div className={css.footerLink}>{footerLink}</div>
<div className={css.buttons}>
{(cancel || cancelText) && (
<Button key="back" onClick={close}>
{cancelText || DEFAULT_CANCEL_LABEL}
<div className={css.footer}>
{footer ?? (
<>
<div className={css.footerLink}>{footerLink}</div>
<div className={css.buttons}>
{(cancel || cancelText) && (
<Button key="back" onClick={close}>
{cancelText || DEFAULT_CANCEL_LABEL}
</Button>
)}
<Button
danger={danger}
disabled={!!submit?.disabled}
form={submit?.form}
htmlType={submit?.form ? 'submit' : 'button'}
key="submit"
loading={isSubmitting}
tooltip={
submit?.disabled ? 'Address validation errors before proceeding' : undefined
}
type="primary"
onClick={handleSubmit}>
{submit?.text ?? 'OK'}
</Button>
)}
<Button
danger={danger}
disabled={!!submit?.disabled}
form={submit?.form}
htmlType={submit?.form ? 'submit' : 'button'}
key="submit"
loading={isSubmitting}
tooltip={
submit?.disabled ? 'Address validation errors before proceeding' : undefined
}
type="primary"
onClick={handleSubmit}>
{submit?.text ?? 'OK'}
</Button>
</div>
</div>
)
</div>
</>
)}
</div>
}
key={key}
maskClosable={true}
Expand Down

0 comments on commit fb14381

Please sign in to comment.