summaryrefslogtreecommitdiffstats
path: root/src/components/ui/Loader.tsx
diff options
context:
space:
mode:
authorLibravatar Balaji Vijayakumar <kuttibalaji.v6@gmail.com>2022-10-26 18:49:54 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2022-10-26 19:26:39 +0530
commit47af2abe2c7dfa1b18494092278cbfb0a54f5db5 (patch)
tree6866f6744456bbc7146aa6120cbf5022976a9b1f /src/components/ui/Loader.tsx
parentUpgrade 'macos-notification-state' to git SHA from fork '0a168f5b1f94c1fd3c08... (diff)
downloadferdium-app-47af2abe2c7dfa1b18494092278cbfb0a54f5db5.tar.gz
ferdium-app-47af2abe2c7dfa1b18494092278cbfb0a54f5db5.tar.zst
ferdium-app-47af2abe2c7dfa1b18494092278cbfb0a54f5db5.zip
refactor: convert AccountDashboard to typescript
Diffstat (limited to 'src/components/ui/Loader.tsx')
-rw-r--r--src/components/ui/Loader.tsx23
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 @@
1import { Component, ReactChildren } from 'react'; 1import {Component, PropsWithChildren} from 'react';
2import { observer, inject } from 'mobx-react'; 2import { observer, inject } from 'mobx-react';
3import Loader from 'react-loader'; 3import Loader from 'react-loader';
4 4
5import { FerdiumStores } from '../../@types/stores.types'; 5import { FerdiumStores } from '../../@types/stores.types';
6 6
7type Props = { 7interface 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?
16class LoaderComponent extends Component<Props> { 15@inject("stores")
16@observer
17class 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
45export default inject('stores')(observer(LoaderComponent)); 46export default LoaderComponent;