aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/loader/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ui/loader/index.tsx')
-rw-r--r--src/components/ui/loader/index.tsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/components/ui/loader/index.tsx b/src/components/ui/loader/index.tsx
index 0607bd48b..d56995ccc 100644
--- a/src/components/ui/loader/index.tsx
+++ b/src/components/ui/loader/index.tsx
@@ -1,25 +1,25 @@
1import classnames from 'classnames'; 1import classnames from 'classnames';
2import { Component } from 'react'; 2import { Component } from 'react';
3import injectStyle, { withTheme } from 'react-jss'; 3import injectStyle, { WithStylesProps } from 'react-jss';
4import ReactLoader from 'react-loader'; 4import ReactLoader from 'react-loader';
5 5
6import { IWithStyle } from '../typings/generic'; 6interface IProps extends WithStylesProps<typeof styles> {
7
8interface IProps extends IWithStyle {
9 className?: string; 7 className?: string;
10 color?: string; 8 color?: string;
11} 9}
12 10
13const styles = () => ({ 11const styles = theme => ({
14 container: { 12 container: {
15 position: 'relative', 13 position: 'relative',
16 height: 60, 14 height: 60,
17 }, 15 },
16 loader: {},
17 color: theme.colorText,
18}); 18});
19 19
20class LoaderComponent extends Component<IProps> { 20class LoaderComponent extends Component<IProps> {
21 render() { 21 render() {
22 const { classes, className, color, theme } = this.props; 22 const { classes, className, color } = this.props;
23 23
24 return ( 24 return (
25 <div 25 <div
@@ -33,7 +33,7 @@ class LoaderComponent extends Component<IProps> {
33 loaded={false} 33 loaded={false}
34 width={4} 34 width={4}
35 scale={0.75} 35 scale={0.75}
36 color={color || theme.colorText} 36 color={color || classes.color}
37 parentClassName={classes.loader} 37 parentClassName={classes.loader}
38 /> 38 />
39 </div> 39 </div>
@@ -41,4 +41,6 @@ class LoaderComponent extends Component<IProps> {
41 } 41 }
42} 42}
43 43
44export const Loader = injectStyle(styles)(withTheme(LoaderComponent)); 44export const Loader = injectStyle(styles, { injectTheme: true })(
45 LoaderComponent,
46);