From 8e41d8d2dde7d780b15de10b3b92971c8a5dbe90 Mon Sep 17 00:00:00 2001 From: Tom French <tom@tomfren.ch> Date: Tue, 30 Aug 2022 01:24:32 +0100 Subject: [PATCH] chore: remove unused imports from desktop-client --- .../src/components/AppBackground.js | 2 +- .../src/components/BankSyncStatus.js | 2 +- .../desktop-client/src/components/Debugger.js | 3 +- .../src/components/LoggedInUser.js | 2 -- .../desktop-client/src/components/Modals.js | 1 - .../desktop-client/src/components/Page.js | 2 +- .../desktop-client/src/components/Settings.js | 11 ++----- .../src/components/SidebarWithData.js | 3 -- .../src/components/SpreadsheetInterface.js | 2 +- .../src/components/SyncNotifications.js | 10 ------ .../desktop-client/src/components/Titlebar.js | 8 +---- .../desktop-client/src/components/Tutorial.js | 4 --- .../src/components/TutorialPoints.js | 1 - .../src/components/UpdateNotification.js | 8 +---- .../src/components/accounts/Account.js | 32 ++----------------- .../components/accounts/AccountSyncCheck.js | 3 +- .../src/components/accounts/Filters.js | 3 +- .../accounts/SimpleTransactionsTable.js | 8 +---- .../components/accounts/TransactionList.js | 10 +----- .../components/accounts/TransactionsTable.js | 23 +++---------- .../accounts/TransactionsTable.test.js | 1 - .../components/budget/MonthCountSelector.js | 6 ++-- .../src/components/budget/index.js | 8 ++--- .../src/components/manager/ConfigServer.js | 13 ++------ .../src/components/manager/ManagementApp.js | 1 - .../src/components/manager/Modals.js | 1 - .../src/components/manager/ServerURL.js | 7 +--- .../components/manager/subscribe/Bootstrap.js | 7 ++-- .../manager/subscribe/ChangePassword.js | 16 +++------- .../manager/subscribe/ConfirmPasswordForm.js | 6 +--- .../src/components/manager/subscribe/Error.js | 11 ++----- .../src/components/manager/subscribe/Login.js | 7 ++-- .../components/manager/subscribe/common.js | 2 -- .../modals/ConfirmCategoryDelete.js | 3 +- .../src/components/modals/CreateAccount.js | 10 +----- .../components/modals/CreateEncryptionKey.js | 4 +-- .../src/components/modals/EditRule.js | 10 ++---- .../src/components/modals/FixEncryptionKey.js | 2 +- .../src/components/modals/ManageRules.js | 18 +++-------- .../components/modals/MergeUnusedPayees.js | 5 ++- .../src/components/modals/WelcomeScreen.js | 2 -- .../components/payees/ManagePayeesWithData.js | 4 +-- .../src/components/reports/CashFlow.js | 1 - .../src/components/reports/Header.js | 3 +- .../reports/graphs/net-worth-spreadsheet.js | 3 +- .../src/components/reports/util.js | 2 +- .../components/schedules/DiscoverSchedules.js | 8 ++--- .../src/components/schedules/EditSchedule.js | 16 ++-------- .../src/components/schedules/LinkSchedule.js | 2 +- .../schedules/PostsOfflineNotification.js | 13 ++------ .../components/schedules/SchedulesTable.js | 5 ++- .../src/components/schedules/index.js | 11 ++----- .../src/components/tools/FixSplitsTool.js | 9 ++---- .../components/tutorial/BudgetCategories.js | 2 +- .../src/components/tutorial/BudgetInitial.js | 4 +-- .../components/tutorial/BudgetNewIncome.js | 2 +- .../components/tutorial/BudgetNextMonth.js | 9 +----- .../src/components/tutorial/BudgetSummary.js | 2 +- .../components/tutorial/CategoryBalance.js | 5 ++- .../components/tutorial/DeleteTransactions.js | 1 - .../src/components/tutorial/Final.js | 2 -- .../src/components/tutorial/Intro.js | 2 -- .../src/components/tutorial/Overspending.js | 11 +------ .../src/components/tutorial/TransactionAdd.js | 2 +- .../components/tutorial/TransactionEnter.js | 3 +- .../tutorial/TransactionFinalize.js | 1 - .../src/components/util/DisplayId.js | 6 ++-- .../src/components/util/GenericInput.js | 3 +- .../src/hooks/useServerVersion.js | 2 +- 69 files changed, 87 insertions(+), 325 deletions(-) diff --git a/packages/desktop-client/src/components/AppBackground.js b/packages/desktop-client/src/components/AppBackground.js index f4ab15c68..af3fe5792 100644 --- a/packages/desktop-client/src/components/AppBackground.js +++ b/packages/desktop-client/src/components/AppBackground.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { View, Block } from 'loot-design/src/components/common'; import { css } from 'glamor'; import Background from './Background'; diff --git a/packages/desktop-client/src/components/BankSyncStatus.js b/packages/desktop-client/src/components/BankSyncStatus.js index 4ea6531f4..dddc3fcb1 100644 --- a/packages/desktop-client/src/components/BankSyncStatus.js +++ b/packages/desktop-client/src/components/BankSyncStatus.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { connect } from 'react-redux'; import { useTransition, animated } from 'react-spring'; import * as actions from 'loot-core/src/client/actions'; diff --git a/packages/desktop-client/src/components/Debugger.js b/packages/desktop-client/src/components/Debugger.js index e91d931af..770ab6b77 100644 --- a/packages/desktop-client/src/components/Debugger.js +++ b/packages/desktop-client/src/components/Debugger.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { send, init as initConnection @@ -12,7 +11,7 @@ import { Input, InlineField } from 'loot-design/src/components/common'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; require('codemirror/lib/codemirror.css'); require('codemirror/theme/monokai.css'); diff --git a/packages/desktop-client/src/components/LoggedInUser.js b/packages/desktop-client/src/components/LoggedInUser.js index 2a33e6e4b..46d472fe1 100644 --- a/packages/desktop-client/src/components/LoggedInUser.js +++ b/packages/desktop-client/src/components/LoggedInUser.js @@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import * as actions from 'loot-core/src/client/actions'; -import { send } from 'loot-core/src/platform/client/fetch'; import { View, Text, @@ -11,7 +10,6 @@ import { Menu } from 'loot-design/src/components/common'; import { colors } from 'loot-design/src/style'; -import ExclamationSolid from 'loot-design/src/svg/v1/ExclamationSolid'; function LoggedInUser({ history, diff --git a/packages/desktop-client/src/components/Modals.js b/packages/desktop-client/src/components/Modals.js index 6b66a155b..e9936e9a5 100644 --- a/packages/desktop-client/src/components/Modals.js +++ b/packages/desktop-client/src/components/Modals.js @@ -6,7 +6,6 @@ import { createLocation } from 'history'; import Component from '@reactions/component'; import * as actions from 'loot-core/src/client/actions'; import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; -import { getModalRoute } from '../util'; import CreateAccount from './modals/CreateAccount'; import CreateLocalAccount from 'loot-design/src/components/modals/CreateLocalAccount'; diff --git a/packages/desktop-client/src/components/Page.js b/packages/desktop-client/src/components/Page.js index 7a717a690..757993df0 100644 --- a/packages/desktop-client/src/components/Page.js +++ b/packages/desktop-client/src/components/Page.js @@ -1,7 +1,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { Modal, View, Text } from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { styles } from 'loot-design/src/style'; let PageTypeContext = React.createContext({ type: 'page' }); diff --git a/packages/desktop-client/src/components/Settings.js b/packages/desktop-client/src/components/Settings.js index 29ad3974e..e9c9a68cf 100644 --- a/packages/desktop-client/src/components/Settings.js +++ b/packages/desktop-client/src/components/Settings.js @@ -1,5 +1,4 @@ import React, { useState, useEffect, useRef } from 'react'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { css } from 'glamor'; import { Route, Switch, Redirect } from 'react-router-dom'; @@ -8,20 +7,14 @@ import { View, Text, Button, - ButtonLink, ButtonWithLoading, - AnchorLink, - Link, - Input + AnchorLink } from 'loot-design/src/components/common'; import { send, listen } from 'loot-core/src/platform/client/fetch'; import { numberFormats } from 'loot-core/src/shared/util'; import { styles, colors } from 'loot-design/src/style'; -import { Information, Warning, Error } from 'loot-design/src/components/alerts'; -import Checkmark from 'loot-design/src/svg/v1/Checkmark'; -import CheveronDown from 'loot-design/src/svg/v1/CheveronDown'; +import { Information } from 'loot-design/src/components/alerts'; import ExpandArrow from 'loot-design/src/svg/ExpandArrow'; -import ExclamationSolid from 'loot-design/src/svg/v1/ExclamationSolid'; import Platform from 'loot-core/src/client/platform'; import useServerVersion from '../hooks/useServerVersion'; diff --git a/packages/desktop-client/src/components/SidebarWithData.js b/packages/desktop-client/src/components/SidebarWithData.js index d1d21af67..eeaa5e23e 100644 --- a/packages/desktop-client/src/components/SidebarWithData.js +++ b/packages/desktop-client/src/components/SidebarWithData.js @@ -2,15 +2,12 @@ import React, { useState, useEffect } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; -import { select } from 'glamor'; -import lively from '@jlongster/lively'; import { send } from 'loot-core/src/platform/client/fetch'; import { styles, colors } from 'loot-design/src/style'; import { Button, Input, InitialFocus, - View, Text } from 'loot-design/src/components/common'; import { Sidebar } from 'loot-design/src/components/sidebar'; diff --git a/packages/desktop-client/src/components/SpreadsheetInterface.js b/packages/desktop-client/src/components/SpreadsheetInterface.js index ac9b80acb..856ddc633 100644 --- a/packages/desktop-client/src/components/SpreadsheetInterface.js +++ b/packages/desktop-client/src/components/SpreadsheetInterface.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import Cell from 'loot-design/src/components/spreadsheet/Cell'; import { View } from 'loot-design/src/components/common'; diff --git a/packages/desktop-client/src/components/SyncNotifications.js b/packages/desktop-client/src/components/SyncNotifications.js index a9409c42b..12563a78f 100644 --- a/packages/desktop-client/src/components/SyncNotifications.js +++ b/packages/desktop-client/src/components/SyncNotifications.js @@ -1,13 +1,3 @@ -import React, { useState } from 'react'; -import { - View, - Text, - Stack, - Button, - ButtonWithLoading -} from 'loot-design/src/components/common'; -import { colors } from 'loot-design/src/style'; - export function RepairSyncNotification() {} // TODO: sync button shouldn't show error status if it's a local file diff --git a/packages/desktop-client/src/components/Titlebar.js b/packages/desktop-client/src/components/Titlebar.js index c6a4fa0ff..4352dbcc7 100644 --- a/packages/desktop-client/src/components/Titlebar.js +++ b/packages/desktop-client/src/components/Titlebar.js @@ -1,10 +1,4 @@ -import React, { - useState, - useEffect, - useRef, - useCallback, - useContext -} from 'react'; +import React, { useState, useEffect, useRef, useContext } from 'react'; import { Switch, Route, withRouter } from 'react-router-dom'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; diff --git a/packages/desktop-client/src/components/Tutorial.js b/packages/desktop-client/src/components/Tutorial.js index 7c525c780..aeaa4e364 100644 --- a/packages/desktop-client/src/components/Tutorial.js +++ b/packages/desktop-client/src/components/Tutorial.js @@ -4,20 +4,16 @@ import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { View } from 'loot-design/src/components/common'; -import { colors } from 'loot-design/src/style'; import Intro from './tutorial/Intro'; import BudgetSummary from './tutorial/BudgetSummary'; import BudgetCategories from './tutorial/BudgetCategories'; import BudgetInitial from './tutorial/BudgetInitial'; import TransactionAdd from './tutorial/TransactionAdd'; import TransactionEnter from './tutorial/TransactionEnter'; -import TransactionFinalize from './tutorial/TransactionFinalize'; import BudgetNewIncome from './tutorial/BudgetNewIncome'; import CategoryBalance from './tutorial/CategoryBalance'; import Overspending from './tutorial/Overspending'; import BudgetNextMonth from './tutorial/BudgetNextMonth'; -import DeleteTransactions from './tutorial/DeleteTransactions'; import Final from './tutorial/Final'; function generatePath(innerRect, outerRect) { diff --git a/packages/desktop-client/src/components/TutorialPoints.js b/packages/desktop-client/src/components/TutorialPoints.js index 0f248f38c..91ed03ac4 100644 --- a/packages/desktop-client/src/components/TutorialPoints.js +++ b/packages/desktop-client/src/components/TutorialPoints.js @@ -1,7 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import lively from '@jlongster/lively'; class Tutorial extends React.Component { static childContextTypes = { diff --git a/packages/desktop-client/src/components/UpdateNotification.js b/packages/desktop-client/src/components/UpdateNotification.js index 09a4dd1b4..a2af5e840 100644 --- a/packages/desktop-client/src/components/UpdateNotification.js +++ b/packages/desktop-client/src/components/UpdateNotification.js @@ -2,13 +2,7 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { - View, - Text, - Block, - Link, - Button -} from 'loot-design/src/components/common'; +import { View, Text, Link, Button } from 'loot-design/src/components/common'; import { colors } from 'loot-design/src/style'; import Close from 'loot-design/src/svg/v1/Close'; diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index e17fd8a97..add537bcf 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -1,27 +1,8 @@ -import React, { - useState, - useLayoutEffect, - useEffect, - useRef, - useMemo, - useReducer, - useCallback -} from 'react'; +import React, { useState, useEffect, useRef, useMemo } from 'react'; import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux'; -import { - Redirect, - withRouter, - useParams, - useHistory, - useLocation -} from 'react-router-dom'; -import { css } from 'glamor'; -import Modal from 'react-modal'; -import Component from '@reactions/component'; +import { Redirect, useParams, useHistory, useLocation } from 'react-router-dom'; import { debounce } from 'debounce'; -import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext'; import { send, listen } from 'loot-core/src/platform/client/fetch'; import * as actions from 'loot-core/src/client/actions'; import { @@ -33,7 +14,6 @@ import { InitialFocus, Tooltip, Menu, - Block, Stack } from 'loot-design/src/components/common'; import { @@ -41,8 +21,6 @@ import { applyChanges, groupById } from 'loot-core/src/shared/util'; -import * as monthUtils from 'loot-core/src/shared/months'; -import TutorialPoint from 'loot-design/src/components/TutorialPoint'; import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple'; import Pencil1 from 'loot-design/src/svg/v2/Pencil1'; import SearchAlternate from 'loot-design/src/svg/v2/SearchAlternate'; @@ -53,17 +31,13 @@ import format from 'loot-design/src/components/spreadsheet/format'; import useSheetValue from 'loot-design/src/components/spreadsheet/useSheetValue'; import CellValue from 'loot-design/src/components/spreadsheet/CellValue'; import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1'; -import CheveronDown from 'loot-design/src/svg/v1/CheveronDown'; import CheckCircle1 from 'loot-design/src/svg/v2/CheckCircle1'; import Loading from 'loot-design/src/svg/v1/AnimatedLoading'; import ArrowsExpand3 from 'loot-design/src/svg/v2/ArrowsExpand3'; import ArrowsShrink3 from 'loot-design/src/svg/v2/ArrowsShrink3'; import * as queries from 'loot-core/src/client/queries'; import q, { runQuery, pagedQuery } from 'loot-core/src/client/query-helpers'; -import { queryContext } from 'loot-core/src/client/query-hooks'; import { SelectedItemsButton } from 'loot-design/src/components/table'; -import { Query } from 'loot-core/src/shared/query'; -import * as aql from 'loot-core/src/client/query-helpers'; import { deleteTransaction, updateTransaction, @@ -81,14 +55,12 @@ import { SelectedProviderWithItems, useSelectedItems } from 'loot-design/src/components/useSelected'; -import { keys } from 'loot-design/src/util/keys'; import { KeyHandlers } from 'loot-design/src/components/KeyHandlers'; import { FilterButton, AppliedFilters } from './Filters'; import { SchedulesProvider, useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules'; -import { getPayeesById } from 'loot-core/src/client/reducers/queries'; import { useActiveLocation } from '../ActiveLocation'; function EmptyMessage({ onAdd }) { diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js index e41e499d0..d32311ede 100644 --- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js +++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { Route, withRouter } from 'react-router-dom'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { View, Text, Button, Tooltip } from 'loot-design/src/components/common'; +import { View, Button, Tooltip } from 'loot-design/src/components/common'; import ExclamationOutline from 'loot-design/src/svg/v1/ExclamationOutline'; import { colors } from 'loot-design/src/style'; import { reauthorizeBank } from '../../plaid'; diff --git a/packages/desktop-client/src/components/accounts/Filters.js b/packages/desktop-client/src/components/accounts/Filters.js index 1ac950805..09b3dd19d 100644 --- a/packages/desktop-client/src/components/accounts/Filters.js +++ b/packages/desktop-client/src/components/accounts/Filters.js @@ -15,7 +15,6 @@ import { Tooltip, Stack, Button, - InitialFocus, Menu, CustomSelect } from 'loot-design/src/components/common'; @@ -33,7 +32,7 @@ import DeleteIcon from 'loot-design/src/svg/Delete'; import SettingsSliderAlternate from 'loot-design/src/svg/v2/SettingsSliderAlternate'; import GenericInput from '../util/GenericInput'; import { Value } from '../modals/ManageRules'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; let filterFields = [ 'date', diff --git a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js index 722687c5a..ea841924f 100644 --- a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js +++ b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js @@ -2,7 +2,6 @@ import React, { useMemo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { format as formatDate, - parse as parseDate, parseISO, isValid as isDateValid } from 'date-fns'; @@ -17,14 +16,9 @@ import { useSelectedItems, useSelectedDispatch } from 'loot-design/src/components/useSelected'; -import { - integerToAmount, - amountToInteger, - integerToCurrency -} from 'loot-core/src/shared/util'; +import { integerToCurrency } from 'loot-core/src/shared/util'; import { getAccountsById, - getPayeesById, getCategoriesById } from 'loot-core/src/client/reducers/queries'; import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize'; diff --git a/packages/desktop-client/src/components/accounts/TransactionList.js b/packages/desktop-client/src/components/accounts/TransactionList.js index 7776037f1..be5511ff7 100644 --- a/packages/desktop-client/src/components/accounts/TransactionList.js +++ b/packages/desktop-client/src/components/accounts/TransactionList.js @@ -1,13 +1,6 @@ -import React, { - useRef, - useEffect, - useCallback, - useLayoutEffect, - useMemo -} from 'react'; +import React, { useRef, useEffect, useCallback, useLayoutEffect } from 'react'; import { useDispatch } from 'react-redux'; import { TransactionTable } from './TransactionsTable'; -import lively from '@jlongster/lively'; import { splitTransaction, updateTransaction, @@ -16,7 +9,6 @@ import { applyTransactionDiff } from 'loot-core/src/shared/transactions'; import { send } from 'loot-core/src/platform/client/fetch'; -import { pushModal } from 'loot-core/src/client/actions/modals'; import { getChangedValues, applyChanges } from 'loot-core/src/shared/util'; const uuid = require('loot-core/src/platform/uuid'); diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.js b/packages/desktop-client/src/components/accounts/TransactionsTable.js index d1613abd7..d88f29639 100644 --- a/packages/desktop-client/src/components/accounts/TransactionsTable.js +++ b/packages/desktop-client/src/components/accounts/TransactionsTable.js @@ -5,25 +5,16 @@ import React, { useCallback, useLayoutEffect, useEffect, - useImperativeHandle, useContext, useReducer } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { format as formatDate, - parse as parseDate, parseISO, isValid as isDateValid } from 'date-fns'; -import q, { runQuery } from 'loot-core/src/client/query-helpers'; -import { - View, - Text, - Stack, - Tooltip, - Button -} from 'loot-design/src/components/common'; +import { View, Text, Tooltip, Button } from 'loot-design/src/components/common'; import CategoryAutocomplete from 'loot-design/src/components/CategorySelect'; import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete'; import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete'; @@ -31,15 +22,12 @@ import DateSelect from 'loot-design/src/components/DateSelect'; import RightArrow2 from 'loot-design/src/svg/RightArrow2'; import LeftArrow2 from 'loot-design/src/svg/LeftArrow2'; import Hyperlink2 from 'loot-design/src/svg/v2/Hyperlink2'; -import DeleteIcon from 'loot-design/src/svg/Delete'; import CheveronDown from 'loot-design/src/svg/v1/CheveronDown'; import CalendarIcon from 'loot-design/src/svg/v2/Calendar'; import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize'; import { integerToCurrency, amountToInteger, - applyChanges, - debugMemoFailure, titleFirst } from 'loot-core/src/shared/util'; import evalArithmetic from 'loot-core/src/shared/arithmetic'; @@ -48,13 +36,12 @@ import { getPayeesById, getCategoriesById } from 'loot-core/src/client/reducers/queries'; -import { currentDay, dayFromDate, addDays } from 'loot-core/src/shared/months'; +import { currentDay } from 'loot-core/src/shared/months'; import { splitTransaction, updateTransaction, deleteTransaction, - addSplitTransaction, - ungroupTransaction + addSplitTransaction } from 'loot-core/src/shared/transactions'; import { styles, colors } from 'loot-design/src/style'; import { @@ -67,14 +54,12 @@ import { CustomCell, CellButton, useTableNavigator, - Table, - ROW_HEIGHT + Table } from 'loot-design/src/components/table'; import { useSelectedDispatch, useSelectedItems } from 'loot-design/src/components/useSelected'; -import { keys } from 'loot-design/src/util/keys'; import { useMergedRefs } from 'loot-design/src/components/useMergedRefs'; import { getStatusProps } from '../schedules/StatusBadge'; import { useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules'; diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js index 75b37c7fc..eb4a9f341 100644 --- a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js +++ b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js @@ -1,7 +1,6 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import { render, fireEvent } from '@testing-library/react'; -import { debugDOM } from 'loot-core/src/mocks/util'; import { format as formatDate, parse as parseDate } from 'date-fns'; import { integerToCurrency } from 'loot-core/src/shared/util'; import { initServer } from 'loot-core/src/platform/client/fetch'; diff --git a/packages/desktop-client/src/components/budget/MonthCountSelector.js b/packages/desktop-client/src/components/budget/MonthCountSelector.js index 1dba1dbaa..ce9082014 100644 --- a/packages/desktop-client/src/components/budget/MonthCountSelector.js +++ b/packages/desktop-client/src/components/budget/MonthCountSelector.js @@ -1,6 +1,6 @@ -import React, { useState, useLayoutEffect } from 'react'; -import { styles, colors } from 'loot-design/src/style'; -import { View, Text } from 'loot-design/src/components/common'; +import React from 'react'; +import { colors } from 'loot-design/src/style'; +import { View } from 'loot-design/src/components/common'; import { useBudgetMonthCount } from 'loot-design/src/components/budget/BudgetMonthCountContext'; import CalendarIcon from 'loot-design/src/svg/v2/Calendar'; diff --git a/packages/desktop-client/src/components/budget/index.js b/packages/desktop-client/src/components/budget/index.js index 0bea00942..1fb2d5135 100644 --- a/packages/desktop-client/src/components/budget/index.js +++ b/packages/desktop-client/src/components/budget/index.js @@ -1,9 +1,5 @@ -import React, { useEffect, useContext, useMemo } from 'react'; +import React, { useContext, useMemo } from 'react'; import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; -import { bindActionCreators } from 'redux'; -import AutoSizer from 'react-virtualized-auto-sizer'; -import memoizeOne from 'memoize-one'; import * as actions from 'loot-core/src/client/actions'; import { send, listen } from 'loot-core/src/platform/client/fetch'; import * as monthUtils from 'loot-core/src/shared/months'; @@ -19,7 +15,7 @@ import { ReportProvider } from 'loot-design/src/components/budget/report/ReportC import DynamicBudgetTable from 'loot-design/src/components/budget/DynamicBudgetTable'; import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext'; import { View } from 'loot-design/src/components/common'; -import { styles, colors } from 'loot-design/src/style'; +import { styles } from 'loot-design/src/style'; import { addCategory, updateCategory, diff --git a/packages/desktop-client/src/components/manager/ConfigServer.js b/packages/desktop-client/src/components/manager/ConfigServer.js index 5a4687c61..b9380b04f 100644 --- a/packages/desktop-client/src/components/manager/ConfigServer.js +++ b/packages/desktop-client/src/components/manager/ConfigServer.js @@ -1,23 +1,16 @@ -import React, { useState, useEffect, useCallback } from 'react'; +import React, { useState, useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; -import * as actions from 'loot-core/src/client/actions'; import { View, Text, Button, ButtonWithLoading } from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { signOut, loggedIn } from 'loot-core/src/client/actions/user'; import { send } from 'loot-core/src/platform/client/fetch'; -import { - useBootstrapped, - Title, - Input, - Link, - ExternalLink -} from './subscribe/common'; +import { Title, Input } from './subscribe/common'; export default function ConfigServer() { let dispatch = useDispatch(); diff --git a/packages/desktop-client/src/components/manager/ManagementApp.js b/packages/desktop-client/src/components/manager/ManagementApp.js index cc737890c..82dcf68db 100644 --- a/packages/desktop-client/src/components/manager/ManagementApp.js +++ b/packages/desktop-client/src/components/manager/ManagementApp.js @@ -2,7 +2,6 @@ import React from 'react'; import { connect } from 'react-redux'; import { createBrowserHistory } from 'history'; import { Switch, Redirect, Router, Route } from 'react-router-dom'; -import { send } from 'loot-core/src/platform/client/fetch'; import * as actions from 'loot-core/src/client/actions'; import { View, Text } from 'loot-design/src/components/common'; import { colors } from 'loot-design/src/style'; diff --git a/packages/desktop-client/src/components/manager/Modals.js b/packages/desktop-client/src/components/manager/Modals.js index 2d6b120d5..e45b1ecf1 100644 --- a/packages/desktop-client/src/components/manager/Modals.js +++ b/packages/desktop-client/src/components/manager/Modals.js @@ -14,7 +14,6 @@ import ImportActual from 'loot-design/src/components/manager/ImportActual'; import DeleteFile from 'loot-design/src/components/manager/DeleteFile'; import CreateEncryptionKey from '../modals/CreateEncryptionKey'; import FixEncryptionKey from '../modals/FixEncryptionKey'; -import { colors } from 'loot-design/src/style'; function Modals({ modalStack, diff --git a/packages/desktop-client/src/components/manager/ServerURL.js b/packages/desktop-client/src/components/manager/ServerURL.js index ca2ab6b40..c1ba72ff9 100644 --- a/packages/desktop-client/src/components/manager/ServerURL.js +++ b/packages/desktop-client/src/components/manager/ServerURL.js @@ -1,10 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { - View, - Text, - AnchorLink, - Button -} from 'loot-design/src/components/common'; +import { View, Text, AnchorLink } from 'loot-design/src/components/common'; import { send } from 'loot-core/src/platform/client/fetch'; export default function ServerURL() { diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js index 9fd32d062..534c90c09 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js +++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js @@ -1,14 +1,13 @@ -import React, { useState, useEffect, useCallback } from 'react'; +import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; -import * as actions from 'loot-core/src/client/actions'; import { View, Text, Button } from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { loggedIn } from 'loot-core/src/client/actions/user'; import { createBudget } from 'loot-core/src/client/actions/budgets'; import { send } from 'loot-core/src/platform/client/fetch'; import { ConfirmPasswordForm } from './ConfirmPasswordForm'; -import { useBootstrapped, Title, Input, Link, ExternalLink } from './common'; +import { useBootstrapped, Title } from './common'; export default function Bootstrap() { let dispatch = useDispatch(); diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js index 5509c683b..60daf2352 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js +++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js @@ -1,19 +1,11 @@ -import React, { useState, useCallback } from 'react'; +import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; -import * as actions from 'loot-core/src/client/actions'; -import { - View, - Text, - Button, - ButtonWithLoading -} from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; -import { loggedIn } from 'loot-core/src/client/actions/user'; -import { createBudget } from 'loot-core/src/client/actions/budgets'; +import { View, Text, Button } from 'loot-design/src/components/common'; +import { colors } from 'loot-design/src/style'; import { send } from 'loot-core/src/platform/client/fetch'; import { ConfirmPasswordForm } from './ConfirmPasswordForm'; -import { useBootstrapped, Title, Input, Link, ExternalLink } from './common'; +import { Title } from './common'; export default function ChangePassword() { let dispatch = useDispatch(); diff --git a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js index 3f00ecadc..c71f7a5ad 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js +++ b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js @@ -1,9 +1,5 @@ import React, { useState } from 'react'; -import { - View, - Button, - ButtonWithLoading -} from 'loot-design/src/components/common'; +import { View, ButtonWithLoading } from 'loot-design/src/components/common'; import { Input } from './common'; export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) { diff --git a/packages/desktop-client/src/components/manager/subscribe/Error.js b/packages/desktop-client/src/components/manager/subscribe/Error.js index b3794e570..8de45a9b1 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Error.js +++ b/packages/desktop-client/src/components/manager/subscribe/Error.js @@ -1,12 +1,7 @@ -import React, { useState, useEffect } from 'react'; +import React from 'react'; import { useHistory, useLocation } from 'react-router-dom'; -import { - View, - Text, - Button, - ButtonWithLoading -} from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { View, Text, Button } from 'loot-design/src/components/common'; +import { colors } from 'loot-design/src/style'; function getErrorMessage(reason) { switch (reason) { diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.js b/packages/desktop-client/src/components/manager/subscribe/Login.js index af15b7a90..76befa85a 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Login.js +++ b/packages/desktop-client/src/components/manager/subscribe/Login.js @@ -1,18 +1,17 @@ -import React, { useState, useCallback } from 'react'; +import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; -import * as actions from 'loot-core/src/client/actions'; import { View, Text, Button, ButtonWithLoading } from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { loggedIn } from 'loot-core/src/client/actions/user'; import { createBudget } from 'loot-core/src/client/actions/budgets'; import { send } from 'loot-core/src/platform/client/fetch'; -import { useBootstrapped, Title, Input, Link, ExternalLink } from './common'; +import { useBootstrapped, Title, Input } from './common'; export default function Login() { let dispatch = useDispatch(); diff --git a/packages/desktop-client/src/components/manager/subscribe/common.js b/packages/desktop-client/src/components/manager/subscribe/common.js index b874edd16..4c5a25cf6 100644 --- a/packages/desktop-client/src/components/manager/subscribe/common.js +++ b/packages/desktop-client/src/components/manager/subscribe/common.js @@ -1,10 +1,8 @@ import React, { useEffect, useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { - AnchorLink, Text, Button, - ButtonLink, Input as BaseInput } from 'loot-design/src/components/common'; import { colors, styles } from 'loot-design/src/style'; diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js index 58c0c4139..dd315a86b 100644 --- a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js +++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js @@ -4,8 +4,7 @@ import { Text, Block, Modal, - Button, - Select + Button } from 'loot-design/src/components/common'; import { colors } from 'loot-design/src/style'; import { NativeCategorySelect } from 'loot-design/src/components/CategorySelect'; diff --git a/packages/desktop-client/src/components/modals/CreateAccount.js b/packages/desktop-client/src/components/modals/CreateAccount.js index fd487414d..1930d2f36 100644 --- a/packages/desktop-client/src/components/modals/CreateAccount.js +++ b/packages/desktop-client/src/components/modals/CreateAccount.js @@ -2,15 +2,7 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { send } from 'loot-core/src/platform/client/fetch'; -import { - View, - Text, - Modal, - Button, - Strong, - P -} from 'loot-design/src/components/common'; +import { View, Text, Modal, Button } from 'loot-design/src/components/common'; import { colors } from 'loot-design/src/style'; import { authorizeBank } from '../../plaid'; diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js index 069327737..c26de8794 100644 --- a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js +++ b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js @@ -3,9 +3,7 @@ import { css } from 'glamor'; import { View, Text, - Stack, Modal, - Button, ButtonWithLoading, ExternalLink, P, @@ -14,7 +12,7 @@ import { InitialFocus } from 'loot-design/src/components/common'; import { send } from 'loot-core/src/platform/client/fetch'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { getCreateKeyError } from 'loot-core/src/shared/errors'; export default function CreateEncryptionKey({ diff --git a/packages/desktop-client/src/components/modals/EditRule.js b/packages/desktop-client/src/components/modals/EditRule.js index 4bad393a6..cdfcd5d1d 100644 --- a/packages/desktop-client/src/components/modals/EditRule.js +++ b/packages/desktop-client/src/components/modals/EditRule.js @@ -1,28 +1,22 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; -import { bindActionCreators } from 'redux'; import { useDispatch, useSelector } from 'react-redux'; import { initiallyLoadPayees, setUndoEnabled } from 'loot-core/src/client/actions/queries'; -import * as undo from 'loot-core/src/platform/client/undo'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import { View, Text, Modal, Button, - Select, Stack, - Input, CustomSelect, Tooltip } from 'loot-design/src/components/common'; import GenericInput from '../util/GenericInput'; -import { keys } from 'loot-design/src/util/keys'; -import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; -import { getStatus } from 'loot-core/src/shared/schedules'; -import { colors, styles } from 'loot-design/src/style'; +import { send } from 'loot-core/src/platform/client/fetch'; +import { colors } from 'loot-design/src/style'; import SubtractIcon from 'loot-design/src/svg/Subtract'; import AddIcon from 'loot-design/src/svg/Add'; import InformationOutline from 'loot-design/src/svg/v1/InformationOutline'; diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKey.js b/packages/desktop-client/src/components/modals/FixEncryptionKey.js index 79210854b..c9c43caf3 100644 --- a/packages/desktop-client/src/components/modals/FixEncryptionKey.js +++ b/packages/desktop-client/src/components/modals/FixEncryptionKey.js @@ -12,7 +12,7 @@ import { ExternalLink } from 'loot-design/src/components/common'; import { send } from 'loot-core/src/platform/client/fetch'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { getTestKeyError } from 'loot-core/src/shared/errors'; export default function FixEncryptionKey({ diff --git a/packages/desktop-client/src/components/modals/ManageRules.js b/packages/desktop-client/src/components/modals/ManageRules.js index 496d3062e..61f89bb3e 100644 --- a/packages/desktop-client/src/components/modals/ManageRules.js +++ b/packages/desktop-client/src/components/modals/ManageRules.js @@ -1,16 +1,8 @@ -import React, { - useState, - useEffect, - useRef, - useCallback, - useMemo, - useImperativeHandle -} from 'react'; +import React, { useState, useEffect, useRef, useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { css } from 'glamor'; import { format as formatDate, parseISO } from 'date-fns'; import * as undo from 'loot-core/src/platform/client/undo'; -import * as actions from 'loot-core/src/client/actions'; import { initiallyLoadPayees } from 'loot-core/src/client/actions/queries'; import q from 'loot-core/src/client/query-helpers'; import { liveQueryContext } from 'loot-core/src/client/query-hooks'; @@ -37,14 +29,12 @@ import useSelected, { SelectedProvider } from 'loot-design/src/components/useSelected'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; +import { send } from 'loot-core/src/platform/client/fetch'; import { pushModal } from 'loot-core/src/client/actions/modals'; import { mapField, friendlyOp } from 'loot-core/src/shared/rules'; import ArrowRight from 'loot-design/src/svg/RightArrow2'; -import InformationOutline from 'loot-design/src/svg/v1/InformationOutline'; -import ExpandArrow from 'loot-design/src/svg/ExpandArrow'; -import { colors, styles } from 'loot-design/src/style'; -import { dayFromDate, getMonthYearFormat } from 'loot-core/src/shared/months'; +import { colors } from 'loot-design/src/style'; +import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { extractScheduleConds, getRecurringDescription diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayees.js b/packages/desktop-client/src/components/modals/MergeUnusedPayees.js index e5de4f6d0..58920d022 100644 --- a/packages/desktop-client/src/components/modals/MergeUnusedPayees.js +++ b/packages/desktop-client/src/components/modals/MergeUnusedPayees.js @@ -6,11 +6,10 @@ import { Modal, ModalButtons, Button, - P, - Stack + P } from 'loot-design/src/components/common'; import { Information } from 'loot-design/src/components/alerts'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { send } from 'loot-core/src/platform/client/fetch'; import { replaceModal } from 'loot-core/src/client/actions/modals'; diff --git a/packages/desktop-client/src/components/modals/WelcomeScreen.js b/packages/desktop-client/src/components/modals/WelcomeScreen.js index bc2094db6..8cab2fe61 100644 --- a/packages/desktop-client/src/components/modals/WelcomeScreen.js +++ b/packages/desktop-client/src/components/modals/WelcomeScreen.js @@ -3,9 +3,7 @@ import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; import { View, - Text, Modal, - Button, P, ExternalLink } from 'loot-design/src/components/common'; diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js index 9d5bc8f21..c80927f9f 100644 --- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js +++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js @@ -1,10 +1,8 @@ import React, { useState, useEffect, useRef } from 'react'; -import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; import * as undo from 'loot-core/src/platform/client/undo'; -import uuid from 'loot-core/src/platform/uuid'; -import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; +import { send, listen } from 'loot-core/src/platform/client/fetch'; import { ManagePayees } from 'loot-design/src/components/payees'; import { applyChanges } from 'loot-core/src/shared/util'; diff --git a/packages/desktop-client/src/components/reports/CashFlow.js b/packages/desktop-client/src/components/reports/CashFlow.js index 555bca909..10d9d4606 100644 --- a/packages/desktop-client/src/components/reports/CashFlow.js +++ b/packages/desktop-client/src/components/reports/CashFlow.js @@ -11,7 +11,6 @@ import { styles } from 'loot-design/src/style'; 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 { fromDateRepr } from './util'; import Header from './Header'; import Change from './Change'; import CashFlowGraph from './graphs/CashFlowGraph'; diff --git a/packages/desktop-client/src/components/reports/Header.js b/packages/desktop-client/src/components/reports/Header.js index 4ebee44bb..a73c9e836 100644 --- a/packages/desktop-client/src/components/reports/Header.js +++ b/packages/desktop-client/src/components/reports/Header.js @@ -1,9 +1,8 @@ import React from 'react'; -import { colors, styles } from 'loot-design/src/style'; +import { styles } from 'loot-design/src/style'; import { View, Select, - Link, Button, ButtonLink } from 'loot-design/src/components/common'; diff --git a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js index 5324da703..7c09f2b3a 100644 --- a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js +++ b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js @@ -1,5 +1,4 @@ import React from 'react'; -import { mergeObjects, flattenArray } from 'loot-core/src/shared/util'; import * as monthUtils from 'loot-core/src/shared/months'; import * as d from 'date-fns'; import { AlignedText } from 'loot-design/src/components/common'; @@ -9,7 +8,7 @@ import { integerToAmount, amountToInteger } from 'loot-core/src/shared/util'; -import { fromDateRepr, runAll, index } from '../util'; +import { index } from '../util'; export default function createSpreadsheet(start, end, accounts) { return async (spreadsheet, setData) => { diff --git a/packages/desktop-client/src/components/reports/util.js b/packages/desktop-client/src/components/reports/util.js index ec171db6c..5c297ca41 100644 --- a/packages/desktop-client/src/components/reports/util.js +++ b/packages/desktop-client/src/components/reports/util.js @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import q, { runQuery } from 'loot-core/src/client/query-helpers'; +import { runQuery } from 'loot-core/src/client/query-helpers'; export function useArgsMemo(func) { return (...args) => { diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js index d448dd9d4..23550a9de 100644 --- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js +++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js @@ -1,13 +1,10 @@ -import React, { useCallback, useState, useEffect } from 'react'; -import { useSelector } from 'react-redux'; +import React, { useState, useEffect } from 'react'; import { useLocation, useHistory } from 'react-router-dom'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import Platform from 'loot-core/src/client/platform'; -import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { send } from 'loot-core/src/platform/client/fetch'; import { View, - Text, Stack, Button, ButtonWithLoading, @@ -18,11 +15,10 @@ import { TableHeader, Row, Field, - Cell, SelectCell } from 'loot-design/src/components/table'; import { getRecurringDescription } from 'loot-core/src/shared/schedules'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import useSelected, { useSelectedDispatch, useSelectedItems, diff --git a/packages/desktop-client/src/components/schedules/EditSchedule.js b/packages/desktop-client/src/components/schedules/EditSchedule.js index c91d179a6..236aa81d0 100644 --- a/packages/desktop-client/src/components/schedules/EditSchedule.js +++ b/packages/desktop-client/src/components/schedules/EditSchedule.js @@ -1,8 +1,7 @@ -import React, { useEffect, useState, useReducer } from 'react'; +import React, { useEffect, useReducer } from 'react'; import { useParams, useHistory } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { pushModal } from 'loot-core/src/client/actions/modals'; -import { css } from 'glamor'; import { send, sendCatch } from 'loot-core/src/platform/client/fetch'; import q, { runQuery, liveQuery } from 'loot-core/src/client/query-helpers'; import { extractScheduleConds } from 'loot-core/src/shared/schedules'; @@ -13,18 +12,10 @@ import { FormLabel, Checkbox } from 'loot-design/src/components/forms'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete'; import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete'; -import { - Stack, - Input, - InputWithContent, - View, - Text, - Button, - ModalButtons -} from 'loot-design/src/components/common'; +import { Stack, View, Text, Button } from 'loot-design/src/components/common'; import DateSelect from 'loot-design/src/components/DateSelect'; import { SelectedItemsButton } from 'loot-design/src/components/table'; import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; @@ -35,7 +26,6 @@ import useSelected, { } from 'loot-design/src/components/useSelected'; import { OpSelect } from '../modals/EditRule'; import { AmountInput, BetweenAmountInput } from '../util/AmountInput'; -import { SchedulesProviderRaw } from 'loot-core/src/client/data-hooks/schedules'; import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker'; diff --git a/packages/desktop-client/src/components/schedules/LinkSchedule.js b/packages/desktop-client/src/components/schedules/LinkSchedule.js index bea6fcd80..1daa056ef 100644 --- a/packages/desktop-client/src/components/schedules/LinkSchedule.js +++ b/packages/desktop-client/src/components/schedules/LinkSchedule.js @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import { useLocation, useHistory } from 'react-router-dom'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { send } from 'loot-core/src/platform/client/fetch'; -import { View, Text } from 'loot-design/src/components/common'; +import { Text } from 'loot-design/src/components/common'; import { Page } from '../Page'; import { SchedulesTable } from './SchedulesTable'; diff --git a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js index 2369f51d8..ca37517d1 100644 --- a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js +++ b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js @@ -1,19 +1,10 @@ import React from 'react'; -import { useSelector } from 'react-redux'; import { useLocation, useHistory } from 'react-router-dom'; -import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { send } from 'loot-core/src/platform/client/fetch'; -import { - View, - Text, - P, - Button, - Stack -} from 'loot-design/src/components/common'; +import { Text, P, Button, Stack } from 'loot-design/src/components/common'; import { Page } from '../Page'; -import { SchedulesTable } from './SchedulesTable'; import DisplayId from '../util/DisplayId'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; export default function PostsOfflineNotification() { let location = useLocation(); diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.js b/packages/desktop-client/src/components/schedules/SchedulesTable.js index f77d45e91..fa2a3391a 100644 --- a/packages/desktop-client/src/components/schedules/SchedulesTable.js +++ b/packages/desktop-client/src/components/schedules/SchedulesTable.js @@ -1,7 +1,7 @@ import React, { useState, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { integerToCurrency } from 'loot-core/src/shared/util'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { View, Text, @@ -14,8 +14,7 @@ import { TableHeader, Row, Field, - Cell, - SelectCell + Cell } from 'loot-design/src/components/table'; import * as monthUtils from 'loot-core/src/shared/months'; import { getScheduledAmount } from 'loot-core/src/shared/schedules'; diff --git a/packages/desktop-client/src/components/schedules/index.js b/packages/desktop-client/src/components/schedules/index.js index db5d2a8a1..515763082 100644 --- a/packages/desktop-client/src/components/schedules/index.js +++ b/packages/desktop-client/src/components/schedules/index.js @@ -1,13 +1,6 @@ -import React, { useMemo, useEffect, useState } from 'react'; +import React from 'react'; import { useHistory } from 'react-router-dom'; -import { - View, - Text, - Button, - Tooltip, - Menu -} from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { View, Button } from 'loot-design/src/components/common'; import { send } from 'loot-core/src/platform/client/fetch'; import { Page } from '../Page'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; diff --git a/packages/desktop-client/src/components/tools/FixSplitsTool.js b/packages/desktop-client/src/components/tools/FixSplitsTool.js index 1d3cbf68c..15e50262a 100644 --- a/packages/desktop-client/src/components/tools/FixSplitsTool.js +++ b/packages/desktop-client/src/components/tools/FixSplitsTool.js @@ -1,12 +1,7 @@ -import React, { useCallback, useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { send } from 'loot-core/src/platform/client/fetch'; import { colors } from 'loot-design/src/style'; -import { - View, - Text, - P, - ButtonWithLoading -} from 'loot-design/src/components/common'; +import { View, P, ButtonWithLoading } from 'loot-design/src/components/common'; import { Page } from '../Page'; function renderResults(results) { diff --git a/packages/desktop-client/src/components/tutorial/BudgetCategories.js b/packages/desktop-client/src/components/tutorial/BudgetCategories.js index e2b223ce3..a120ee54d 100644 --- a/packages/desktop-client/src/components/tutorial/BudgetCategories.js +++ b/packages/desktop-client/src/components/tutorial/BudgetCategories.js @@ -1,7 +1,7 @@ import React from 'react'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { Title } from './common'; function BudgetInitial({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/BudgetInitial.js b/packages/desktop-client/src/components/tutorial/BudgetInitial.js index 4e1b577b6..55d5bf224 100644 --- a/packages/desktop-client/src/components/tutorial/BudgetInitial.js +++ b/packages/desktop-client/src/components/tutorial/BudgetInitial.js @@ -1,8 +1,8 @@ -import React, { useState } from 'react'; +import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { View, P, Button } from 'loot-design/src/components/common'; +import { P, Button } from 'loot-design/src/components/common'; import { Title, Standalone, useMinimized } from './common'; import Navigation from './Navigation'; diff --git a/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js b/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js index b0c327c03..cd9c3ed89 100644 --- a/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js +++ b/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js @@ -1,7 +1,7 @@ import React from 'react'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { Title } from './common'; function BudgetSummary({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js b/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js index 089ac9be9..7e36c493f 100644 --- a/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js +++ b/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js @@ -2,15 +2,8 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import { - View, - Tooltip, - Pointer, - P, - Button -} from 'loot-design/src/components/common'; +import { View, P, Button } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; import { Standalone, Title, useMinimized } from './common'; function BudgetNextMonth({ stepTwo, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/BudgetSummary.js b/packages/desktop-client/src/components/tutorial/BudgetSummary.js index b1820013d..cece55a63 100644 --- a/packages/desktop-client/src/components/tutorial/BudgetSummary.js +++ b/packages/desktop-client/src/components/tutorial/BudgetSummary.js @@ -1,7 +1,7 @@ import React from 'react'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { Title } from './common'; function BudgetSummary({ fromYNAB, targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/CategoryBalance.js b/packages/desktop-client/src/components/tutorial/CategoryBalance.js index 5a3da2235..ff99329b7 100644 --- a/packages/desktop-client/src/components/tutorial/CategoryBalance.js +++ b/packages/desktop-client/src/components/tutorial/CategoryBalance.js @@ -1,7 +1,6 @@ -import React, { useState } from 'react'; -import { Tooltip, Pointer, P, Button } from 'loot-design/src/components/common'; +import React from 'react'; +import { P, Button } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; import { Standalone, Title, useMinimized } from './common'; function CategoryBalance({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/DeleteTransactions.js b/packages/desktop-client/src/components/tutorial/DeleteTransactions.js index b15f39aaf..b432a7168 100644 --- a/packages/desktop-client/src/components/tutorial/DeleteTransactions.js +++ b/packages/desktop-client/src/components/tutorial/DeleteTransactions.js @@ -1,7 +1,6 @@ import React from 'react'; import { P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; import { Standalone, Title } from './common'; function DeleteTransactions({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/Final.js b/packages/desktop-client/src/components/tutorial/Final.js index 4550432c6..91d8a70d7 100644 --- a/packages/desktop-client/src/components/tutorial/Final.js +++ b/packages/desktop-client/src/components/tutorial/Final.js @@ -1,7 +1,5 @@ import React from 'react'; import { P, ModalButtons, Button } from 'loot-design/src/components/common'; -import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; import { Standalone, Title, ExternalLink } from './common'; function Final({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/Intro.js b/packages/desktop-client/src/components/tutorial/Intro.js index d426ec5e8..2bab2fbf2 100644 --- a/packages/desktop-client/src/components/tutorial/Intro.js +++ b/packages/desktop-client/src/components/tutorial/Intro.js @@ -2,12 +2,10 @@ import React from 'react'; import { View, Text, - Block, P, ModalButtons, Button } from 'loot-design/src/components/common'; -import { styles, colors } from 'loot-design/src/style'; import { Standalone, Title, ExternalLink } from './common'; function Intro({ fromYNAB, nextTutorialStage, closeTutorial }) { diff --git a/packages/desktop-client/src/components/tutorial/Overspending.js b/packages/desktop-client/src/components/tutorial/Overspending.js index 68f418867..26b9a3c4a 100644 --- a/packages/desktop-client/src/components/tutorial/Overspending.js +++ b/packages/desktop-client/src/components/tutorial/Overspending.js @@ -2,21 +2,12 @@ import React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; -import * as spreadsheet from 'loot-core/src/client/sheetql/spreadsheet'; import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue'; import NamespaceContext from 'loot-design/src/components/spreadsheet/NamespaceContext'; -import { - Tooltip, - Pointer, - P, - View, - Text, - Button -} from 'loot-design/src/components/common'; +import { P, View, Text, Button } from 'loot-design/src/components/common'; import * as monthUtils from 'loot-core/src/shared/months'; import { integerToCurrency } from 'loot-core/src/shared/util'; import Navigation from './Navigation'; -import { colors } from 'loot-design/src/style'; import { Standalone, Title, useMinimized } from './common'; function Overspending({ navigationProps, stepTwo }) { diff --git a/packages/desktop-client/src/components/tutorial/TransactionAdd.js b/packages/desktop-client/src/components/tutorial/TransactionAdd.js index 99738c3ef..f4e2ddc18 100644 --- a/packages/desktop-client/src/components/tutorial/TransactionAdd.js +++ b/packages/desktop-client/src/components/tutorial/TransactionAdd.js @@ -1,7 +1,7 @@ import React from 'react'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; import { Title } from './common'; function TransactionAdd({ targetRect, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/TransactionEnter.js b/packages/desktop-client/src/components/tutorial/TransactionEnter.js index 77da1790c..50ce47baa 100644 --- a/packages/desktop-client/src/components/tutorial/TransactionEnter.js +++ b/packages/desktop-client/src/components/tutorial/TransactionEnter.js @@ -1,7 +1,6 @@ import React from 'react'; -import { View, Tooltip, Pointer, P } from 'loot-design/src/components/common'; +import { P } from 'loot-design/src/components/common'; import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; import * as monthUtils from 'loot-core/src/shared/months'; import { Standalone, Title } from './common'; diff --git a/packages/desktop-client/src/components/tutorial/TransactionFinalize.js b/packages/desktop-client/src/components/tutorial/TransactionFinalize.js index 0a27f7fca..266e583ab 100644 --- a/packages/desktop-client/src/components/tutorial/TransactionFinalize.js +++ b/packages/desktop-client/src/components/tutorial/TransactionFinalize.js @@ -2,7 +2,6 @@ import React from 'react'; import { P } from 'loot-design/src/components/common'; import { css } from 'glamor'; import Navigation from './Navigation'; -import * as monthUtils from 'loot-core/src/shared/months'; import { Standalone } from './common'; function TransactionFinalize({ navigationProps }) { diff --git a/packages/desktop-client/src/components/util/DisplayId.js b/packages/desktop-client/src/components/util/DisplayId.js index c6add3f25..c69df0783 100644 --- a/packages/desktop-client/src/components/util/DisplayId.js +++ b/packages/desktop-client/src/components/util/DisplayId.js @@ -1,10 +1,8 @@ -import React, { useMemo, useEffect, useState } from 'react'; +import React from 'react'; import { CachedPayees } from 'loot-core/src/client/data-hooks/payees'; import { CachedAccounts } from 'loot-core/src/client/data-hooks/accounts'; -import { getPayeesById } from 'loot-core/src/client/reducers/queries'; -import { groupById } from 'loot-core/src/shared/util'; import { Text } from 'loot-design/src/components/common'; -import { colors, styles } from 'loot-design/src/style'; +import { colors } from 'loot-design/src/style'; export default function DisplayId({ type, id, noneColor = colors.n8 }) { let DataComponent; diff --git a/packages/desktop-client/src/components/util/GenericInput.js b/packages/desktop-client/src/components/util/GenericInput.js index eba8ff71e..ffefd22be 100644 --- a/packages/desktop-client/src/components/util/GenericInput.js +++ b/packages/desktop-client/src/components/util/GenericInput.js @@ -1,7 +1,6 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { format as formatDate, parse as parseDate, parseISO } from 'date-fns'; -import { dayFromDate, getMonthYearFormat } from 'loot-core/src/shared/months'; +import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { View, Input } from 'loot-design/src/components/common'; import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete'; import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete'; diff --git a/packages/desktop-client/src/hooks/useServerVersion.js b/packages/desktop-client/src/hooks/useServerVersion.js index 96f93d186..3b3f272bf 100644 --- a/packages/desktop-client/src/hooks/useServerVersion.js +++ b/packages/desktop-client/src/hooks/useServerVersion.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { send } from 'loot-core/src/platform/client/fetch'; function useServerVersion() { -- GitLab