Skip to content

Commit

Permalink
♻️ (imports) Update all styles imports to the component lib
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCortina committed Feb 15, 2025
1 parent f8ae154 commit f90fbbc
Show file tree
Hide file tree
Showing 93 changed files with 172 additions and 97 deletions.
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { HotkeysProvider } from 'react-hotkeys-hook';
import { useTranslation } from 'react-i18next';
import { BrowserRouter } from 'react-router-dom';

import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import {
Expand All @@ -29,7 +30,7 @@ import { handleGlobalEvents } from '../global-events';
import { useMetadataPref } from '../hooks/useMetadataPref';
import { installPolyfills } from '../polyfills';
import { useDispatch, useSelector, useStore } from '../redux';
import { styles, hasHiddenScrollbars, ThemeStyle, useTheme } from '../style';
import { hasHiddenScrollbars, ThemeStyle, useTheme } from '../style';
import { ExposeNavigate } from '../util/router-tools';

import { AppBackground } from './AppBackground';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/BankSyncStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React from 'react';
import { Trans } from 'react-i18next';
import { useTransition, animated } from 'react-spring';

import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';

import { useSelector } from '../redux';
import { theme, styles } from '../style';
import { theme } from '../style';

import { AnimatedRefresh } from './AnimatedRefresh';

Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useLocation } from 'react-router-dom';
import { Button } from '@actual-app/components/button';
import { Menu } from '@actual-app/components/menu';
import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';

Expand All @@ -18,7 +19,7 @@ import { Permissions } from '../auth/types';
import { useMetadataPref } from '../hooks/useMetadataPref';
import { useNavigate } from '../hooks/useNavigate';
import { useSelector, useDispatch } from '../redux';
import { theme, styles } from '../style';
import { theme } from '../style';

import { PrivacyFilter } from './PrivacyFilter';
import { useMultiuserEnabled, useServerURL } from './ServerContext';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useTranslation } from 'react-i18next';

import { Button, ButtonWithLoading } from '@actual-app/components/button';
import { Stack } from '@actual-app/components/stack';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
Expand All @@ -20,7 +21,7 @@ import type { NotificationWithId } from 'loot-core/client/state-types/notificati
import { AnimatedLoading } from '../icons/AnimatedLoading';
import { SvgDelete } from '../icons/v0';
import { useSelector, useDispatch } from '../redux';
import { styles, theme } from '../style';
import { theme } from '../style';

import { Link } from './common/Link';
import { useResponsive } from './responsive/ResponsiveProvider';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { type ReactNode, type CSSProperties } from 'react';

import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';

import { theme, styles } from '../style';
import { theme } from '../style';

import { useResponsive } from './responsive/ResponsiveProvider';

Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Routes, Route, useLocation } from 'react-router-dom';

import { Button } from '@actual-app/components/button';
import { SpaceBetween } from '@actual-app/components/space-between';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
Expand All @@ -30,7 +31,7 @@ import {
SvgViewShow,
} from '../icons/v2';
import { useDispatch } from '../redux';
import { theme, styles, type CSSProperties } from '../style';
import { theme, type CSSProperties } from '../style';

import { AccountSyncCheck } from './accounts/AccountSyncCheck';
import { AnimatedRefresh } from './AnimatedRefresh';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/accounts/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Trans } from 'react-i18next';
import { Navigate, useParams, useLocation } from 'react-router-dom';

import { Button } from '@actual-app/components/button';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
import { debounce } from 'debounce';
Expand Down Expand Up @@ -86,7 +87,7 @@ import {
import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useTransactionBatchActions } from '../../hooks/useTransactionBatchActions';
import { useSelector, useDispatch } from '../../redux';
import { styles, theme } from '../../style';
import { theme } from '../../style';
import { type SavedFilter } from '../filters/SavedFilterMenuButton';
import { TransactionList } from '../transactions/TransactionList';
import { validateAccountName } from '../util/accountValidation';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/accounts/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { InitialFocus } from '@actual-app/components/initial-focus';
import { Menu } from '@actual-app/components/menu';
import { Popover } from '@actual-app/components/popover';
import { Stack } from '@actual-app/components/stack';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import {
Expand All @@ -34,7 +35,7 @@ import {
SvgLockClosed,
SvgPencil1,
} from '../../icons/v2';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { AnimatedRefresh } from '../AnimatedRefresh';
import { Input } from '../common/Input';
import { MenuButton } from '../common/MenuButton';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Trans } from 'react-i18next';

