mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: remove SET_DASHBOARD_REQUEST_LOADING reducer.
feat: fix dropdown filter. feat: fix fetch resource data.
This commit is contained in:
22
client/src/components/Dialog/Dialog.js
Normal file
22
client/src/components/Dialog/Dialog.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { Dialog } from '@blueprintjs/core';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import { compose } from 'utils';
|
||||
|
||||
function DialogComponent(props) {
|
||||
const { name, children, closeDialog, onClose } = props;
|
||||
|
||||
const handleClose = (event) => {
|
||||
closeDialog(name)
|
||||
onClose && onClose(event);
|
||||
};
|
||||
return (
|
||||
<Dialog {...props} onClose={handleClose}>
|
||||
{ children }
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDialogActions,
|
||||
)(DialogComponent);
|
||||
15
client/src/components/Dialog/DialogContent.js
Normal file
15
client/src/components/Dialog/DialogContent.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Spinner, Classes } from '@blueprintjs/core';
|
||||
|
||||
export default function DialogContent(props) {
|
||||
const { isLoading, children } = props;
|
||||
|
||||
const loadingContent = (
|
||||
<div className={Classes.DIALOG_BODY}><Spinner size={30} /></div>
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
{isLoading ? loadingContent : children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
18
client/src/components/Dialog/DialogSuspense.js
Normal file
18
client/src/components/Dialog/DialogSuspense.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React, { Suspense } from 'react';
|
||||
import { Classes, Spinner } from '@blueprintjs/core';
|
||||
|
||||
function LoadingContent() {
|
||||
return (<div className={Classes.DIALOG_BODY}><Spinner size={30} /></div>);
|
||||
}
|
||||
|
||||
export default function DialogSuspense({
|
||||
children
|
||||
}) {
|
||||
return (
|
||||
<Suspense fallback={<LoadingContent /> }>
|
||||
<div className={'dialog__suspense-wrapper'}>
|
||||
{ children }
|
||||
</div>
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user