diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2021-10-18 07:33:47 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2021-10-18 07:33:47 +0530 |
commit | 3e28975d32315444c4c535fda7ba2aa08a3a0bc2 (patch) | |
tree | ef7f7d9083b1d437b2cf68005cd6b831f526729c /src/components/ui/loader/index.tsx | |
parent | Bumped up version to: 5.6.3-beta.1 [skip ci] (diff) | |
parent | 5.6.3-nightly.37 [skip ci] (diff) | |
download | ferdium-app-3e28975d32315444c4c535fda7ba2aa08a3a0bc2.tar.gz ferdium-app-3e28975d32315444c4c535fda7ba2aa08a3a0bc2.tar.zst ferdium-app-3e28975d32315444c4c535fda7ba2aa08a3a0bc2.zip |
Merge branch 'nightly' into release
Diffstat (limited to 'src/components/ui/loader/index.tsx')
-rw-r--r-- | src/components/ui/loader/index.tsx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/components/ui/loader/index.tsx b/src/components/ui/loader/index.tsx new file mode 100644 index 000000000..0607bd48b --- /dev/null +++ b/src/components/ui/loader/index.tsx | |||
@@ -0,0 +1,44 @@ | |||
1 | import classnames from 'classnames'; | ||
2 | import { Component } from 'react'; | ||
3 | import injectStyle, { withTheme } from 'react-jss'; | ||
4 | import ReactLoader from 'react-loader'; | ||
5 | |||
6 | import { IWithStyle } from '../typings/generic'; | ||
7 | |||
8 | interface IProps extends IWithStyle { | ||
9 | className?: string; | ||
10 | color?: string; | ||
11 | } | ||
12 | |||
13 | const styles = () => ({ | ||
14 | container: { | ||
15 | position: 'relative', | ||
16 | height: 60, | ||
17 | }, | ||
18 | }); | ||
19 | |||
20 | class LoaderComponent extends Component<IProps> { | ||
21 | render() { | ||
22 | const { classes, className, color, theme } = this.props; | ||
23 | |||
24 | return ( | ||
25 | <div | ||
26 | className={classnames({ | ||
27 | [classes.container]: true, | ||
28 | [`${className}`]: className, | ||
29 | })} | ||
30 | data-type="franz-loader" | ||
31 | > | ||
32 | <ReactLoader | ||
33 | loaded={false} | ||
34 | width={4} | ||
35 | scale={0.75} | ||
36 | color={color || theme.colorText} | ||
37 | parentClassName={classes.loader} | ||
38 | /> | ||
39 | </div> | ||
40 | ); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | export const Loader = injectStyle(styles)(withTheme(LoaderComponent)); | ||