From dfda3b7206c907e8fcc7802120ebd0bbbcba717a Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 11 Feb 2024 09:44:29 +0530 Subject: remove unused '@types/react-loader' pkg --- src/components/ui/loader/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/ui') diff --git a/src/components/ui/loader/index.tsx b/src/components/ui/loader/index.tsx index 2cee00d96..2c6e2bff4 100644 --- a/src/components/ui/loader/index.tsx +++ b/src/components/ui/loader/index.tsx @@ -29,11 +29,11 @@ class LoaderComponent extends Component { const { classes, className, - size = 36, + size = 100, color = this.props.stores?.settings.app.accentColor, loaded = false, } = this.props; - const loaderColor = color || '#FFFFFF'; + const loaderColor = color ?? '#FFFFFF'; return (
Date: Sun, 11 Feb 2024 09:50:32 +0530 Subject: minor refactoring to remove duplication with a constant --- src/components/settings/account/AccountDashboard.tsx | 8 ++++++-- src/components/settings/team/TeamDashboard.tsx | 4 ++-- src/components/ui/InfoBar.tsx | 7 ++++++- src/components/ui/Infobox.tsx | 7 ++++++- src/components/ui/button/index.tsx | 3 ++- src/components/ui/loader/index.tsx | 3 ++- src/config.ts | 2 ++ .../workspaces/components/WorkspaceSwitchingIndicator.tsx | 3 ++- src/themes/default/index.ts | 3 ++- 9 files changed, 30 insertions(+), 10 deletions(-) (limited to 'src/components/ui') diff --git a/src/components/settings/account/AccountDashboard.tsx b/src/components/settings/account/AccountDashboard.tsx index ffa684458..eab019084 100644 --- a/src/components/settings/account/AccountDashboard.tsx +++ b/src/components/settings/account/AccountDashboard.tsx @@ -7,7 +7,11 @@ import { H1, H2 } from '../../ui/headline'; import Loader from '../../ui/loader'; import Button from '../../ui/button'; import Infobox from '../../ui/infobox/index'; -import { LOCAL_SERVER, LIVE_FRANZ_API } from '../../../config'; +import { + DEFAULT_LOADER_COLOR, + LOCAL_SERVER, + LIVE_FRANZ_API, +} from '../../../config'; import User from '../../../models/User'; const messages = defineMessages({ @@ -123,7 +127,7 @@ class AccountDashboard extends Component { )} {!isUsingWithoutAccount && ( <> - {isLoading && } + {isLoading && } {!isLoading && userInfoRequestFailed && ( {
- {isLoading && } + {isLoading && } {!isLoading && userInfoRequestFailed && ( { className="contentWrapper" style={{ display: 'flex', gap: '8px' }} > - + {ctaLabel}
diff --git a/src/components/ui/Infobox.tsx b/src/components/ui/Infobox.tsx index 742717ed7..14e1a581c 100644 --- a/src/components/ui/Infobox.tsx +++ b/src/components/ui/Infobox.tsx @@ -6,6 +6,7 @@ import { noop } from 'lodash'; import { observer } from 'mobx-react'; import Loader from './loader/index'; import Icon from './icon'; +import { DEFAULT_LOADER_COLOR } from '../../config'; const icons = { 'checkbox-marked-circle-outline': mdiCheckboxMarkedCircleOutline, @@ -84,7 +85,11 @@ class Infobox extends Component { className="contentWrapper" style={{ display: 'flex', gap: '8px' }} > - + {ctaLabel} diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index a2194e34d..3247072a9 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx @@ -8,6 +8,7 @@ import withStyles, { WithStylesProps } from 'react-jss'; import Loader from '../loader/index'; import { Theme } from '../../../themes'; import { IFormField } from '../typings/generic'; +import { DEFAULT_LOADER_COLOR } from '../../../config'; type ButtonType = | 'primary' @@ -194,7 +195,7 @@ class ButtonComponent extends Component { <> {showLoader && (
- +
)}
diff --git a/src/components/ui/loader/index.tsx b/src/components/ui/loader/index.tsx index 2c6e2bff4..c0ae15028 100644 --- a/src/components/ui/loader/index.tsx +++ b/src/components/ui/loader/index.tsx @@ -4,6 +4,7 @@ import injectStyle, { WithStylesProps } from 'react-jss'; import { Oval } from 'react-loader-spinner'; import { inject } from 'mobx-react'; import { FerdiumStores } from '../../../@types/stores.types'; +import { DEFAULT_LOADER_COLOR } from '../../../config'; const styles = () => ({ container: { @@ -33,7 +34,7 @@ class LoaderComponent extends Component { color = this.props.stores?.settings.app.accentColor, loaded = false, } = this.props; - const loaderColor = color ?? '#FFFFFF'; + const loaderColor = color ?? DEFAULT_LOADER_COLOR; return (
{ return (
- +

{`${intl.formatMessage(messages.switchingTo)} ${nextWorkspaceName}`}

diff --git a/src/themes/default/index.ts b/src/themes/default/index.ts index cc886f299..ac04a6e3b 100644 --- a/src/themes/default/index.ts +++ b/src/themes/default/index.ts @@ -3,6 +3,7 @@ import { cloneDeep } from 'lodash'; import * as legacyStyles from '../legacy'; import type IStyleTypes from '../IStyleTypes'; +import { DEFAULT_LOADER_COLOR } from '../../config'; export default (brandPrimary: string) => { if (!brandPrimary) { @@ -14,7 +15,7 @@ export default (brandPrimary: string) => { const brandDanger = '#d9534f'; const uiFontSize = 14; const colorBackground = legacyStyles.themeGrayLighter; - const colorContentBackground = '#FFFFFF'; + const colorContentBackground = DEFAULT_LOADER_COLOR; const colorText = legacyStyles.themeGrayDark; const inputColor = legacyStyles.themeGray; const inputBackground = legacyStyles.themeGrayLightest; -- cgit v1.2.3-54-g00ecf