diff options
author | 2022-11-20 17:35:21 +0530 | |
---|---|---|
committer | 2022-11-20 17:35:21 +0530 | |
commit | 86f9ab693dcad951271f727046214b03d91ebd69 (patch) | |
tree | 3d32ff4814b5484495b811c5fe0ebea4805f4e55 /src/components/ui/FullscreenLoader/index.tsx | |
parent | 6.2.1-nightly.47 [skip ci] (diff) | |
download | ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.tar.gz ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.tar.zst ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.zip |
Transform Todo feature, ServiceBarTargetUrl, ServiceIcon, TeamDashboard, Slider, Loader & WorkspaceSwitchningIndicator into ts (#782)
Diffstat (limited to 'src/components/ui/FullscreenLoader/index.tsx')
-rw-r--r-- | src/components/ui/FullscreenLoader/index.tsx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/components/ui/FullscreenLoader/index.tsx b/src/components/ui/FullscreenLoader/index.tsx new file mode 100644 index 000000000..002ee7932 --- /dev/null +++ b/src/components/ui/FullscreenLoader/index.tsx | |||
@@ -0,0 +1,54 @@ | |||
1 | import { Component, ReactElement, ReactNode } from 'react'; | ||
2 | import { observer } from 'mobx-react'; | ||
3 | import withStyles, { WithStylesProps } from 'react-jss'; | ||
4 | import classnames from 'classnames'; | ||
5 | import Loader from '../Loader'; | ||
6 | import styles from './styles'; | ||
7 | import { H1 } from '../headline'; | ||
8 | import { Theme } from '../../../themes'; | ||
9 | |||
10 | interface IProps extends WithStylesProps<typeof styles> { | ||
11 | className?: string; | ||
12 | title?: string; | ||
13 | theme?: Theme; | ||
14 | spinnerColor?: string; | ||
15 | loaded?: boolean; | ||
16 | children?: ReactNode; | ||
17 | } | ||
18 | |||
19 | @observer | ||
20 | class FullscreenLoader extends Component<IProps> { | ||
21 | render(): ReactElement { | ||
22 | const { | ||
23 | classes, | ||
24 | theme = '', | ||
25 | className = '', | ||
26 | spinnerColor = '', | ||
27 | children = null, | ||
28 | title = '', | ||
29 | loaded = false, | ||
30 | } = this.props; | ||
31 | |||
32 | return ( | ||
33 | <div className={classes.wrapper}> | ||
34 | <div | ||
35 | className={classnames({ | ||
36 | [`${classes.component}`]: true, | ||
37 | [`${className}`]: className, | ||
38 | })} | ||
39 | > | ||
40 | <H1 className={classes.title}>{title}</H1> | ||
41 | <Loader | ||
42 | color={ | ||
43 | spinnerColor || (theme && theme.colorFullscreenLoaderSpinner) | ||
44 | } | ||
45 | loaded={loaded} | ||
46 | /> | ||
47 | {children && <div className={classes.content}>{children}</div>} | ||
48 | </div> | ||
49 | </div> | ||
50 | ); | ||
51 | } | ||
52 | } | ||
53 | |||
54 | export default withStyles(styles, { injectTheme: true })(FullscreenLoader); | ||