Add ModalActions to Modal component
This commit is contained in:
@@ -62,4 +62,21 @@ export const Modal = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ModalActions = ({
|
||||||
|
children,
|
||||||
|
className = '',
|
||||||
|
align = 'right',
|
||||||
|
...rest
|
||||||
|
}) => {
|
||||||
|
const alignClass = align === 'left' ? 'modal-actions--left' :
|
||||||
|
align === 'center' ? 'modal-actions--center' :
|
||||||
|
'modal-actions--right';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`modal-actions ${alignClass} ${className}`} {...rest}>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
@@ -1 +1 @@
|
|||||||
export { Modal as default } from './Modal.jsx';
|
export { Modal as default, ModalActions } from './Modal.jsx';
|
@@ -57,6 +57,20 @@
|
|||||||
overflow-y: auto
|
overflow-y: auto
|
||||||
flex: 1
|
flex: 1
|
||||||
|
|
||||||
|
.modal-actions
|
||||||
|
display: flex
|
||||||
|
gap: 0.75rem
|
||||||
|
margin-top: 1.5rem
|
||||||
|
|
||||||
|
&--left
|
||||||
|
justify-content: flex-start
|
||||||
|
|
||||||
|
&--center
|
||||||
|
justify-content: center
|
||||||
|
|
||||||
|
&--right
|
||||||
|
justify-content: flex-end
|
||||||
|
|
||||||
@keyframes modalIn
|
@keyframes modalIn
|
||||||
from
|
from
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
Reference in New Issue
Block a user