import { Button } from '@actual-app/components/button';
import { InitialFocus } from '@actual-app/components/initial-focus';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';

Expand All @@ -13,7 +14,7 @@ import { type AccountEntity } from 'loot-core/types/models';
import { type TransObjectLiteral } from 'loot-core/types/util';

import { SvgCheckCircle1 } from '../../icons/v2';
import { styles, theme } from '../../style';
import { theme } from '../../style';
import { Input } from '../common/Input';
import { useFormat } from '../spreadsheet/useFormat';
import { useSheetValue } from '../spreadsheet/useSheetValue';
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import React, {
type CSSProperties,
} from 'react';

import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';

import { SvgExclamationOutline, SvgInformationOutline } from '../icons/v1';
import { styles, theme } from '../style';
import { theme } from '../style';

type AlertProps = {
icon?: ComponentType<{ width?: number; style?: CSSProperties }>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import React, {
} from 'react';
import { useTranslation } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { TextOneLine } from '@actual-app/components/text-one-line';
import { View } from '@actual-app/components/view';
import { css, cx } from '@emotion/css';

import { type AccountEntity } from 'loot-core/types/models';

import { useAccounts } from '../../hooks/useAccounts';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { useResponsive } from '../responsive/ResponsiveProvider';

import { Autocomplete } from './Autocomplete';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import React, {
} from 'react';

import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
import { css, cx } from '@emotion/css';
import Downshift, { type StateChangeTypes } from 'downshift';

import { getNormalisedString } from 'loot-core/shared/normalisation';

import { SvgRemove } from '../../icons/v2';
import { styles, theme } from '../../style';
import { Button } from '../common/Button';
import { Input } from '../common/Input';
import { useResponsive } from '../responsive/ResponsiveProvider';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import React, {
} from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { TextOneLine } from '@actual-app/components/text-one-line';
import { View } from '@actual-app/components/view';
Expand All @@ -28,7 +29,7 @@ import {
import { useCategories } from '../../hooks/useCategories';
import { useSyncedPref } from '../../hooks/useSyncedPref';
import { SvgSplit } from '../../icons/v0';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { useEnvelopeSheetValue } from '../budget/envelope/EnvelopeBudgetComponents';
import { makeAmountFullStyle } from '../budget/util';
import { useResponsive } from '../responsive/ResponsiveProvider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { type CSSProperties } from 'react';

import { styles, theme } from '../../style';
import { styles } from '@actual-app/components/styles';

import { theme } from '../../style';
import { useResponsive } from '../responsive/ResponsiveProvider';

type ItemHeaderProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React, {
} from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { TextOneLine } from '@actual-app/components/text-one-line';
import { View } from '@actual-app/components/view';
import { css, cx } from '@emotion/css';
Expand All @@ -28,7 +29,7 @@ import { useAccounts } from '../../hooks/useAccounts';
import { useCommonPayees, usePayees } from '../../hooks/usePayees';
import { SvgAdd, SvgBookmark } from '../../icons/v1';
import { useDispatch } from '../../redux';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { Button } from '../common/Button';
import { useResponsive } from '../responsive/ResponsiveProvider';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, {
} from 'react';
import { useTranslation, Trans } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
Expand All @@ -15,7 +16,7 @@ import { type TransObjectLiteral } from 'loot-core/types/util';

import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { SvgArrowThinRight } from '../../icons/v1';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { useResponsive } from '../responsive/ResponsiveProvider';
import { type Binding } from '../spreadsheet';
import { CellValue, CellValueText } from '../spreadsheet/CellValue';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { memo, useState, useMemo } from 'react';

import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import { useLocalPref } from '../../hooks/useLocalPref';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { DropHighlightPosContext } from '../sort';
import { Row } from '../table';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, {
useState,
} from 'react';

import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import {
Expand All @@ -13,7 +14,7 @@ import {

import { useCategories } from '../../hooks/useCategories';
import { useLocalPref } from '../../hooks/useLocalPref';
import { theme, styles } from '../../style';
import { theme } from '../../style';
import { type DropPosition } from '../sort';

import { BudgetCategories } from './BudgetCategories';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { useTranslation, Trans } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { Menu } from '@actual-app/components/menu';
import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import { SvgDotsHorizontalTriple } from '../../icons/v1';
import { theme, styles } from '../../style';
import { theme } from '../../style';

import { RenderMonths } from './RenderMonths';
import { getScrollbarWidth } from './util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import React, { type CSSProperties, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import * as monthUtils from 'loot-core/shared/months';

import { useResizeObserver } from '../../hooks/useResizeObserver';
import { SvgCalendar } from '../../icons/v2';
import { styles, theme } from '../../style';
import { theme } from '../../style';
import { Link } from '../common/Link';

import { type MonthBounds } from './MonthsContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useTranslation, Trans } from 'react-i18next';

import { Button } from '@actual-app/components/button';
import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
Expand All @@ -20,7 +21,7 @@ import { integerToCurrency, amountToInteger } from 'loot-core/shared/util';
import { useContextMenu } from '../../../hooks/useContextMenu';
import { useUndo } from '../../../hooks/useUndo';
import { SvgCheveronDown } from '../../../icons/v1';
import { styles, theme } from '../../../style';
import { theme } from '../../../style';
import { type Binding, type SheetFields } from '../../spreadsheet';
import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { useSheetName } from '../../spreadsheet/useSheetName';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';

import { Button } from '@actual-app/components/button';
import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';

Expand All @@ -11,7 +12,7 @@ import * as monthUtils from 'loot-core/shared/months';
import { useUndo } from '../../../../hooks/useUndo';
import { SvgDotsHorizontalTriple } from '../../../../icons/v1';
import { SvgArrowButtonDown1, SvgArrowButtonUp1 } from '../../../../icons/v2';
import { theme, styles } from '../../../../style';
import { theme } from '../../../../style';
import { NotesButton } from '../../../NotesButton';
import { NamespaceContext } from '../../../spreadsheet/NamespaceContext';
import { useEnvelopeBudget } from '../EnvelopeBudgetContext';
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/budget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { memo, useMemo, useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';

import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';

import { addNotification, pushModal } from 'loot-core/client/actions';
Expand All @@ -27,7 +28,6 @@ import { useLocalPref } from '../../hooks/useLocalPref';
import { useNavigate } from '../../hooks/useNavigate';
import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useDispatch } from '../../redux';
import { styles } from '../../style';
import { NamespaceContext } from '../spreadsheet/NamespaceContext';

import { DynamicBudgetTable } from './DynamicBudgetTable';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Trans } from 'react-i18next';

import { Button } from '@actual-app/components/button';
import { Popover } from '@actual-app/components/popover';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
Expand All @@ -21,7 +22,7 @@ import { integerToCurrency, amountToInteger } from 'loot-core/shared/util';

import { useUndo } from '../../../hooks/useUndo';
import { SvgCheveronDown } from '../../../icons/v1';
import { styles, theme } from '../../../style';
import { theme } from '../../../style';
import { type Binding, type SheetFields } from '../../spreadsheet';
import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { useSheetValue } from '../../spreadsheet/useSheetValue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { Popover } from '@actual-app/components/popover';
import { Stack } from '@actual-app/components/stack';
import { styles } from '@actual-app/components/styles';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';

Expand All @@ -13,7 +14,7 @@ import * as monthUtils from 'loot-core/shared/months';
import { useUndo } from '../../../../hooks/useUndo';
import { SvgDotsHorizontalTriple } from '../../../../icons/v1';
import { SvgArrowButtonDown1, SvgArrowButtonUp1 } from '../../../../icons/v2';
import { theme, styles } from '../../../../style';
import { theme } from '../../../../style';
import { NotesButton } from '../../../NotesButton';
import { NamespaceContext } from '../../../spreadsheet/NamespaceContext';
import { useTrackingBudget } from '../TrackingBudgetContext';
Expand Down
Loading

0 comments on commit f90fbbc

Please sign in to comment.