diff options
author | 2023-10-27 02:19:31 +0200 | |
---|---|---|
committer | 2023-10-27 01:19:31 +0100 | |
commit | 78cb67c641e5723af59e0cf8a172a443aafa6f33 (patch) | |
tree | ec121e8efecf027717ce4e58b29c72fa93ed3315 /src/components/ui/Loader.tsx | |
parent | 6.5.3-nightly.4 [skip ci] (diff) | |
download | ferdium-app-78cb67c641e5723af59e0cf8a172a443aafa6f33.tar.gz ferdium-app-78cb67c641e5723af59e0cf8a172a443aafa6f33.tar.zst ferdium-app-78cb67c641e5723af59e0cf8a172a443aafa6f33.zip |
feat: change loader component (#1410)
* CHANGED react-loater to react-loader-spinner
* CHANGED brandColor to primary
* feat: change loader component
- remove redundant /index path from Loader imports in multiple files
- remove commented out braces in RecipesDashboard
- remove redundant color which is default from Loader in InfoBar
- update size of Loader in InfoBar to be the same as InfoBox
- change passed size prop from string to number in Button component
- add slight gap for FullscreenLoader to styles.ts
- fix Loader to check for color primary which is passed rather than brandColor
- remove hardcoded width and height from WorkspaceSwitchingIndicator which lead to elements not being vertically centered
- remove color prop from Loader in WorkspaceSwitchingIndicator since white is already the default
- remove switchingIndicator.spinnerColor from default theme since white is already the default
* implement PR feedback
* re-add color to WorkspaceSwitchingIndicator
---------
Co-authored-by: MCMXC <16797721+mcmxcdev@users.noreply.github.com>
Diffstat (limited to 'src/components/ui/Loader.tsx')
-rw-r--r-- | src/components/ui/Loader.tsx | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/components/ui/Loader.tsx b/src/components/ui/Loader.tsx deleted file mode 100644 index d4457ae5f..000000000 --- a/src/components/ui/Loader.tsx +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | import { Component, ReactElement, ReactNode } from 'react'; | ||
2 | import { observer, inject } from 'mobx-react'; | ||
3 | import Loader from 'react-loader'; | ||
4 | |||
5 | import { FerdiumStores } from '../../@types/stores.types'; | ||
6 | |||
7 | interface IProps { | ||
8 | className?: string; | ||
9 | color?: string; | ||
10 | loaded?: boolean; | ||
11 | stores?: FerdiumStores; | ||
12 | children?: ReactNode; | ||
13 | } | ||
14 | |||
15 | // TODO: Can this file be merged into the './loader/index.tsx' file? | ||
16 | @inject('stores') | ||
17 | @observer | ||
18 | class LoaderComponent extends Component<IProps> { | ||
19 | render(): ReactElement { | ||
20 | const { | ||
21 | loaded = false, | ||
22 | color = 'ACCENT', | ||
23 | className, | ||
24 | children, | ||
25 | } = this.props; | ||
26 | |||
27 | const loaderColor = | ||
28 | color === 'ACCENT' ? this.props.stores!.settings.app.accentColor : color; | ||
29 | |||
30 | return ( | ||
31 | // @ts-expect-error Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactLoader> & Readonly<LoaderProps>' | ||
32 | <Loader | ||
33 | loaded={loaded} | ||
34 | width={4} | ||
35 | scale={0.6} | ||
36 | color={loaderColor} | ||
37 | component="span" | ||
38 | className={className} | ||
39 | > | ||
40 | {children} | ||
41 | </Loader> | ||
42 | ); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | export default LoaderComponent; | ||