diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-05-17 08:23:39 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-05-18 02:02:55 +0800 |
commit | 48b0b5481982b378277e517380cdd343773c7c64 (patch) | |
tree | 46d8e56420e6fcd4f11b0910d8f54e367d034513 /packages/website/ts/components/portal/loading.tsx | |
parent | 00515eb6f96c44387575fbae6f527c3661e84f43 (diff) | |
download | dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar.gz dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar.bz2 dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar.lz dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar.xz dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.tar.zst dexon-0x-contracts-48b0b5481982b378277e517380cdd343773c7c64.zip |
Add loading component
Diffstat (limited to 'packages/website/ts/components/portal/loading.tsx')
-rw-r--r-- | packages/website/ts/components/portal/loading.tsx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/website/ts/components/portal/loading.tsx b/packages/website/ts/components/portal/loading.tsx new file mode 100644 index 000000000..d804dd1b8 --- /dev/null +++ b/packages/website/ts/components/portal/loading.tsx @@ -0,0 +1,21 @@ +import CircularProgress from 'material-ui/CircularProgress'; +import * as React from 'react'; + +const CIRCULAR_PROGRESS_SIZE = 40; +const CIRCULAR_PROGRESS_THICKNESS = 5; + +export interface LoadingProps { + isLoading: boolean; + content: React.ReactNode; +} +export const Loading = (props: LoadingProps) => { + if (props.isLoading) { + return ( + <div className="center"> + <CircularProgress size={CIRCULAR_PROGRESS_SIZE} thickness={CIRCULAR_PROGRESS_THICKNESS} /> + </div> + ); + } else { + return <div>{props.content}</div>; + } +}; |