diff options
author | 2021-12-04 10:51:16 +0100 | |
---|---|---|
committer | 2021-12-04 10:51:16 +0100 | |
commit | 11c992b04f3cad6badf0ae86da65f490e31dd359 (patch) | |
tree | 749e63f6ba3e9bea48c186b5d8502d328edfd276 /src/components/ui/loader/index.tsx | |
parent | 5.6.4-nightly.24 [skip ci] (diff) | |
download | ferdium-app-11c992b04f3cad6badf0ae86da65f490e31dd359.tar.gz ferdium-app-11c992b04f3cad6badf0ae86da65f490e31dd359.tar.zst ferdium-app-11c992b04f3cad6badf0ae86da65f490e31dd359.zip |
chore: upgrade react-jss to latest (#2302)
Diffstat (limited to 'src/components/ui/loader/index.tsx')
-rw-r--r-- | src/components/ui/loader/index.tsx | 18 |
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 @@ | |||
1 | import classnames from 'classnames'; | 1 | import classnames from 'classnames'; |
2 | import { Component } from 'react'; | 2 | import { Component } from 'react'; |
3 | import injectStyle, { withTheme } from 'react-jss'; | 3 | import injectStyle, { WithStylesProps } from 'react-jss'; |
4 | import ReactLoader from 'react-loader'; | 4 | import ReactLoader from 'react-loader'; |
5 | 5 | ||
6 | import { IWithStyle } from '../typings/generic'; | 6 | interface IProps extends WithStylesProps<typeof styles> { |
7 | |||
8 | interface IProps extends IWithStyle { | ||
9 | className?: string; | 7 | className?: string; |
10 | color?: string; | 8 | color?: string; |
11 | } | 9 | } |
12 | 10 | ||
13 | const styles = () => ({ | 11 | const 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 | ||
20 | class LoaderComponent extends Component<IProps> { | 20 | class 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 | ||
44 | export const Loader = injectStyle(styles)(withTheme(LoaderComponent)); | 44 | export const Loader = injectStyle(styles, { injectTheme: true })( |
45 | LoaderComponent, | ||
46 | ); | ||