feat: optimize style of SMS notifications module.

This commit is contained in:
a.bouhuolia
2021-11-09 12:34:55 +02:00
parent 4b5e06f50c
commit 7371557482
14 changed files with 96 additions and 45 deletions

View File

@@ -9,16 +9,16 @@ function DialogComponent(props) {
const { name, children, closeDialog, onClose } = props;
const handleClose = (event) => {
closeDialog(name)
closeDialog(name);
onClose && onClose(event);
};
return (
<Dialog {...props} onClose={handleClose}>
{ children }
{children}
</Dialog>
);
}
export default compose(
withDialogActions,
)(DialogComponent);
const DialogRoot = compose(withDialogActions)(DialogComponent);
export { DialogRoot as Dialog };

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { Spinner, Classes } from '@blueprintjs/core';
import classNames from 'classnames';
export default function DialogContent(props) {
export function DialogContent(props) {
const { isLoading, children } = props;
const loadingContent = (

View File

@@ -0,0 +1,26 @@
import React from 'react';
import styled from 'styled-components';
import { Classes } from '@blueprintjs/core';
export function DialogFooterActions({ alignment = 'right', children }) {
return (
<DialogFooterActionsRoot
className={Classes.DIALOG_FOOTER_ACTIONS}
alignment={alignment}
>
{children}
</DialogFooterActionsRoot>
);
}
const DialogFooterActionsRoot = styled.div`
margin-left: -10px;
margin-right: -10px;
justify-content: ${(props) =>
props.alignment === 'right' ? 'flex-end' : 'flex-start'};
.bp3-button {
margin-left: 10px;
margin-left: 10px;
}
`;

View File

@@ -5,7 +5,7 @@ function LoadingContent() {
return (<div className={Classes.DIALOG_BODY}><Spinner size={30} /></div>);
}
export default function DialogSuspense({
export function DialogSuspense({
children
}) {
return (

View File

@@ -0,0 +1,6 @@
export * from './Dialog';
export * from './DialogFooterActions';
export * from './DialogSuspense';
export * from './DialogContent';