mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
refactoring: drawers suspense.
This commit is contained in:
20
client/src/components/Drawer/Drawer.js
Normal file
20
client/src/components/Drawer/Drawer.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { Position, Drawer } from '@blueprintjs/core';
|
||||
|
||||
export default function ({ children, isOpen, isClose, drawerProps }) {
|
||||
return (
|
||||
<Drawer
|
||||
isOpen={isOpen}
|
||||
title={<T id={'view_paper'} />}
|
||||
position={Position.RIGHT}
|
||||
canOutsideClickClose={true}
|
||||
canEscapeKeyClose={true}
|
||||
size={'65%'}
|
||||
onClose={isClose}
|
||||
{...drawerProps}
|
||||
>
|
||||
{children}
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
6
client/src/components/Drawer/DrawerSuspense.js
Normal file
6
client/src/components/Drawer/DrawerSuspense.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import React, { Suspense } from 'react';
|
||||
import { Spinner } from '@blueprintjs/core';
|
||||
|
||||
export default function DrawerSuspense({ children }) {
|
||||
return <Suspense fallback={<Spinner size={30} />}>{children}</Suspense>;
|
||||
}
|
||||
Reference in New Issue
Block a user