From 6f0b02fd7bef4f04afa9b4f68f66216c866a8759 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Thu, 4 Jan 2024 13:31:33 -0800 Subject: [PATCH] ESLint no-default-exports 10 - all desktop-client src folders except icons --- .eslintrc.js | 8 ++++---- packages/desktop-client/src/components/FixedSizeList.tsx | 2 +- packages/desktop-client/src/components/GlobalKeys.ts | 2 +- packages/desktop-client/src/components/ManageRules.tsx | 4 ++-- .../desktop-client/src/components/MobileBackButton.tsx | 2 +- packages/desktop-client/src/components/Modals.tsx | 4 ++-- packages/desktop-client/src/components/Titlebar.tsx | 4 ++-- .../desktop-client/src/components/accounts/Account.jsx | 2 +- .../desktop-client/src/components/accounts/Header.jsx | 2 +- .../src/components/accounts/MobileAccount.jsx | 4 ++-- .../src/components/accounts/MobileAccounts.jsx | 4 ++-- .../src/components/budget/BalanceWithCarryover.tsx | 2 +- .../src/components/budget/BudgetSummaries.tsx | 2 +- .../desktop-client/src/components/budget/MobileBudget.jsx | 2 +- .../src/components/budget/MobileBudgetTable.jsx | 2 +- .../desktop-client/src/components/budget/MonthPicker.tsx | 2 +- packages/desktop-client/src/components/budget/index.tsx | 6 +++--- .../src/components/budget/report/ReportComponents.tsx | 2 +- .../budget/report/budgetsummary/BudgetSummary.tsx | 2 +- .../src/components/budget/rollover/CoverTooltip.tsx | 2 +- .../src/components/budget/rollover/RolloverComponents.tsx | 2 +- .../src/components/budget/rollover/TransferTooltip.tsx | 2 +- .../desktop-client/src/components/common/ButtonLink.tsx | 2 +- packages/desktop-client/src/components/common/Link.tsx | 2 +- .../src/components/manager/ConfigServer.tsx | 2 +- .../src/components/manager/subscribe/ChangePassword.tsx | 2 +- .../src/components/manager/subscribe/Error.tsx | 2 +- .../src/components/manager/subscribe/common.tsx | 2 +- .../src/components/mobile/MobileNavTabs.tsx | 2 +- .../src/components/modals/CategoryGroupMenu.tsx | 2 +- .../desktop-client/src/components/modals/CategoryMenu.tsx | 2 +- .../src/components/modals/CreateAccount.tsx | 2 +- .../src/components/modals/CreateLocalAccount.tsx | 2 +- .../desktop-client/src/components/modals/EditField.jsx | 2 +- .../desktop-client/src/components/modals/EditRule.jsx | 2 +- .../src/components/modals/GoCardlessExternalMsg.tsx | 2 +- .../src/components/modals/ImportTransactions.jsx | 2 +- .../desktop-client/src/components/payees/ManagePayees.jsx | 5 +++-- .../src/components/payees/ManagePayeesWithData.jsx | 2 +- .../desktop-client/src/components/reports/Overview.jsx | 2 +- .../src/components/reports/reports/CashFlow.tsx | 2 +- .../src/components/reports/reports/CategorySpending.jsx | 2 +- .../components/reports/reports/CategorySpendingCard.jsx | 2 +- .../src/components/reports/reports/CustomReport.jsx | 4 ++-- .../src/components/reports/reports/CustomReportCard.jsx | 2 +- .../src/components/reports/reports/NetWorth.jsx | 2 +- .../src/components/reports/reports/Sankey.jsx | 4 ++-- .../src/components/reports/reports/SankeyCard.jsx | 2 +- packages/desktop-client/src/components/rules/Value.tsx | 2 +- .../src/components/schedules/DiscoverSchedules.tsx | 5 +++-- .../src/components/schedules/ScheduleDetails.jsx | 2 +- .../src/components/settings/Experimental.tsx | 2 +- packages/desktop-client/src/components/settings/index.tsx | 2 +- .../src/components/sidebar/SidebarWithData.tsx | 2 +- .../src/components/transactions/MobileTransaction.jsx | 4 ++-- .../components/transactions/SimpleTransactionsTable.jsx | 2 +- .../src/components/transactions/TransactionsTable.jsx | 2 +- .../desktop-client/src/components/util/GenericInput.jsx | 2 +- packages/desktop-client/src/hooks/useCategories.ts | 2 +- packages/desktop-client/src/hooks/useFeatureFlag.ts | 2 +- packages/desktop-client/src/hooks/useFilters.ts | 2 +- packages/desktop-client/src/hooks/useGoCardlessStatus.ts | 4 ++-- packages/desktop-client/src/hooks/useLatestVersion.ts | 7 ++----- packages/desktop-client/src/hooks/useNavigate.ts | 2 +- packages/desktop-client/src/hooks/usePrevious.ts | 2 +- packages/desktop-client/src/hooks/useResizeObserver.ts | 2 +- packages/desktop-client/src/hooks/useSelected.tsx | 2 +- .../desktop-client/src/hooks/useSendPlatformRequest.ts | 2 +- .../desktop-client/src/hooks/useSingleActiveEditForm.tsx | 4 ++-- packages/desktop-client/src/hooks/useStableCallback.ts | 2 +- packages/desktop-client/src/hooks/useSyncServerStatus.ts | 2 +- packages/desktop-client/src/util/router-tools.ts | 2 +- 72 files changed, 92 insertions(+), 93 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 73e563baa80..d13286bd828 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -246,11 +246,11 @@ module.exports = { './packages/crdt/**/*', './packages/desktop-client/src/*', './packages/desktop-client/src/components/**/*', - // './packages/desktop-client/src/hooks/**/*', + './packages/desktop-client/src/hooks/**/*', // './packages/desktop-client/src/icons/**/*', - // './packages/desktop-client/src/style/**/*', - // './packages/desktop-client/src/types/**/*', - // './packages/desktop-client/src/util/**/*', + './packages/desktop-client/src/style/**/*', + './packages/desktop-client/src/types/**/*', + './packages/desktop-client/src/util/**/*', // './packages/desktop-electron/**/*', // './packages/eslint-plugin-actual/**/*', // './packages/loot-core/*', diff --git a/packages/desktop-client/src/components/FixedSizeList.tsx b/packages/desktop-client/src/components/FixedSizeList.tsx index 7b12cc63e35..ad8fcb6623b 100644 --- a/packages/desktop-client/src/components/FixedSizeList.tsx +++ b/packages/desktop-client/src/components/FixedSizeList.tsx @@ -10,7 +10,7 @@ import { import memoizeOne from 'memoize-one'; -import useResizeObserver from '../hooks/useResizeObserver'; +import { useResizeObserver } from '../hooks/useResizeObserver'; import { type CSSProperties } from '../style'; import { View } from './common/View'; diff --git a/packages/desktop-client/src/components/GlobalKeys.ts b/packages/desktop-client/src/components/GlobalKeys.ts index 11b72693a7e..33e2e6bd846 100644 --- a/packages/desktop-client/src/components/GlobalKeys.ts +++ b/packages/desktop-client/src/components/GlobalKeys.ts @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import * as Platform from 'loot-core/src/client/platform'; -import useNavigate from '../hooks/useNavigate'; +import { useNavigate } from '../hooks/useNavigate'; export function GlobalKeys() { const navigate = useNavigate(); diff --git a/packages/desktop-client/src/components/ManageRules.tsx b/packages/desktop-client/src/components/ManageRules.tsx index 547e7cd80b7..d2fe4f29f60 100644 --- a/packages/desktop-client/src/components/ManageRules.tsx +++ b/packages/desktop-client/src/components/ManageRules.tsx @@ -16,8 +16,8 @@ import { mapField, friendlyOp } from 'loot-core/src/shared/rules'; import { describeSchedule } from 'loot-core/src/shared/schedules'; import { type RuleEntity } from 'loot-core/src/types/models'; -import useCategories from '../hooks/useCategories'; -import useSelected, { SelectedProvider } from '../hooks/useSelected'; +import { useCategories } from '../hooks/useCategories'; +import { useSelected, SelectedProvider } from '../hooks/useSelected'; import { theme } from '../style'; import { Button } from './common/Button'; diff --git a/packages/desktop-client/src/components/MobileBackButton.tsx b/packages/desktop-client/src/components/MobileBackButton.tsx index 69cc01e74c3..1577508ed4a 100644 --- a/packages/desktop-client/src/components/MobileBackButton.tsx +++ b/packages/desktop-client/src/components/MobileBackButton.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import useNavigate from '../hooks/useNavigate'; +import { useNavigate } from '../hooks/useNavigate'; import CheveronLeft from '../icons/v1/CheveronLeft'; import { type CSSProperties, styles, theme } from '../style'; diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index bbde5677a56..b78c56e8de6 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -5,8 +5,8 @@ import { useLocation } from 'react-router-dom'; import { send } from 'loot-core/src/platform/client/fetch'; import { useActions } from '../hooks/useActions'; -import useCategories from '../hooks/useCategories'; -import useSyncServerStatus from '../hooks/useSyncServerStatus'; +import { useCategories } from '../hooks/useCategories'; +import { useSyncServerStatus } from '../hooks/useSyncServerStatus'; import { type CommonModalProps } from '../types/modals'; import { CategoryGroupMenu } from './modals/CategoryGroupMenu'; diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index 22f79b2a937..9d13649dad7 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -15,8 +15,8 @@ import { listen } from 'loot-core/src/platform/client/fetch'; import { type LocalPrefs } from 'loot-core/src/types/prefs'; import { useActions } from '../hooks/useActions'; -import useFeatureFlag from '../hooks/useFeatureFlag'; -import useNavigate from '../hooks/useNavigate'; +import { useFeatureFlag } from '../hooks/useFeatureFlag'; +import { useNavigate } from '../hooks/useNavigate'; import ArrowLeft from '../icons/v1/ArrowLeft'; import AlertTriangle from '../icons/v2/AlertTriangle'; import NavigationMenu from '../icons/v2/NavigationMenu'; diff --git a/packages/desktop-client/src/components/accounts/Account.jsx b/packages/desktop-client/src/components/accounts/Account.jsx index dabe5f7d955..f1a37342ead 100644 --- a/packages/desktop-client/src/components/accounts/Account.jsx +++ b/packages/desktop-client/src/components/accounts/Account.jsx @@ -26,7 +26,7 @@ import { import { applyChanges, groupById } from 'loot-core/src/shared/util'; import { authorizeBank } from '../../gocardless'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { SelectedProviderWithItems } from '../../hooks/useSelected'; import { styles, theme } from '../../style'; import { Button } from '../common/Button'; diff --git a/packages/desktop-client/src/components/accounts/Header.jsx b/packages/desktop-client/src/components/accounts/Header.jsx index 048783d953e..3f37e8e8d2d 100644 --- a/packages/desktop-client/src/components/accounts/Header.jsx +++ b/packages/desktop-client/src/components/accounts/Header.jsx @@ -1,6 +1,6 @@ import React, { useState, useRef } from 'react'; -import useSyncServerStatus from '../../hooks/useSyncServerStatus'; +import { useSyncServerStatus } from '../../hooks/useSyncServerStatus'; import AnimatedLoading from '../../icons/AnimatedLoading'; import Add from '../../icons/v1/Add'; import ArrowsExpand3 from '../../icons/v2/ArrowsExpand3'; diff --git a/packages/desktop-client/src/components/accounts/MobileAccount.jsx b/packages/desktop-client/src/components/accounts/MobileAccount.jsx index 5eccb0e32f5..f0a1f4ae5e0 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccount.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccount.jsx @@ -19,8 +19,8 @@ import { ungroupTransactions, } from 'loot-core/src/shared/transactions'; -import useCategories from '../../hooks/useCategories'; -import useNavigate from '../../hooks/useNavigate'; +import { useCategories } from '../../hooks/useCategories'; +import { useNavigate } from '../../hooks/useNavigate'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import { theme } from '../../style'; diff --git a/packages/desktop-client/src/components/accounts/MobileAccounts.jsx b/packages/desktop-client/src/components/accounts/MobileAccounts.jsx index f6b63b4b217..0421936b332 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccounts.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccounts.jsx @@ -4,8 +4,8 @@ import { useSelector } from 'react-redux'; import * as queries from 'loot-core/src/client/queries'; import { useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; -import useNavigate from '../../hooks/useNavigate'; +import { useCategories } from '../../hooks/useCategories'; +import { useNavigate } from '../../hooks/useNavigate'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import Add from '../../icons/v1/Add'; import { theme, styles } from '../../style'; diff --git a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx index 81258220b40..73d95500830 100644 --- a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx +++ b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx @@ -1,6 +1,6 @@ import React, { type ComponentProps } from 'react'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import ArrowThinRight from '../../icons/v1/ArrowThinRight'; import { type CSSProperties } from '../../style'; import { View } from '../common/View'; diff --git a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx index 3975b131b12..759d51aed2c 100644 --- a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx +++ b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx @@ -11,7 +11,7 @@ import { css } from 'glamor'; import { addMonths, subMonths } from 'loot-core/src/shared/months'; -import useResizeObserver from '../../hooks/useResizeObserver'; +import { useResizeObserver } from '../../hooks/useResizeObserver'; import { View } from '../common/View'; import { MonthsContext } from './MonthsContext'; diff --git a/packages/desktop-client/src/components/budget/MobileBudget.jsx b/packages/desktop-client/src/components/budget/MobileBudget.jsx index 9fb1e98122c..446dd46e0ae 100644 --- a/packages/desktop-client/src/components/budget/MobileBudget.jsx +++ b/packages/desktop-client/src/components/budget/MobileBudget.jsx @@ -6,7 +6,7 @@ import { send, listen } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; import { useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import AnimatedLoading from '../../icons/AnimatedLoading'; import { theme } from '../../style'; diff --git a/packages/desktop-client/src/components/budget/MobileBudgetTable.jsx b/packages/desktop-client/src/components/budget/MobileBudgetTable.jsx index ace5c719c7a..94014a5d42d 100644 --- a/packages/desktop-client/src/components/budget/MobileBudgetTable.jsx +++ b/packages/desktop-client/src/components/budget/MobileBudgetTable.jsx @@ -6,7 +6,7 @@ import memoizeOne from 'memoize-one'; import { rolloverBudget, reportBudget } from 'loot-core/src/client/queries'; import * as monthUtils from 'loot-core/src/shared/months'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import ArrowThinLeft from '../../icons/v1/ArrowThinLeft'; import ArrowThinRight from '../../icons/v1/ArrowThinRight'; import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple'; diff --git a/packages/desktop-client/src/components/budget/MonthPicker.tsx b/packages/desktop-client/src/components/budget/MonthPicker.tsx index 704225822fc..d42a99b6584 100644 --- a/packages/desktop-client/src/components/budget/MonthPicker.tsx +++ b/packages/desktop-client/src/components/budget/MonthPicker.tsx @@ -2,7 +2,7 @@ import { type CSSProperties, useState } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; -import useResizeObserver from '../../hooks/useResizeObserver'; +import { useResizeObserver } from '../../hooks/useResizeObserver'; import { styles, theme } from '../../style'; import { View } from '../common/View'; diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx index eb9916d4456..959f63bc3c7 100644 --- a/packages/desktop-client/src/components/budget/index.tsx +++ b/packages/desktop-client/src/components/budget/index.tsx @@ -31,9 +31,9 @@ import * as monthUtils from 'loot-core/src/shared/months'; import { type GlobalPrefs, type LocalPrefs } from 'loot-core/src/types/prefs'; import { type BoundActions, useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; -import useNavigate from '../../hooks/useNavigate'; +import { useCategories } from '../../hooks/useCategories'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; +import { useNavigate } from '../../hooks/useNavigate'; import { styles } from '../../style'; import { View } from '../common/View'; import { diff --git a/packages/desktop-client/src/components/budget/report/ReportComponents.tsx b/packages/desktop-client/src/components/budget/report/ReportComponents.tsx index ba6a2276673..73f26004818 100644 --- a/packages/desktop-client/src/components/budget/report/ReportComponents.tsx +++ b/packages/desktop-client/src/components/budget/report/ReportComponents.tsx @@ -4,7 +4,7 @@ import { reportBudget } from 'loot-core/src/client/queries'; import evalArithmetic from 'loot-core/src/shared/arithmetic'; import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util'; -import useFeatureFlag from '../../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import CheveronDown from '../../../icons/v1/CheveronDown'; import { styles, theme, type CSSProperties } from '../../../style'; import { Button } from '../../common/Button'; diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx index 32a95641335..6d12d57884d 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx @@ -4,7 +4,7 @@ import { css } from 'glamor'; import * as monthUtils from 'loot-core/src/shared/months'; -import useFeatureFlag from '../../../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../../../hooks/useFeatureFlag'; import DotsHorizontalTriple from '../../../../icons/v1/DotsHorizontalTriple'; import ArrowButtonDown1 from '../../../../icons/v2/ArrowButtonDown1'; import ArrowButtonUp1 from '../../../../icons/v2/ArrowButtonUp1'; diff --git a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx index ebdecc7dc84..789da20a512 100644 --- a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx @@ -1,6 +1,6 @@ import React, { type ComponentProps, useState } from 'react'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete'; import { Button } from '../../common/Button'; import { InitialFocus } from '../../common/InitialFocus'; diff --git a/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx b/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx index 544159d7e80..fe89a52c814 100644 --- a/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx +++ b/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx @@ -4,7 +4,7 @@ import { rolloverBudget } from 'loot-core/src/client/queries'; import evalArithmetic from 'loot-core/src/shared/arithmetic'; import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util'; -import useFeatureFlag from '../../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import CheveronDown from '../../../icons/v1/CheveronDown'; import { styles, theme, type CSSProperties } from '../../../style'; import { Button } from '../../common/Button'; diff --git a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx index d76137afa6d..6e6f90c24e8 100644 --- a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx @@ -9,7 +9,7 @@ import { useSpreadsheet } from 'loot-core/src/client/SpreadsheetProvider'; import evalArithmetic from 'loot-core/src/shared/arithmetic'; import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete'; import { Button } from '../../common/Button'; import { InitialFocus } from '../../common/InitialFocus'; diff --git a/packages/desktop-client/src/components/common/ButtonLink.tsx b/packages/desktop-client/src/components/common/ButtonLink.tsx index 081ffcc8cb9..fde95935d1e 100644 --- a/packages/desktop-client/src/components/common/ButtonLink.tsx +++ b/packages/desktop-client/src/components/common/ButtonLink.tsx @@ -1,7 +1,7 @@ import React, { type ComponentProps } from 'react'; import { useMatch } from 'react-router-dom'; -import useNavigate from '../../hooks/useNavigate'; +import { useNavigate } from '../../hooks/useNavigate'; import { type CSSProperties } from '../../style'; import { Button } from './Button'; diff --git a/packages/desktop-client/src/components/common/Link.tsx b/packages/desktop-client/src/components/common/Link.tsx index 0132c12880b..0d3a96b4c10 100644 --- a/packages/desktop-client/src/components/common/Link.tsx +++ b/packages/desktop-client/src/components/common/Link.tsx @@ -3,7 +3,7 @@ import { NavLink, useMatch } from 'react-router-dom'; import { css } from 'glamor'; -import useNavigate from '../../hooks/useNavigate'; +import { useNavigate } from '../../hooks/useNavigate'; import { type CSSProperties, styles } from '../../style'; import { Button } from './Button'; diff --git a/packages/desktop-client/src/components/manager/ConfigServer.tsx b/packages/desktop-client/src/components/manager/ConfigServer.tsx index c95bbd9fe95..262565dda54 100644 --- a/packages/desktop-client/src/components/manager/ConfigServer.tsx +++ b/packages/desktop-client/src/components/manager/ConfigServer.tsx @@ -6,7 +6,7 @@ import { } from 'loot-core/src/shared/environment'; import { useActions } from '../../hooks/useActions'; -import useNavigate from '../../hooks/useNavigate'; +import { useNavigate } from '../../hooks/useNavigate'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import { theme } from '../../style'; import { Button, ButtonWithLoading } from '../common/Button'; diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx index 667ce832a52..7c8f9df0227 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { send } from 'loot-core/src/platform/client/fetch'; -import useNavigate from '../../../hooks/useNavigate'; +import { useNavigate } from '../../../hooks/useNavigate'; import { theme } from '../../../style'; import { Button } from '../../common/Button'; import { Text } from '../../common/Text'; diff --git a/packages/desktop-client/src/components/manager/subscribe/Error.tsx b/packages/desktop-client/src/components/manager/subscribe/Error.tsx index 9d537e4b60a..9f16104a94a 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Error.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/Error.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useLocation } from 'react-router-dom'; -import useNavigate from '../../../hooks/useNavigate'; +import { useNavigate } from '../../../hooks/useNavigate'; import { theme } from '../../../style'; import { Button } from '../../common/Button'; import { Text } from '../../common/Text'; diff --git a/packages/desktop-client/src/components/manager/subscribe/common.tsx b/packages/desktop-client/src/components/manager/subscribe/common.tsx index cb328c9608b..af454ab1c35 100644 --- a/packages/desktop-client/src/components/manager/subscribe/common.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/common.tsx @@ -3,7 +3,7 @@ import { useLocation } from 'react-router-dom'; import { send } from 'loot-core/src/platform/client/fetch'; -import useNavigate from '../../../hooks/useNavigate'; +import { useNavigate } from '../../../hooks/useNavigate'; import { theme } from '../../../style'; import { useSetServerURL } from '../../ServerContext'; diff --git a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx index d99728cabbb..f2439b4aae5 100644 --- a/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx +++ b/packages/desktop-client/src/components/mobile/MobileNavTabs.tsx @@ -4,7 +4,7 @@ import { useSpring, animated, config } from 'react-spring'; import { useDrag } from '@use-gesture/react'; -import usePrevious from '../../hooks/usePrevious'; +import { usePrevious } from '../../hooks/usePrevious'; import Add from '../../icons/v1/Add'; import Cog from '../../icons/v1/Cog'; import PiggyBank from '../../icons/v1/PiggyBank'; diff --git a/packages/desktop-client/src/components/modals/CategoryGroupMenu.tsx b/packages/desktop-client/src/components/modals/CategoryGroupMenu.tsx index 19e71e986d7..8af3a048b4a 100644 --- a/packages/desktop-client/src/components/modals/CategoryGroupMenu.tsx +++ b/packages/desktop-client/src/components/modals/CategoryGroupMenu.tsx @@ -4,7 +4,7 @@ import { useLiveQuery } from 'loot-core/src/client/query-hooks'; import q from 'loot-core/src/shared/query'; import { type CategoryGroupEntity } from 'loot-core/src/types/models'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { DotsHorizontalTriple } from '../../icons/v1'; import Add from '../../icons/v1/Add'; import Trash from '../../icons/v1/Trash'; diff --git a/packages/desktop-client/src/components/modals/CategoryMenu.tsx b/packages/desktop-client/src/components/modals/CategoryMenu.tsx index 44fe36d255b..6e2e1d10681 100644 --- a/packages/desktop-client/src/components/modals/CategoryMenu.tsx +++ b/packages/desktop-client/src/components/modals/CategoryMenu.tsx @@ -4,7 +4,7 @@ import { useLiveQuery } from 'loot-core/src/client/query-hooks'; import q from 'loot-core/src/shared/query'; import { type CategoryEntity } from 'loot-core/src/types/models'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { DotsHorizontalTriple } from '../../icons/v1'; import Trash from '../../icons/v1/Trash'; import NotesPaper from '../../icons/v2/NotesPaper'; diff --git a/packages/desktop-client/src/components/modals/CreateAccount.tsx b/packages/desktop-client/src/components/modals/CreateAccount.tsx index 6b6d6aa3439..167c2bce9ba 100644 --- a/packages/desktop-client/src/components/modals/CreateAccount.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccount.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import { authorizeBank } from '../../gocardless'; import { useActions } from '../../hooks/useActions'; -import useGoCardlessStatus from '../../hooks/useGoCardlessStatus'; +import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus'; import { type SyncServerStatus } from '../../hooks/useSyncServerStatus'; import { theme } from '../../style'; import { type CommonModalProps } from '../../types/modals'; diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx index b6561c25d67..837a77b8956 100644 --- a/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx +++ b/packages/desktop-client/src/components/modals/CreateLocalAccount.tsx @@ -3,7 +3,7 @@ import React, { useState } from 'react'; import { toRelaxedNumber } from 'loot-core/src/shared/util'; import { type BoundActions } from '../../hooks/useActions'; -import useNavigate from '../../hooks/useNavigate'; +import { useNavigate } from '../../hooks/useNavigate'; import { theme } from '../../style'; import { type CommonModalProps } from '../../types/modals'; import { Button } from '../common/Button'; diff --git a/packages/desktop-client/src/components/modals/EditField.jsx b/packages/desktop-client/src/components/modals/EditField.jsx index b35c34c1027..b007406d487 100644 --- a/packages/desktop-client/src/components/modals/EditField.jsx +++ b/packages/desktop-client/src/components/modals/EditField.jsx @@ -7,7 +7,7 @@ import { currentDay, dayFromDate } from 'loot-core/src/shared/months'; import { amountToInteger } from 'loot-core/src/shared/util'; import { useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { Add } from '../../icons/v1'; import { useResponsive } from '../../ResponsiveProvider'; import { styles, theme } from '../../style'; diff --git a/packages/desktop-client/src/components/modals/EditRule.jsx b/packages/desktop-client/src/components/modals/EditRule.jsx index c516c89197b..259a04f9a47 100644 --- a/packages/desktop-client/src/components/modals/EditRule.jsx +++ b/packages/desktop-client/src/components/modals/EditRule.jsx @@ -25,7 +25,7 @@ import { amountToInteger, } from 'loot-core/src/shared/util'; -import useSelected, { SelectedProvider } from '../../hooks/useSelected'; +import { useSelected, SelectedProvider } from '../../hooks/useSelected'; import AddIcon from '../../icons/v0/Add'; import SubtractIcon from '../../icons/v0/Subtract'; import InformationOutline from '../../icons/v1/InformationOutline'; diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.tsx b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.tsx index 9da38c3864c..3fe6e0a2572 100644 --- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.tsx +++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.tsx @@ -8,7 +8,7 @@ import { type GoCardlessToken, } from 'loot-core/src/types/models'; -import useGoCardlessStatus from '../../hooks/useGoCardlessStatus'; +import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus'; import AnimatedLoading from '../../icons/AnimatedLoading'; import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple'; import { theme } from '../../style'; diff --git a/packages/desktop-client/src/components/modals/ImportTransactions.jsx b/packages/desktop-client/src/components/modals/ImportTransactions.jsx index 200635c1d78..8c55e3b322e 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactions.jsx +++ b/packages/desktop-client/src/components/modals/ImportTransactions.jsx @@ -11,7 +11,7 @@ import { } from 'loot-core/src/shared/util'; import { useActions } from '../../hooks/useActions'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { theme, styles } from '../../style'; import { Button, ButtonWithLoading } from '../common/Button'; import { Input } from '../common/Input'; diff --git a/packages/desktop-client/src/components/payees/ManagePayees.jsx b/packages/desktop-client/src/components/payees/ManagePayees.jsx index fb3024417b9..aa994dd0a68 100644 --- a/packages/desktop-client/src/components/payees/ManagePayees.jsx +++ b/packages/desktop-client/src/components/payees/ManagePayees.jsx @@ -13,12 +13,13 @@ import memoizeOne from 'memoize-one'; import { groupById } from 'loot-core/src/shared/util'; -import useSelected, { +import { + useSelected, SelectedProvider, useSelectedDispatch, useSelectedItems, } from '../../hooks/useSelected'; -import useStableCallback from '../../hooks/useStableCallback'; +import { useStableCallback } from '../../hooks/useStableCallback'; import ExpandArrow from '../../icons/v0/ExpandArrow'; import { theme } from '../../style'; import { Button } from '../common/Button'; diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.jsx b/packages/desktop-client/src/components/payees/ManagePayeesWithData.jsx index 3f0607c3ffd..338adbb08cd 100644 --- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.jsx +++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.jsx @@ -5,7 +5,7 @@ import { send, listen } from 'loot-core/src/platform/client/fetch'; import { applyChanges } from 'loot-core/src/shared/util'; import { useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { ManagePayees } from './ManagePayees'; diff --git a/packages/desktop-client/src/components/reports/Overview.jsx b/packages/desktop-client/src/components/reports/Overview.jsx index 6eac086b5d6..93fd2f26ba7 100644 --- a/packages/desktop-client/src/components/reports/Overview.jsx +++ b/packages/desktop-client/src/components/reports/Overview.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { styles } from '../../style'; import { View } from '../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx index 628bed7a892..17ccfef4eaf 100644 --- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx +++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx @@ -6,7 +6,7 @@ import { send } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import useFilters from '../../../hooks/useFilters'; +import { useFilters } from '../../../hooks/useFilters'; import { theme, styles } from '../../../style'; import { AlignedText } from '../../common/AlignedText'; import { Block } from '../../common/Block'; diff --git a/packages/desktop-client/src/components/reports/reports/CategorySpending.jsx b/packages/desktop-client/src/components/reports/reports/CategorySpending.jsx index 2561497b4af..a8e7cf79a25 100644 --- a/packages/desktop-client/src/components/reports/reports/CategorySpending.jsx +++ b/packages/desktop-client/src/components/reports/reports/CategorySpending.jsx @@ -5,7 +5,7 @@ import * as d from 'date-fns'; import { send } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { styles } from '../../../style'; import { Select } from '../../common/Select'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.jsx b/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.jsx index e70f2be6d1b..c6b86eac0d9 100644 --- a/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.jsx +++ b/packages/desktop-client/src/components/reports/reports/CategorySpendingCard.jsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { styles } from '../../../style'; import { Block } from '../../common/Block'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.jsx b/packages/desktop-client/src/components/reports/reports/CustomReport.jsx index afad8d2ddc2..b2080b0daeb 100644 --- a/packages/desktop-client/src/components/reports/reports/CustomReport.jsx +++ b/packages/desktop-client/src/components/reports/reports/CustomReport.jsx @@ -10,8 +10,8 @@ import * as monthUtils from 'loot-core/src/shared/months'; import { amountToCurrency } from 'loot-core/src/shared/util'; import { useActions } from '../../../hooks/useActions'; -import useCategories from '../../../hooks/useCategories'; -import useFilters from '../../../hooks/useFilters'; +import { useCategories } from '../../../hooks/useCategories'; +import { useFilters } from '../../../hooks/useFilters'; import { theme, styles } from '../../../style'; import { AlignedText } from '../../common/AlignedText'; import { Block } from '../../common/Block'; diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportCard.jsx b/packages/desktop-client/src/components/reports/reports/CustomReportCard.jsx index 13ca7964f9d..7fc0b66bc1c 100644 --- a/packages/desktop-client/src/components/reports/reports/CustomReportCard.jsx +++ b/packages/desktop-client/src/components/reports/reports/CustomReportCard.jsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { styles } from '../../../style'; import { Block } from '../../common/Block'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/NetWorth.jsx b/packages/desktop-client/src/components/reports/reports/NetWorth.jsx index 42b2729a92d..5bdd779b24f 100644 --- a/packages/desktop-client/src/components/reports/reports/NetWorth.jsx +++ b/packages/desktop-client/src/components/reports/reports/NetWorth.jsx @@ -7,7 +7,7 @@ import { send } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import useFilters from '../../../hooks/useFilters'; +import { useFilters } from '../../../hooks/useFilters'; import { theme, styles } from '../../../style'; import { Paragraph } from '../../common/Paragraph'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/Sankey.jsx b/packages/desktop-client/src/components/reports/reports/Sankey.jsx index 25897169c00..fad99a01c68 100644 --- a/packages/desktop-client/src/components/reports/reports/Sankey.jsx +++ b/packages/desktop-client/src/components/reports/reports/Sankey.jsx @@ -5,8 +5,8 @@ import * as d from 'date-fns'; import { send } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; -import useCategories from '../../../hooks/useCategories'; -import useFilters from '../../../hooks/useFilters'; +import { useCategories } from '../../../hooks/useCategories'; +import { useFilters } from '../../../hooks/useFilters'; import { theme, styles } from '../../../style'; import { Paragraph } from '../../common/Paragraph'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/reports/reports/SankeyCard.jsx b/packages/desktop-client/src/components/reports/reports/SankeyCard.jsx index 7e09b06e302..492962c23c2 100644 --- a/packages/desktop-client/src/components/reports/reports/SankeyCard.jsx +++ b/packages/desktop-client/src/components/reports/reports/SankeyCard.jsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; -import useCategories from '../../../hooks/useCategories'; +import { useCategories } from '../../../hooks/useCategories'; import { styles } from '../../../style'; import { Block } from '../../common/Block'; import { View } from '../../common/View'; diff --git a/packages/desktop-client/src/components/rules/Value.tsx b/packages/desktop-client/src/components/rules/Value.tsx index a5fc4b38c5e..75366106758 100644 --- a/packages/desktop-client/src/components/rules/Value.tsx +++ b/packages/desktop-client/src/components/rules/Value.tsx @@ -7,7 +7,7 @@ import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { type CSSProperties, theme } from '../../style'; import { LinkButton } from '../common/LinkButton'; import { Text } from '../common/Text'; diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx index 71740185e6a..76ef25f5c30 100644 --- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx +++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx @@ -7,12 +7,13 @@ import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import type { DiscoverScheduleEntity } from 'loot-core/src/types/models'; import type { BoundActions } from '../../hooks/useActions'; -import useSelected, { +import { + useSelected, useSelectedDispatch, useSelectedItems, SelectedProvider, } from '../../hooks/useSelected'; -import useSendPlatformRequest from '../../hooks/useSendPlatformRequest'; +import { useSendPlatformRequest } from '../../hooks/useSendPlatformRequest'; import { theme } from '../../style'; import type { CommonModalProps } from '../../types/modals'; import { ButtonWithLoading } from '../common/Button'; diff --git a/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx b/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx index a29fa9bc436..87f15f497d8 100644 --- a/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx +++ b/packages/desktop-client/src/components/schedules/ScheduleDetails.jsx @@ -8,7 +8,7 @@ import { send, sendCatch } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; import { extractScheduleConds } from 'loot-core/src/shared/schedules'; -import useSelected, { SelectedProvider } from '../../hooks/useSelected'; +import { useSelected, SelectedProvider } from '../../hooks/useSelected'; import { theme } from '../../style'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete'; diff --git a/packages/desktop-client/src/components/settings/Experimental.tsx b/packages/desktop-client/src/components/settings/Experimental.tsx index ede622a26c5..273c1c21671 100644 --- a/packages/desktop-client/src/components/settings/Experimental.tsx +++ b/packages/desktop-client/src/components/settings/Experimental.tsx @@ -4,7 +4,7 @@ import { useSelector } from 'react-redux'; import type { FeatureFlag } from 'loot-core/src/types/prefs'; import { useActions } from '../../hooks/useActions'; -import useFeatureFlag from '../../hooks/useFeatureFlag'; +import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { theme } from '../../style'; import { LinkButton } from '../common/LinkButton'; import { Text } from '../common/Text'; diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx index dd6eb214e6e..73afbec5ba0 100644 --- a/packages/desktop-client/src/components/settings/index.tsx +++ b/packages/desktop-client/src/components/settings/index.tsx @@ -7,7 +7,7 @@ import * as Platform from 'loot-core/src/client/platform'; import { listen } from 'loot-core/src/platform/client/fetch'; import { useActions } from '../../hooks/useActions'; -import useLatestVersion, { useIsOutdated } from '../../hooks/useLatestVersion'; +import { useLatestVersion, useIsOutdated } from '../../hooks/useLatestVersion'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import { useResponsive } from '../../ResponsiveProvider'; import { theme } from '../../style'; diff --git a/packages/desktop-client/src/components/sidebar/SidebarWithData.tsx b/packages/desktop-client/src/components/sidebar/SidebarWithData.tsx index 1e4b8b35cfc..fbea1c1ebb3 100644 --- a/packages/desktop-client/src/components/sidebar/SidebarWithData.tsx +++ b/packages/desktop-client/src/components/sidebar/SidebarWithData.tsx @@ -8,7 +8,7 @@ import { send } from 'loot-core/src/platform/client/fetch'; import { type LocalPrefs } from 'loot-core/src/types/prefs'; import { useActions } from '../../hooks/useActions'; -import useNavigate from '../../hooks/useNavigate'; +import { useNavigate } from '../../hooks/useNavigate'; import ExpandArrow from '../../icons/v0/ExpandArrow'; import { styles, theme } from '../../style'; import { Button } from '../common/Button'; diff --git a/packages/desktop-client/src/components/transactions/MobileTransaction.jsx b/packages/desktop-client/src/components/transactions/MobileTransaction.jsx index e93499a37a3..73fa0067747 100644 --- a/packages/desktop-client/src/components/transactions/MobileTransaction.jsx +++ b/packages/desktop-client/src/components/transactions/MobileTransaction.jsx @@ -46,8 +46,8 @@ import { } from 'loot-core/src/shared/util'; import { useActions } from '../../hooks/useActions'; -import useCategories from '../../hooks/useCategories'; -import useNavigate from '../../hooks/useNavigate'; +import { useCategories } from '../../hooks/useCategories'; +import { useNavigate } from '../../hooks/useNavigate'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import { SingleActiveEditFormProvider, diff --git a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx index f5e5a7b21ae..fbbbc6cc925 100644 --- a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.jsx @@ -13,7 +13,7 @@ import { } from 'loot-core/src/client/reducers/queries'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { useSelectedItems, useSelectedDispatch } from '../../hooks/useSelected'; import ArrowsSynchronize from '../../icons/v2/ArrowsSynchronize'; import { theme, styles } from '../../style'; diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index d0594e7908b..bbb2166fd21 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -43,7 +43,7 @@ import { } from 'loot-core/src/shared/util'; import { useMergedRefs } from '../../hooks/useMergedRefs'; -import usePrevious from '../../hooks/usePrevious'; +import { usePrevious } from '../../hooks/usePrevious'; import { useSelectedDispatch, useSelectedItems } from '../../hooks/useSelected'; import LeftArrow2 from '../../icons/v0/LeftArrow2'; import RightArrow2 from '../../icons/v0/RightArrow2'; diff --git a/packages/desktop-client/src/components/util/GenericInput.jsx b/packages/desktop-client/src/components/util/GenericInput.jsx index 1b767d7545d..b42826e01ba 100644 --- a/packages/desktop-client/src/components/util/GenericInput.jsx +++ b/packages/desktop-client/src/components/util/GenericInput.jsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { getMonthYearFormat } from 'loot-core/src/shared/months'; -import useCategories from '../../hooks/useCategories'; +import { useCategories } from '../../hooks/useCategories'; import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete'; import { Autocomplete } from '../autocomplete/Autocomplete'; import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete'; diff --git a/packages/desktop-client/src/hooks/useCategories.ts b/packages/desktop-client/src/hooks/useCategories.ts index 548180acf3e..c515e7e3777 100644 --- a/packages/desktop-client/src/hooks/useCategories.ts +++ b/packages/desktop-client/src/hooks/useCategories.ts @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { useActions } from './useActions'; -export default function useCategories() { +export function useCategories() { const { getCategories } = useActions(); const categories = useSelector(state => state.queries.categories.list); diff --git a/packages/desktop-client/src/hooks/useFeatureFlag.ts b/packages/desktop-client/src/hooks/useFeatureFlag.ts index 5950eaf0d1b..289e9b7c77a 100644 --- a/packages/desktop-client/src/hooks/useFeatureFlag.ts +++ b/packages/desktop-client/src/hooks/useFeatureFlag.ts @@ -11,7 +11,7 @@ const DEFAULT_FEATURE_FLAG_STATE: Record = { experimentalOfxParser: true, }; -export default function useFeatureFlag(name: FeatureFlag): boolean { +export function useFeatureFlag(name: FeatureFlag): boolean { return useSelector(state => { const value = state.prefs.local[`flags.${name}`]; diff --git a/packages/desktop-client/src/hooks/useFilters.ts b/packages/desktop-client/src/hooks/useFilters.ts index 617146a615b..c23003c3980 100644 --- a/packages/desktop-client/src/hooks/useFilters.ts +++ b/packages/desktop-client/src/hooks/useFilters.ts @@ -1,6 +1,6 @@ import { useCallback, useMemo, useState } from 'react'; -export default function useFilters(initialFilters: T[] = []) { +export function useFilters(initialFilters: T[] = []) { const [filters, setFilters] = useState(initialFilters); const [conditionsOp, setConditionsOp] = useState('and'); const [saved, setSaved] = useState(null); diff --git a/packages/desktop-client/src/hooks/useGoCardlessStatus.ts b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts index bfacf126f02..22927722e2a 100644 --- a/packages/desktop-client/src/hooks/useGoCardlessStatus.ts +++ b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts @@ -2,9 +2,9 @@ import { useEffect, useState } from 'react'; import { send } from 'loot-core/src/platform/client/fetch'; -import useSyncServerStatus from './useSyncServerStatus'; +import { useSyncServerStatus } from './useSyncServerStatus'; -export default function useGoCardlessStatus() { +export function useGoCardlessStatus() { const [configured, setConfigured] = useState(null); const [isLoading, setIsLoading] = useState(false); const status = useSyncServerStatus(); diff --git a/packages/desktop-client/src/hooks/useLatestVersion.ts b/packages/desktop-client/src/hooks/useLatestVersion.ts index b2bb46ab271..c796264e278 100644 --- a/packages/desktop-client/src/hooks/useLatestVersion.ts +++ b/packages/desktop-client/src/hooks/useLatestVersion.ts @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'; import { getIsOutdated, getLatestVersion } from '../util/versions'; -function useIsOutdated(): boolean { +export function useIsOutdated(): boolean { const [isOutdated, setIsOutdated] = useState(false); const latestVersion = useLatestVersion(); @@ -15,7 +15,7 @@ function useIsOutdated(): boolean { return isOutdated; } -function useLatestVersion(): string { +export function useLatestVersion(): string { const [latestVersion, setLatestVersion] = useState(''); useEffect(() => { (async () => { @@ -25,6 +25,3 @@ function useLatestVersion(): string { return latestVersion; } - -export default useLatestVersion; -export { useIsOutdated }; diff --git a/packages/desktop-client/src/hooks/useNavigate.ts b/packages/desktop-client/src/hooks/useNavigate.ts index 05e993ff812..5f05bb2b1e6 100644 --- a/packages/desktop-client/src/hooks/useNavigate.ts +++ b/packages/desktop-client/src/hooks/useNavigate.ts @@ -8,7 +8,7 @@ import { useNavigate as useNavigateReactRouter, } from 'react-router-dom'; -export default function useNavigate(): NavigateFunction { +export function useNavigate(): NavigateFunction { const location = useLocation(); const navigate = useNavigateReactRouter(); return useCallback( diff --git a/packages/desktop-client/src/hooks/usePrevious.ts b/packages/desktop-client/src/hooks/usePrevious.ts index 8d5f2dc5543..8fd44448b8d 100644 --- a/packages/desktop-client/src/hooks/usePrevious.ts +++ b/packages/desktop-client/src/hooks/usePrevious.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; -export default function usePrevious(value: T): T | undefined { +export function usePrevious(value: T): T | undefined { const ref = useRef(); useEffect(() => { diff --git a/packages/desktop-client/src/hooks/useResizeObserver.ts b/packages/desktop-client/src/hooks/useResizeObserver.ts index 73c1a4521d2..45f37e24b66 100644 --- a/packages/desktop-client/src/hooks/useResizeObserver.ts +++ b/packages/desktop-client/src/hooks/useResizeObserver.ts @@ -1,6 +1,6 @@ import { useRef, useCallback } from 'react'; -export default function useResizeObserver( +export function useResizeObserver( func: (contentRect: DOMRectReadOnly) => void, ): (el: unknown) => void { const observer = useRef(null); diff --git a/packages/desktop-client/src/hooks/useSelected.tsx b/packages/desktop-client/src/hooks/useSelected.tsx index 934318e3661..3c3976c2bcd 100644 --- a/packages/desktop-client/src/hooks/useSelected.tsx +++ b/packages/desktop-client/src/hooks/useSelected.tsx @@ -50,7 +50,7 @@ type SelectAllAction = { type Actions = SelectAction | SelectNoneAction | SelectAllAction; -export default function useSelected( +export function useSelected( name: string, items: T[], initialSelectedIds: string[], diff --git a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts index d4967f58a10..29585532ea6 100644 --- a/packages/desktop-client/src/hooks/useSendPlatformRequest.ts +++ b/packages/desktop-client/src/hooks/useSendPlatformRequest.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; import { send } from 'loot-core/src/platform/client/fetch'; import type { Handlers } from 'loot-core/src/types/handlers'; -export default function useSendPlatformRequest( +export function useSendPlatformRequest( name: K, args?: Parameters[0], options?: { catchErrors?: boolean }, diff --git a/packages/desktop-client/src/hooks/useSingleActiveEditForm.tsx b/packages/desktop-client/src/hooks/useSingleActiveEditForm.tsx index 662c3c3fcbb..47869dce8a9 100644 --- a/packages/desktop-client/src/hooks/useSingleActiveEditForm.tsx +++ b/packages/desktop-client/src/hooks/useSingleActiveEditForm.tsx @@ -7,8 +7,8 @@ import React, { useEffect, } from 'react'; -import usePrevious from './usePrevious'; -import useStableCallback from './useStableCallback'; +import { usePrevious } from './usePrevious'; +import { useStableCallback } from './useStableCallback'; type ActiveEditCleanup = () => void; type ActiveEditAction = () => void | ActiveEditCleanup; diff --git a/packages/desktop-client/src/hooks/useStableCallback.ts b/packages/desktop-client/src/hooks/useStableCallback.ts index 8bcc9f34389..43afc3356bb 100644 --- a/packages/desktop-client/src/hooks/useStableCallback.ts +++ b/packages/desktop-client/src/hooks/useStableCallback.ts @@ -2,7 +2,7 @@ import { useRef, useLayoutEffect, useCallback } from 'react'; type UseStableCallbackArg = (...args: unknown[]) => unknown; -export default function useStableCallback(callback: UseStableCallbackArg) { +export function useStableCallback(callback: UseStableCallbackArg) { const callbackRef = useRef(); const memoCallback = useCallback( (...args) => callbackRef.current && callbackRef.current(...args), diff --git a/packages/desktop-client/src/hooks/useSyncServerStatus.ts b/packages/desktop-client/src/hooks/useSyncServerStatus.ts index 492c2bd8709..59096146c6a 100644 --- a/packages/desktop-client/src/hooks/useSyncServerStatus.ts +++ b/packages/desktop-client/src/hooks/useSyncServerStatus.ts @@ -4,7 +4,7 @@ import { useServerURL } from '../components/ServerContext'; export type SyncServerStatus = 'offline' | 'no-server' | 'online'; -export default function useSyncServerStatus(): SyncServerStatus { +export function useSyncServerStatus(): SyncServerStatus { const serverUrl = useServerURL(); const userData = useSelector(state => state.user.data); diff --git a/packages/desktop-client/src/util/router-tools.ts b/packages/desktop-client/src/util/router-tools.ts index f35a33560fc..1bba51ee678 100644 --- a/packages/desktop-client/src/util/router-tools.ts +++ b/packages/desktop-client/src/util/router-tools.ts @@ -1,6 +1,6 @@ import { useLayoutEffect } from 'react'; -import useNavigate from '../hooks/useNavigate'; +import { useNavigate } from '../hooks/useNavigate'; export function ExposeNavigate() { const navigate = useNavigate();