diff --git a/packages/desktop-client/src/components/App.js b/packages/desktop-client/src/components/App.js index ae132e31a8ce0559c91281d89f5b815047b4b918..228038652f730da59a368617be29205ca588adf9 100644 --- a/packages/desktop-client/src/components/App.js +++ b/packages/desktop-client/src/components/App.js @@ -6,8 +6,8 @@ import { init as initConnection, send } from 'loot-core/src/platform/client/fetch'; -import installPolyfills from '../polyfills'; import { styles, hasHiddenScrollbars } from 'loot-design/src/style'; +import installPolyfills from '../polyfills'; import FatalError from './FatalError'; import ManagementApp from './manager/ManagementApp'; import FinancesApp from './FinancesApp'; diff --git a/packages/desktop-client/src/components/AppBackground.js b/packages/desktop-client/src/components/AppBackground.js index f4ab15c68c7ad5247bdcf25c3f72fa7f7f70a463..f01ff69079a0ba46e632646dd8f10afbd5ec1bc5 100644 --- a/packages/desktop-client/src/components/AppBackground.js +++ b/packages/desktop-client/src/components/AppBackground.js @@ -1,9 +1,9 @@ -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'; import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading'; import { colors } from 'loot-design/src/style'; +import Background from './Background'; function AppBackground({ initializing, loadingText }) { return ( diff --git a/packages/desktop-client/src/components/BankSyncStatus.js b/packages/desktop-client/src/components/BankSyncStatus.js index 4ea6531f4817bbb7fa0e1b4cdc18f365162b3e72..dddc3fcb11209e38144957238a9cf7b9aa7e1a6e 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 e91d931af64c3467ec6a7d6b9c7287f57facd82d..770ab6b77ccb4cbbd205611c973b004f88098c00 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/FinancesApp.js b/packages/desktop-client/src/components/FinancesApp.js index 4f2be90d7c889d64d69f49da0442d379f136b76e..f28507d190072a5f977e2262b5e453bfd05ebec1 100644 --- a/packages/desktop-client/src/components/FinancesApp.js +++ b/packages/desktop-client/src/components/FinancesApp.js @@ -10,15 +10,15 @@ import { SpreadsheetProvider } from 'loot-core/src/client/SpreadsheetProvider'; import checkForUpgradeNotifications from 'loot-core/src/client/upgrade-notifications'; import { colors } from 'loot-design/src/style'; import { View } from 'loot-design/src/components/common'; -import BankSyncStatus from './BankSyncStatus'; import { BudgetMonthCountProvider } from 'loot-design/src/components/budget/BudgetMonthCountContext'; import * as undo from 'loot-core/src/platform/client/undo'; -import { PageTypeProvider } from './Page'; -import { getLocationState } from '../util/location-state'; -import { ActiveLocationProvider } from './ActiveLocation'; -import { makeLocationState } from '../util/location-state'; import { PayeesProvider } from 'loot-core/src/client/data-hooks/payees'; import { AccountsProvider } from 'loot-core/src/client/data-hooks/accounts'; +import { getLocationState } from '../util/location-state'; +import { makeLocationState } from '../util/location-state'; +import { PageTypeProvider } from './Page'; +import { ActiveLocationProvider } from './ActiveLocation'; +import BankSyncStatus from './BankSyncStatus'; import Titlebar, { TitlebarProvider } from './Titlebar'; import FloatableSidebar, { SidebarProvider } from './FloatableSidebar'; diff --git a/packages/desktop-client/src/components/LoggedInUser.js b/packages/desktop-client/src/components/LoggedInUser.js index 2a33e6e4ba7d3e2c4ba7b357396fbcf18b444947..46d472fe19641a6fe6d17ee91719151db7f5e803 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 6b66a155b75fd821176a4a0ca604656a8cb478e5..5e756bbb3887345081ca2036a684ee89f7acb64f 100644 --- a/packages/desktop-client/src/components/Modals.js +++ b/packages/desktop-client/src/components/Modals.js @@ -6,25 +6,24 @@ 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'; import CloseAccount from 'loot-design/src/components/modals/CloseAccount'; import SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts'; import ConfigureLinkedAccounts from 'loot-design/src/components/modals/ConfigureLinkedAccounts'; import LoadBackup from 'loot-design/src/components/modals/LoadBackup'; +import PlaidExternalMsg from 'loot-design/src/components/modals/PlaidExternalMsg'; +import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions'; +import EditField from 'loot-design/src/components/modals/EditField'; +import CreateAccount from './modals/CreateAccount'; import ManagePayeesWithData from './payees/ManagePayeesWithData'; import ManageRules from './modals/ManageRules'; import EditRule from './modals/EditRule'; import MergeUnusedPayees from './modals/MergeUnusedPayees'; -import PlaidExternalMsg from 'loot-design/src/components/modals/PlaidExternalMsg'; import ConfirmCategoryDelete from './modals/ConfirmCategoryDelete'; import WelcomeScreen from './modals/WelcomeScreen'; -import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions'; import CreateEncryptionKey from './modals/CreateEncryptionKey'; import FixEncryptionKey from './modals/FixEncryptionKey'; -import EditField from 'loot-design/src/components/modals/EditField'; function Modals({ history, diff --git a/packages/desktop-client/src/components/Page.js b/packages/desktop-client/src/components/Page.js index 7a717a6907bfbae085da9f2bc28d70fb5bb28763..757993df028cdc0ed62190d79c5c527f8219c16d 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 29ad3974eb8860f7c21d98afbd0485f1d3ee48d6..e9c9a68cfda3ae084031a0389136ed3bdce102cb 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 d1d21af6748968696d2e3978a95e8b335619986d..eeaa5e23ebad3144b6a3f3ff7c3e33da3baf10da 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 ac9b80acb7bfccc98943c45904c1fd71df0e6906..856ddc6336f57be1cb162df7342f8647fc163041 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 a9409c42b2a619ca6da782cc7e8219a8c22979e1..12563a78f1553e74707b28b46452c317ae94f491 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 c6a4fa0ffd48426ad566735f46e9b9eea1b93e78..b96d5a92a8f665784413c087b4b8b07063cfafa3 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'; @@ -22,11 +16,11 @@ import { P } from 'loot-design/src/components/common'; import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue'; -import { MonthCountSelector } from './budget/MonthCountSelector'; import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1'; import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu'; import ArrowLeft from 'loot-design/src/svg/v1/ArrowLeft'; import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle'; +import { MonthCountSelector } from './budget/MonthCountSelector'; import AccountSyncCheck from './accounts/AccountSyncCheck'; import LoggedInUser from './LoggedInUser'; import AnimatedRefresh from './AnimatedRefresh'; diff --git a/packages/desktop-client/src/components/Tutorial.js b/packages/desktop-client/src/components/Tutorial.js index 7c525c7804f1bc37fad688beb48257b8998f7106..aeaa4e364cf3e2d3fb6fdac6952463e23cac4a51 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 0f248f38c3286e5962b413cb331f3230256b088e..91ed03ac4c5be6138c5a7aac8600fa8a10db9081 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 09a4dd1b4171c62707189673821a5533fba30172..a2af5e840541c700b80d508a78f2ef3c3064310a 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 e17fd8a97962b217b0e11a6a0b31990927a0dc82..9702010a52cc9b8f12e790d5c9447946f1ada5db 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,55 +21,47 @@ 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'; import DownloadThickBottom from 'loot-design/src/svg/v2/DownloadThickBottom'; -import AnimatedRefresh from '../AnimatedRefresh'; import Add from 'loot-design/src/svg/v1/Add'; 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, ungroupTransactions } from 'loot-core/src/shared/transactions'; -import { - SplitsExpandedProvider, - useSplitsExpanded, - isPreviewId -} from './TransactionsTable'; import { styles, colors } from 'loot-design/src/style'; -import TransactionList from './TransactionList'; -import { authorizeBank } from '../../plaid'; 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 { authorizeBank } from '../../plaid'; +import AnimatedRefresh from '../AnimatedRefresh'; import { useActiveLocation } from '../ActiveLocation'; +import { FilterButton, AppliedFilters } from './Filters'; +import TransactionList from './TransactionList'; +import { + SplitsExpandedProvider, + useSplitsExpanded, + isPreviewId +} from './TransactionsTable'; function EmptyMessage({ onAdd }) { return ( diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js index e41e499d04d755ee9f8f06bc4047191d0c6cb0a1..d32311ede8cddc9b7ec9dcb3064eff25595e738a 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 1ac95080504b239f70b8f0eb396a3f3c04e5ee6e..e39a9cdeb474e282d8ac722af9e2f25ee09277fd 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'; @@ -31,9 +30,9 @@ import { } from 'loot-core/src/shared/rules'; import DeleteIcon from 'loot-design/src/svg/Delete'; import SettingsSliderAlternate from 'loot-design/src/svg/v2/SettingsSliderAlternate'; +import { colors } from 'loot-design/src/style'; import GenericInput from '../util/GenericInput'; import { Value } from '../modals/ManageRules'; -import { styles, 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 722687c5a155c8eb7bd292e2145111dddeb69ae3..ea841924f10fd8148ade9b91b5ea66e77ed3d01f 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 7776037f1fc11ca7297d1a1f7f941443680e4c2f..a07c31f80302b3e18518c81e48167d738d9c02f7 100644 --- a/packages/desktop-client/src/components/accounts/TransactionList.js +++ b/packages/desktop-client/src/components/accounts/TransactionList.js @@ -1,13 +1,5 @@ -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,8 +8,8 @@ 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'; +import { TransactionTable } from './TransactionsTable'; const uuid = require('loot-core/src/platform/uuid'); // When data changes, there are two ways to update the UI: diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.js b/packages/desktop-client/src/components/accounts/TransactionsTable.js index d1613abd7f68b2dca90319b3abc619ce2671a15d..9b678e7f1ee8531fec563cc4e6d832151193acd4 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,18 +54,16 @@ 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'; import { getScheduledAmount } from 'loot-core/src/shared/schedules'; +import { getStatusProps } from '../schedules/StatusBadge'; let TABLE_BACKGROUND_COLOR = colors.n11; diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js index 75b37c7fc7ffeeb5e2cb0de8604391d559afa4ed..eb4a9f341a0307db0552876218a1177dc8b61301 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 1dba1dbaa324546e36ba4c37b994d9134c032caf..ce9082014f860239bbc53d17bac54a9f0fdd9222 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 0bea00942b9bd1e26d62c8f1aeda5a79a8bd2710..b1d862d1d9c57332161cd1da4abb88a067fef270 100644 --- a/packages/desktop-client/src/components/budget/index.js +++ b/packages/desktop-client/src/components/budget/index.js @@ -1,14 +1,9 @@ -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'; import { getValidMonthBounds } from 'loot-design/src/components/budget/MonthsContext'; -import { TitlebarContext } from '../Titlebar'; import * as rollover from 'loot-design/src/components/budget/rollover/rollover-components'; import { RolloverContext } from 'loot-design/src/components/budget/rollover/RolloverContext'; @@ -19,7 +14,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, @@ -30,6 +25,7 @@ import { updateGroup, deleteGroup } from 'loot-core/src/shared/categories.js'; +import { TitlebarContext } from '../Titlebar'; let _initialBudgetMonth = null; diff --git a/packages/desktop-client/src/components/manager/ConfigServer.js b/packages/desktop-client/src/components/manager/ConfigServer.js index 5a4687c61c7e4365ed48d4c3105f7507c5536d2f..b9380b04fff85bb6d222143af8421635536d8507 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 cc737890c7743e0fa31c164240fc987453683f20..7d574c788e263ae7c1362cb0f90f5980e08929b9 100644 --- a/packages/desktop-client/src/components/manager/ManagementApp.js +++ b/packages/desktop-client/src/components/manager/ManagementApp.js @@ -2,13 +2,13 @@ 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'; -import ServerURL from './ServerURL'; import LoggedInUser from '../LoggedInUser'; import Notifications from '../Notifications'; +import useServerVersion from '../../hooks/useServerVersion'; +import ServerURL from './ServerURL'; import Modals from './Modals'; import Login from './subscribe/Login'; @@ -16,7 +16,6 @@ import Bootstrap from './subscribe/Bootstrap'; import Error from './subscribe/Error'; import ChangePassword from './subscribe/ChangePassword'; import ConfigServer from './ConfigServer'; -import useServerVersion from '../../hooks/useServerVersion'; function Version() { const version = useServerVersion(); diff --git a/packages/desktop-client/src/components/manager/Modals.js b/packages/desktop-client/src/components/manager/Modals.js index 2d6b120d59a9ca9b7c94cda0824ce2a295fecd84..e45b1ecf19e1b52d3047640eeaaf96d25bee41b0 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 ca2ab6b40e56e99cdb800a12b3d2b8bb55f1d0d2..c1ba72ff996477488b7abe9a45d8db81dc700eb6 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 9fd32d062e8ae412aa9c16ef10fa978d02783d45..534c90c090cec424ee8fbe9a66b3f55e8c08b9b9 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 5509c683b11d4d6b334a07e7ec5e415b59e6b7a8..60daf23528024558a94fd7918cbf396c2a96c598 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 3f00ecadc140b90af6e795e53678cafe4ee57f88..c71f7a5ad1585a8e73298c82df891e999edb90e2 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 b3794e5705d070015bc16c020dc82623924cbd0a..8de45a9b188320af0abad960fa010bfa386b9961 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 af15b7a90d8290d5ea209d2a84785006b837361a..76befa85aebac1041e5f6a963602ed1bbf9a1d1f 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 b874edd1635b491b2278b702a6aebc0fc29c843d..4c5a25cf6c2524cc23ea5348baca0f6226ca0893 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 58c0c413936ee47b74d3895841eeaf26794fb686..dd315a86bb7beff98b88d953872fd77078f252b5 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 fd487414df66000c8612492478dea0aad2452b5f..1930d2f3641469b510218d4a54b3f057380f56b6 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 069327737929c14ce30ca0f76335c58126a47a51..c26de879418f642d19e1b55c2ec74d3274bf874b 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 4bad393a6bdb7bc3af95796ca58f4875202ece2c..c55c2c353ded078519fcb78b882f3774b67ad99b 100644 --- a/packages/desktop-client/src/components/modals/EditRule.js +++ b/packages/desktop-client/src/components/modals/EditRule.js @@ -1,28 +1,21 @@ 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'; @@ -39,9 +32,6 @@ import { import useSelected, { SelectedProvider } from 'loot-design/src/components/useSelected'; -import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; -import { StatusBadge } from '../schedules/StatusBadge'; -import DisplayId from '../util/DisplayId'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { integerToCurrency, @@ -49,6 +39,10 @@ import { amountToInteger } from 'loot-core/src/shared/util'; import * as monthUtils from 'loot-core/src/shared/months'; +import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; +import { StatusBadge } from '../schedules/StatusBadge'; +import DisplayId from '../util/DisplayId'; +import GenericInput from '../util/GenericInput'; import { BetweenAmountInput } from '../util/AmountInput'; function updateValue(array, value, update) { diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKey.js b/packages/desktop-client/src/components/modals/FixEncryptionKey.js index 79210854bb47daa66d61bc85aecfa7db02be4015..c9c43caf315422792c9830d3c10b282548ff9e3e 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 496d3062e9bc0c1c5a532385a899cc03a4fcfcb8..61f89bb3e41aa4314e379ea6046d997d5ce1fefe 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 e5de4f6d071257b83fb0aef2e0686c641158abdf..58920d022af29fb76af5ec03788c2c0f4bcaf399 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 bc2094db6e6d6a012ddc61ac9164ab3738682245..8cab2fe616f69560e268c6cfacad737cb604f0eb 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 9d5bc8f210a5cca427832c4a08b2b9fdf2e2f47f..c80927f9f0953bb5e8bc1878f98bed5d5e3b03a6 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 555bca909c9559db3d6b4bd49bf64ecc4e4bf624..45b3ee4beeb7004273bc4ad61116a7ed643baba1 100644 --- a/packages/desktop-client/src/components/reports/CashFlow.js +++ b/packages/desktop-client/src/components/reports/CashFlow.js @@ -11,14 +11,13 @@ 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 { colors } from 'loot-design/src/style'; import Header from './Header'; import Change from './Change'; import CashFlowGraph from './graphs/CashFlowGraph'; import { cashFlowByDate } from './graphs/cash-flow-spreadsheet'; import useReport from './useReport'; import { useArgsMemo } from './util'; -import { colors } from 'loot-design/src/style'; function CashFlow() { const [earliestMonth, setEarliestMonth] = useState(null); diff --git a/packages/desktop-client/src/components/reports/Header.js b/packages/desktop-client/src/components/reports/Header.js index 4ebee44bb144510cf8ae0c6b44df570d0dbc6045..a73c9e83685d0ba5d883da55f5ce7cfb309c0422 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/CashFlowGraph.js b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js index 725ae019f220d55f77854fbfe91ea476d75c3418..ea050ab54ed52aeb9758adc327e592e49022db47 100644 --- a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js +++ b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js @@ -8,10 +8,10 @@ import { VictoryGroup } from 'victory'; import * as d from 'date-fns'; +import { colors } from 'loot-design/src/style'; import Container from '../Container'; import Tooltip from '../Tooltip'; import theme from '../chart-theme'; -import { colors } from 'loot-design/src/style'; function CashFlowGraph({ style, start, end, graphData, isConcise, compact }) { return ( 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 5324da703124a6574a84a8e710ef8685a17e15da..7c09f2b3a6b4b1403f739cda3630a77bf928c113 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 ec171db6c1358ce732fb9d82e79ddd9c6f200e99..5c297ca410140cb7cb81377575b9f0ddb52ac4e4 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 d448dd9d409af2b4fcc943767ca6432dbc35eaf9..ae2602cfc505999b6bc78cae32392c022045bb94 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,19 +15,18 @@ 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, SelectedProvider } from 'loot-design/src/components/useSelected'; import { Page } from '../Page'; -import { ScheduleAmountCell } from './SchedulesTable'; import DisplayId from '../util/DisplayId'; +import { ScheduleAmountCell } from './SchedulesTable'; let ROW_HEIGHT = 43; diff --git a/packages/desktop-client/src/components/schedules/EditSchedule.js b/packages/desktop-client/src/components/schedules/EditSchedule.js index c91d179a6d8b7fa4f4476ba65b3771aaf8894e9d..0e25e3b078089bc05720618c0c33a93ed8690118 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,31 +12,21 @@ 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'; -import { usePageType } from '../Page'; -import { Page } from '../Page'; import useSelected, { SelectedProvider } from 'loot-design/src/components/useSelected'; +import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker'; +import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; +import { usePageType } from '../Page'; +import { Page } from '../Page'; 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'; function mergeFields(defaults, initial) { let res = { ...defaults }; diff --git a/packages/desktop-client/src/components/schedules/LinkSchedule.js b/packages/desktop-client/src/components/schedules/LinkSchedule.js index bea6fcd806a27b90c71de42ccf47bf84918a5b6d..1daa056ef939f533a9bd62592acf37bc62d9916d 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 2369f51d849133c863c2cf3e0e368f0133b00ab1..2d7cdcd787e9463cce3ed2c00db278ca1d3cf940 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 { colors } from 'loot-design/src/style'; import { Page } from '../Page'; -import { SchedulesTable } from './SchedulesTable'; import DisplayId from '../util/DisplayId'; -import { colors, styles } 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 f77d45e91ad442c93b5a8a7b73e42d5cc209762f..fa2a3391a759343d8c065b250fbdd3a2979dee23 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 db5d2a8a1424efdc055ea0c99cbab49ec6b3d53f..ede1a8ce06bd417f770ee227ee21f343b245d631 100644 --- a/packages/desktop-client/src/components/schedules/index.js +++ b/packages/desktop-client/src/components/schedules/index.js @@ -1,16 +1,9 @@ -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'; +import { Page } from '../Page'; import { SchedulesTable, ROW_HEIGHT } from './SchedulesTable'; export default function Schedules() { diff --git a/packages/desktop-client/src/components/tools/FixSplitsTool.js b/packages/desktop-client/src/components/tools/FixSplitsTool.js index 1d3cbf68c8cc4883f58f78c81a19f649f66d6565..15e50262a8e235105fb501fc2677f1ff54d36172 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 e2b223ce36fd8f2d3d3450f742077ec0ffd9747a..3efb8de24b446ff52cd37c7fc8ab0547f0aefbe3 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 { colors } from 'loot-design/src/style'; import Navigation from './Navigation'; -import { styles, 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 4e1b577b6292cbfde3c2354bd5d1a8f4882b3a3d..55d5bf2247e28354885738bf9369f91c514d9b97 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 b0c327c03baa0bbdac86624be038072c791fd7f7..ff1bf88e73009ea1de80be6f7dc488c864ba180c 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 { colors } from 'loot-design/src/style'; import Navigation from './Navigation'; -import { styles, 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 089ac9be920ebbe7016302a73b44cc953c48e83a..7e36c493fdc4662cfb6cdb410aa1b932267a1bcb 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 b1820013df0beb49117d90b8c415a2be081d7347..0a3e4ab3a2d67284c50d55f3307f304e6455d9dd 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 { colors } from 'loot-design/src/style'; import Navigation from './Navigation'; -import { styles, 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 5a3da2235ef1fe3f507e23976aa3c2a79d0c6dcb..ff99329b73c450dada40d34a1f192db1dd1a5d88 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 b15f39aaf92e31579eb8cb69f4a2028a15a38906..b432a7168d1d528062e74266e5b76ec51e8fb385 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 4550432c6b6ff3fdc614f992ffc88c0daeed3f17..91d8a70d78faf5e5b444dae1833e7c91c8fb486e 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 d426ec5e8847878077274302e65701a372819049..2bab2fbf2a507ef4a2b2e10e8c601aecf28d0f1e 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 68f4188670d8091a43e84dfca3eae0c339bb94b3..26b9a3c4a8101c565c956f271dcf8c2e990ec19d 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 99738c3ef48acad04d19ac83ec0bfb093c37645d..5f2e9b04826ad1cdd9998663dcdf7ed80d108168 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 { colors } from 'loot-design/src/style'; import Navigation from './Navigation'; -import { styles, 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 77da1790c97ebcf72f38e2e109eea6d456f162f8..f06ecc1722f2e99e1422663a2b4e19774c3f8872 100644 --- a/packages/desktop-client/src/components/tutorial/TransactionEnter.js +++ b/packages/desktop-client/src/components/tutorial/TransactionEnter.js @@ -1,8 +1,7 @@ import React from 'react'; -import { View, Tooltip, Pointer, P } from 'loot-design/src/components/common'; -import Navigation from './Navigation'; -import { styles, colors } from 'loot-design/src/style'; +import { P } from 'loot-design/src/components/common'; import * as monthUtils from 'loot-core/src/shared/months'; +import Navigation from './Navigation'; import { Standalone, Title } from './common'; function TransactionEnter({ fromYNAB, navigationProps }) { diff --git a/packages/desktop-client/src/components/tutorial/TransactionFinalize.js b/packages/desktop-client/src/components/tutorial/TransactionFinalize.js index 0a27f7fca0b740b022c1347043ed151f2d38ea1c..266e583ab3e0786c9f1d0f13541cc1f71d65f1ac 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/tutorial/common.js b/packages/desktop-client/src/components/tutorial/common.js index 71f6bd3aa5b748dbfeeb1b97492f3c18cee2c8d4..8ec1f69062200d12d8d446e0b53fc84302924491 100644 --- a/packages/desktop-client/src/components/tutorial/common.js +++ b/packages/desktop-client/src/components/tutorial/common.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { View, AnchorLink } from 'loot-design/src/components/common'; -import AnimateIn from './AnimateIn'; import { colors } from 'loot-design/src/style'; +import AnimateIn from './AnimateIn'; export function Title({ children }) { return ( diff --git a/packages/desktop-client/src/components/util/DisplayId.js b/packages/desktop-client/src/components/util/DisplayId.js index c6add3f25432d4d87675870f224785b481910934..c69df078361f3cbe031a2f036c666bf171cfa8d9 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 eba8ff71ee3d0e7b19d98f11bd968d671fe95970..ffefd22be9ef6fcfd15ef7f2333a2102e8c11b47 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 96f93d1864ec543b180bbf7ae9678eab5b8267b5..3b3f272bf2023c56ad99b24e87d6c12dfdfc0131 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() { diff --git a/packages/desktop-client/src/index.js b/packages/desktop-client/src/index.js index 14597ab124f1ce1355500ae181823f1a39370d67..2134f6d9880a285a2e8df3b46f7a56d6f81bd1d8 100644 --- a/packages/desktop-client/src/index.js +++ b/packages/desktop-client/src/index.js @@ -7,7 +7,6 @@ import '@reach/listbox/styles.css'; import React from 'react'; import ReactDOM from 'react-dom'; -import App from './components/App'; import { createStore, combineReducers, @@ -21,8 +20,9 @@ import { send } from 'loot-core/src/platform/client/fetch'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import * as actions from 'loot-core/src/client/actions'; import thunk from 'redux-thunk'; -import { handleGlobalEvents } from './global-events'; import { initialState as initialAppState } from 'loot-core/src/client/reducers/app'; +import { handleGlobalEvents } from './global-events'; +import App from './components/App'; // See https://github.com/WICG/focus-visible. Only makes the blue // focus outline appear from keyboard events.