diff options
Diffstat (limited to 'src/components/ui/Loader.tsx')
-rw-r--r-- | src/components/ui/Loader.tsx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/components/ui/Loader.tsx b/src/components/ui/Loader.tsx index 67c9db22e..ae51f8145 100644 --- a/src/components/ui/Loader.tsx +++ b/src/components/ui/Loader.tsx | |||
@@ -1,19 +1,20 @@ | |||
1 | import { Component, ReactChildren } from 'react'; | 1 | import {Component, PropsWithChildren} from 'react'; |
2 | import { observer, inject } from 'mobx-react'; | 2 | import { observer, inject } from 'mobx-react'; |
3 | import Loader from 'react-loader'; | 3 | import Loader from 'react-loader'; |
4 | 4 | ||
5 | import { FerdiumStores } from '../../@types/stores.types'; | 5 | import { FerdiumStores } from '../../@types/stores.types'; |
6 | 6 | ||
7 | type Props = { | 7 | interface IProps { |
8 | children: ReactChildren; | 8 | className?: string; |
9 | loaded: boolean; | 9 | color?: string; |
10 | className: string; | 10 | loaded?: boolean; |
11 | color: string; | 11 | stores?: FerdiumStores; |
12 | stores: FerdiumStores; | 12 | } |
13 | }; | ||
14 | 13 | ||
15 | // Can this file be merged into the './loader/index.tsx' file? | 14 | // Can this file be merged into the './loader/index.tsx' file? |
16 | class LoaderComponent extends Component<Props> { | 15 | @inject("stores") |
16 | @observer | ||
17 | class LoaderComponent extends Component<PropsWithChildren<IProps>> { | ||
17 | static defaultProps = { | 18 | static defaultProps = { |
18 | loaded: false, | 19 | loaded: false, |
19 | color: 'ACCENT', | 20 | color: 'ACCENT', |
@@ -25,7 +26,7 @@ class LoaderComponent extends Component<Props> { | |||
25 | const color = | 26 | const color = |
26 | this.props.color !== 'ACCENT' | 27 | this.props.color !== 'ACCENT' |
27 | ? this.props.color | 28 | ? this.props.color |
28 | : this.props.stores.settings.app.accentColor; | 29 | : this.props.stores!.settings.app.accentColor; |
29 | 30 | ||
30 | return ( | 31 | return ( |
31 | <Loader | 32 | <Loader |
@@ -42,4 +43,4 @@ class LoaderComponent extends Component<Props> { | |||
42 | } | 43 | } |
43 | } | 44 | } |
44 | 45 | ||
45 | export default inject('stores')(observer(LoaderComponent)); | 46 | export default LoaderComponent; |