refactor: remove unused imports

This commit is contained in:
Tom French 2022-05-07 15:08:23 +01:00 committed by James Long
parent 3e9cfece83
commit d705cd351b
86 changed files with 61 additions and 512 deletions

View file

@ -1,6 +1,6 @@
import { send } from '../../platform/client/fetch'; import { send } from '../../platform/client/fetch';
import constants from '../constants'; import constants from '../constants';
import { getPayees, getAccounts, filterTransactions } from './queries'; import { getPayees, getAccounts } from './queries';
import { addNotification } from './notifications'; import { addNotification } from './notifications';
export function setAccountsSyncing(name) { export function setAccountsSyncing(name) {

View file

@ -1,10 +1,7 @@
import { send } from '../../platform/client/fetch'; import { send } from '../../platform/client/fetch';
import constants from '../constants'; import constants from '../constants';
import { loadPrefs } from './prefs'; import { loadPrefs } from './prefs';
import { createBudget, loadBudget } from './budgets';
import { getCategories, getAccounts, getPayees } from './queries';
import { syncAccounts } from './account'; import { syncAccounts } from './account';
import { setAppState } from './app';
import { pushModal } from './modals'; import { pushModal } from './modals';
import { getUploadError } from '../../shared/errors'; import { getUploadError } from '../../shared/errors';

View file

@ -1,4 +1,3 @@
import constants from '../constants';
import { send } from '../../platform/client/fetch'; import { send } from '../../platform/client/fetch';
import Platform from '../platform'; import Platform from '../platform';
import { pushModal } from './modals'; import { pushModal } from './modals';

View file

@ -1,5 +1,5 @@
import React, { useMemo, useEffect, useState, useContext } from 'react'; import React, { useEffect, useState, useContext } from 'react';
import q, { liveQuery, runQuery } from 'loot-core/src/client/query-helpers'; import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import { getAccountsById } from 'loot-core/src/client/reducers/queries'; import { getAccountsById } from 'loot-core/src/client/reducers/queries';
export function useAccounts() { export function useAccounts() {

View file

@ -1,5 +1,5 @@
import React, { useMemo, useEffect, useState, useContext } from 'react'; import React, { useEffect, useState, useContext } from 'react';
import q, { liveQuery, runQuery } from 'loot-core/src/client/query-helpers'; import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import { getPayeesById } from 'loot-core/src/client/reducers/queries'; import { getPayeesById } from 'loot-core/src/client/reducers/queries';
export function usePayees() { export function usePayees() {

View file

@ -1,11 +1,9 @@
import React, { useMemo, useEffect, useState, useContext } from 'react'; import React, { useEffect, useState, useContext } from 'react';
import * as monthUtils from 'loot-core/src/shared/months';
import { import {
getStatus, getStatus,
getHasTransactionsQuery getHasTransactionsQuery
} from 'loot-core/src/shared/schedules'; } from 'loot-core/src/shared/schedules';
import q, { liveQuery, runQuery } from 'loot-core/src/client/query-helpers'; import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import { send } from 'loot-core/src/platform/client/fetch';
function loadStatuses(schedules, onData) { function loadStatuses(schedules, onData) {
return liveQuery(getHasTransactionsQuery(schedules), onData, { return liveQuery(getHasTransactionsQuery(schedules), onData, {

View file

@ -1,5 +1,5 @@
import { listen, send } from '../platform/client/fetch'; import { listen, send } from '../platform/client/fetch';
import { once, runAgain } from '../shared/async'; import { once } from '../shared/async';
import q, { getPrimaryOrderBy } from '../shared/query'; import q, { getPrimaryOrderBy } from '../shared/query';
export default q; export default q;

View file

@ -1,4 +1,3 @@
import dateFns from 'date-fns';
const uuid = require('../platform/uuid'); const uuid = require('../platform/uuid');
export function generateAccount(balance) { export function generateAccount(balance) {

View file

@ -5,7 +5,6 @@ import * as sheet from '../server/sheet';
import * as rules from '../server/accounts/transaction-rules'; import * as rules from '../server/accounts/transaction-rules';
import * as tracking from '../server/tracking/events'; import * as tracking from '../server/tracking/events';
import { setSyncingMode } from '../server/sync'; import { setSyncingMode } from '../server/sync';
import * as monthUtils from '../shared/months';
import { updateVersion } from '../server/update'; import { updateVersion } from '../server/update';
import { resetTracer, tracer } from '../shared/test-helpers'; import { resetTracer, tracer } from '../shared/test-helpers';
import { import {

View file

@ -4,16 +4,7 @@ require('fake-indexeddb/auto');
let FDBFactory = require('fake-indexeddb/lib/FDBFactory'); let FDBFactory = require('fake-indexeddb/lib/FDBFactory');
let idb = require('../indexeddb'); let idb = require('../indexeddb');
let { let { init, readFile, writeFile, exists, pathToId, join } = require('./index');
init,
populateFileHeirarchy,
readFile,
writeFile,
exists,
pathToId,
listDir,
join
} = require('./index');
beforeAll(() => { beforeAll(() => {
process.env.PUBLIC_URL = process.env.PUBLIC_URL =

View file

@ -1,4 +1,3 @@
import fs from 'fs';
import csvStringify from 'csv-stringify/lib/sync'; import csvStringify from 'csv-stringify/lib/sync';
import { runQuery as aqlQuery } from '../aql/schema/run-query'; import { runQuery as aqlQuery } from '../aql/schema/run-query';
import { integerToAmount } from '../../shared/util'; import { integerToAmount } from '../../shared/util';

View file

@ -7,7 +7,6 @@ import {
isAfter, isAfter,
addDays, addDays,
subDays, subDays,
format as formatDate,
parseDate parseDate
} from '../../shared/months'; } from '../../shared/months';
import { fastSetMerge } from '../../shared/util'; import { fastSetMerge } from '../../shared/util';

View file

@ -1,6 +1,5 @@
import { import {
parseDateString, parseDateString,
parseRecurDate,
rankRules, rankRules,
iterateIds, iterateIds,
Condition, Condition,

View file

@ -1,24 +1,15 @@
import title from './title'; import title from './title';
import * as db from '../db'; import * as db from '../db';
import { import { hasFieldsChanged, amountToInteger } from '../../shared/util';
mergeObjects,
hasFieldsChanged,
toRelaxedNumber,
amountToInteger,
integerToAmount
} from '../../shared/util';
import { import {
makeChild as makeChildTransaction, makeChild as makeChildTransaction,
recalculateSplit recalculateSplit
} from '../../shared/transactions'; } from '../../shared/transactions';
import * as monthUtils from '../../shared/months'; import * as monthUtils from '../../shared/months';
import { transactionModel } from '../api-models';
import { getServer } from '../server-config'; import { getServer } from '../server-config';
import { batchMessages } from '../sync'; import { batchMessages } from '../sync';
import { runMutator } from '../mutators'; import { runMutator } from '../mutators';
import { getStartingBalancePayee } from './payees'; import { getStartingBalancePayee } from './payees';
import * as transfer from './transfer';
import { TransactionError } from '../errors';
import { runRules } from './transaction-rules'; import { runRules } from './transaction-rules';
import { batchUpdateTransactions } from './transactions'; import { batchUpdateTransactions } from './transactions';

View file

@ -17,13 +17,11 @@ import {
sortNumbers, sortNumbers,
getApproxNumberThreshold getApproxNumberThreshold
} from '../../shared/rules'; } from '../../shared/rules';
import q from '../../shared/query';
import { requiredFields, toDateRepr } from '../models'; import { requiredFields, toDateRepr } from '../models';
import { currentDay } from '../../shared/months'; import { currentDay } from '../../shared/months';
import { partitionByField, fastSetMerge } from '../../shared/util'; import { partitionByField, fastSetMerge } from '../../shared/util';
import { setSyncingMode, batchMessages } from '../sync'; import { setSyncingMode, batchMessages } from '../sync';
import { schemaConfig } from '../aql/schema'; import { schemaConfig } from '../aql/schema';
const uuid = require('../../platform/uuid');
// TODO: Detect if it looks like the user is creating a rename rule // TODO: Detect if it looks like the user is creating a rename rule
// and prompt to create it in the pre phase instead // and prompt to create it in the pre phase instead

View file

@ -1,5 +1,4 @@
import * as db from '../db'; import * as db from '../db';
import { Rule } from './rules';
import { import {
getRules, getRules,
loadRules, loadRules,
@ -15,7 +14,6 @@ import {
migrateOldRules migrateOldRules
} from './transaction-rules'; } from './transaction-rules';
import { loadMappings } from '../db/mappings'; import { loadMappings } from '../db/mappings';
import { applyMigration } from '../migrate/migrations';
import { runQuery } from '../aql/schema/run-query'; import { runQuery } from '../aql/schema/run-query';
import q from '../../shared/query'; import q from '../../shared/query';

View file

@ -1,4 +1,3 @@
import * as sheet from '../sheet';
import { batchMessages } from '../sync'; import { batchMessages } from '../sync';
import * as db from '../db'; import * as db from '../db';
import { incrFetch, whereIn } from '../db/util'; import { incrFetch, whereIn } from '../db/util';

View file

@ -1,6 +1,5 @@
import { addTransactions } from './accounts/sync'; import { addTransactions } from './accounts/sync';
import { import {
transactionModel,
accountModel, accountModel,
categoryModel, categoryModel,
categoryGroupModel, categoryGroupModel,
@ -16,17 +15,14 @@ import * as db from './db';
import * as sheet from './sheet'; import * as sheet from './sheet';
import * as prefs from './prefs'; import * as prefs from './prefs';
import * as monthUtils from '../shared/months'; import * as monthUtils from '../shared/months';
import * as update from './update';
import * as cloudStorage from './cloud-storage'; import * as cloudStorage from './cloud-storage';
import { setSyncingMode, batchMessages } from './sync'; import { setSyncingMode, batchMessages } from './sync';
import { groupById, cleanUUID } from '../shared/util';
import { getClock } from './timestamp'; import { getClock } from './timestamp';
import { runMutator } from './mutators'; import { runMutator } from './mutators';
import { integerToAmount } from '../shared/util'; import { integerToAmount } from '../shared/util';
import { runQuery as aqlQuery } from './aql/schema/run-query'; import { runQuery as aqlQuery } from './aql/schema/run-query';
import q from '../shared/query'; import q from '../shared/query';
const { resolveName } = require('./spreadsheet/util');
const connection = require('../platform/server/connection'); const connection = require('../platform/server/connection');
let IMPORT_MODE = false; let IMPORT_MODE = false;

View file

@ -1,6 +1,5 @@
import * as db from '../../db'; import * as db from '../../db';
import { whereIn } from '../../db/util'; import { whereIn } from '../../db/util';
import { groupBy } from '../../../shared/util';
import { isAggregateQuery } from '../compiler'; import { isAggregateQuery } from '../compiler';
import { convertOutputType } from '../schema-helpers'; import { convertOutputType } from '../schema-helpers';
import { execQuery } from '../exec'; import { execQuery } from '../exec';

View file

@ -1,16 +1,12 @@
import fc from 'fast-check'; import fc from 'fast-check';
import * as db from '../../db'; import * as db from '../../db';
import query from '../../../shared/query'; import query from '../../../shared/query';
import { makeChild } from '../../../shared/transactions';
import { batchMessages, setSyncingMode } from '../../sync/index'; import { batchMessages, setSyncingMode } from '../../sync/index';
import { setClock } from '../../timestamp'; import { setClock } from '../../timestamp';
import { groupById } from '../../../shared/util'; import { groupById } from '../../../shared/util';
import arbs from '../../../mocks/arbitrary-schema'; import arbs from '../../../mocks/arbitrary-schema';
import { isAggregateQuery } from '../compiler';
import { runQuery } from './run-query'; import { runQuery } from './run-query';
import { toGroup, isHappyPathQuery } from './executors'; import { isHappyPathQuery } from './executors';
const uuid = require('../../../platform/uuid');
beforeEach(global.emptyDatabase()); beforeEach(global.emptyDatabase());

View file

@ -1,7 +1,6 @@
import * as monthUtils from '../../shared/months'; import * as monthUtils from '../../shared/months';
import * as db from '../db'; import * as db from '../db';
import { batchMessages } from '../sync'; import { batchMessages } from '../sync';
import { groupBySingle } from '../../shared/util';
import * as prefs from '../prefs'; import * as prefs from '../prefs';
import * as sheet from '../sheet'; import * as sheet from '../sheet';

View file

@ -1,5 +1,4 @@
import * as sheet from '../sheet'; import * as sheet from '../sheet';
import * as monthUtils from '../../shared/months';
import { number, sumAmounts } from './util'; import { number, sumAmounts } from './util';
const { resolveName } = require('../spreadsheet/util'); const { resolveName } = require('../spreadsheet/util');

View file

@ -1,5 +1,4 @@
import './polyfills'; import './polyfills';
import { differenceInDays } from 'date-fns';
import asyncStorage from '../platform/server/asyncStorage'; import asyncStorage from '../platform/server/asyncStorage';
import { captureException, captureBreadcrumb } from '../platform/exceptions'; import { captureException, captureBreadcrumb } from '../platform/exceptions';
import * as prefs from './prefs'; import * as prefs from './prefs';

View file

@ -3,8 +3,7 @@ import {
withMigrationsDir, withMigrationsDir,
getAppliedMigrations, getAppliedMigrations,
getMigrationList, getMigrationList,
getPending, getPending
applyMigration
} from './migrations'; } from './migrations';
import * as db from '../db'; import * as db from '../db';

View file

@ -1,5 +1,5 @@
import Platform from './platform'; import Platform from './platform';
const { PostError, HTTPError } = require('./errors'); const { PostError } = require('./errors');
const { fetch } = require('../platform/server/fetch'); const { fetch } = require('../platform/server/fetch');
function throwIfNot200(res, text) { function throwIfNot200(res, text) {

View file

@ -5,8 +5,6 @@ import * as db from '../db';
import * as prefs from '../prefs'; import * as prefs from '../prefs';
import { toDateRepr } from '../models'; import { toDateRepr } from '../models';
import { runQuery as aqlQuery } from '../aql/schema/run-query'; import { runQuery as aqlQuery } from '../aql/schema/run-query';
import { compileQuery } from '../aql/compiler';
import { schema, schemaConfig } from '../aql/schema';
import { dayFromDate, currentDay, parseDate } from '../../shared/months'; import { dayFromDate, currentDay, parseDate } from '../../shared/months';
import q from '../../shared/query'; import q from '../../shared/query';
import { import {

View file

@ -1,4 +1,3 @@
import * as db from '../db';
import { runQuery as aqlQuery } from '../aql/schema/run-query'; import { runQuery as aqlQuery } from '../aql/schema/run-query';
import q from '../../shared/query'; import q from '../../shared/query';
import { loadRules, updateRule } from '../accounts/transaction-rules'; import { loadRules, updateRule } from '../accounts/transaction-rules';
@ -6,7 +5,6 @@ import { loadMappings } from '../db/mappings';
import { import {
updateConditions, updateConditions,
getNextDate, getNextDate,
listSchedules,
createSchedule, createSchedule,
updateSchedule, updateSchedule,
deleteSchedule, deleteSchedule,

View file

@ -7,7 +7,7 @@ import { runQuery as aqlQuery } from '../aql/schema/run-query';
import q from '../../shared/query'; import q from '../../shared/query';
import { getApproxNumberThreshold } from '../../shared/rules'; import { getApproxNumberThreshold } from '../../shared/rules';
import { recurConfigToRSchedule } from '../../shared/schedules'; import { recurConfigToRSchedule } from '../../shared/schedules';
import { dayFromDate, parseDate, subDays } from '../../shared/months'; import { dayFromDate, parseDate } from '../../shared/months';
import { conditionsToAQL } from '../accounts/transaction-rules'; import { conditionsToAQL } from '../accounts/transaction-rules';
const uuid = require('../../platform/uuid'); const uuid = require('../../platform/uuid');

View file

@ -1,5 +1,4 @@
import * as nodes from './nodes'; import * as nodes from './nodes';
const uuid = require('../../../platform/uuid');
let _uid = 0; let _uid = 0;
function resetUid() { function resetUid() {

View file

@ -1,5 +1,5 @@
import { compile, compileBinding } from './compiler'; import { compile } from './compiler';
import { MOV, CALL, QUERY, UOP, BOP, REG1, SP, VAR, JUMPF, JUMPT } from './ops'; import { MOV, CALL, QUERY, UOP, BOP, JUMPF, JUMPT } from './ops';
export default class VM { export default class VM {
constructor(db, scopes) { constructor(db, scopes) {

View file

@ -1,5 +1,4 @@
import { sequential, once } from '../../shared/async'; import { sequential, once } from '../../shared/async';
import * as perf from '../perf';
import * as prefs from '../prefs'; import * as prefs from '../prefs';
import app from '../main-app'; import app from '../main-app';
import asyncStorage from '../../platform/server/asyncStorage'; import asyncStorage from '../../platform/server/asyncStorage';

View file

@ -1,12 +1,11 @@
import fc from 'fast-check'; import fc from 'fast-check';
import * as db from '../db'; import * as db from '../db';
import { migrateParentIds, listen, unlisten } from './migrate'; import { listen, unlisten } from './migrate';
import { addSyncListener, batchMessages, sendMessages } from './index'; import { addSyncListener, sendMessages } from './index';
import { execTracer } from '../../shared/test-helpers'; import { execTracer } from '../../shared/test-helpers';
import { schema, schemaConfig } from '../aql/schema'; import { schema, schemaConfig } from '../aql/schema';
import arbs from '../../mocks/arbitrary-schema'; import arbs from '../../mocks/arbitrary-schema';
import { convertInputType } from '../aql/schema-helpers'; import { convertInputType } from '../aql/schema-helpers';
import { groupBy } from '../../shared/util';
beforeEach(() => { beforeEach(() => {
listen(); listen();

View file

@ -2,13 +2,10 @@ import * as prefs from '../prefs';
import * as db from '../db'; import * as db from '../db';
import * as sheet from '../sheet'; import * as sheet from '../sheet';
import * as sync from './index'; import * as sync from './index';
import Timestamp, { deserializeClock, getClock } from '../timestamp'; import Timestamp, { getClock } from '../timestamp';
import * as merkle from '../merkle'; import * as merkle from '../merkle';
import * as encoder from './encoder'; import * as encoder from './encoder';
const Database = require('better-sqlite3');
const fs = require('fs');
const jsc = require('jsverify'); const jsc = require('jsverify');
const uuid = require('uuid');
const uuidGenerator = jsc const uuidGenerator = jsc
.integer(97, 122) .integer(97, 122)
.smap(x => String.fromCharCode(x), x => x.charCodeAt(x)); .smap(x => String.fromCharCode(x), x => x.charCodeAt(x));

View file

@ -2,13 +2,7 @@ import * as prefs from '../prefs';
import * as db from '../db'; import * as db from '../db';
import * as sheet from '../sheet'; import * as sheet from '../sheet';
import Timestamp, { getClock } from '../timestamp'; import Timestamp, { getClock } from '../timestamp';
import { resolveName } from '../spreadsheet/util'; import { setSyncingMode, sendMessages, applyMessages, fullSync } from './index';
import {
setSyncingMode,
sendMessages,
applyMessages,
fullSync
} from './index';
import * as encoder from './encoder'; import * as encoder from './encoder';
const mockSyncServer = require('../tests/mockSyncServer'); const mockSyncServer = require('../tests/mockSyncServer');

View file

@ -1,4 +1,3 @@
import dateFns from 'date-fns';
import * as merkle from '../merkle'; import * as merkle from '../merkle';
import Timestamp, { makeClock } from '../timestamp'; import Timestamp, { makeClock } from '../timestamp';
const defaultMockData = require('./mockData').basic; const defaultMockData = require('./mockData').basic;

View file

@ -1,4 +1,4 @@
import Timestamp, { setClock, makeClock } from './timestamp'; import Timestamp from './timestamp';
describe('Timestamp', function() { describe('Timestamp', function() {
let now = 0; let now = 0;

View file

@ -1,4 +1,3 @@
import { batchMessages } from '../sync';
import { runMutator } from '../mutators'; import { runMutator } from '../mutators';
import { createApp } from '../app'; import { createApp } from '../app';
import * as db from '../db'; import * as db from '../db';

View file

@ -1,6 +1,4 @@
import asyncStorage from '../../platform/server/asyncStorage';
import { sha256String } from '../encryption-internals'; import { sha256String } from '../encryption-internals';
let uuid = require('../../platform/uuid');
let currentUniqueId; let currentUniqueId;
let mixpanel; let mixpanel;

View file

@ -1,4 +1,4 @@
import { last, diffItems, getChangedValues, applyChanges } from './util'; import { last, diffItems, applyChanges } from './util';
const uuid = require('../platform/uuid'); const uuid = require('../platform/uuid');
// The amount might be null when adding a new transaction // The amount might be null when adding a new transaction

View file

@ -5,7 +5,6 @@ import {
addSplitTransaction, addSplitTransaction,
makeChild makeChild
} from './transactions'; } from './transactions';
import * as db from '../server/db';
const uuid = require('../platform/uuid'); const uuid = require('../platform/uuid');
// const data = { // const data = {

View file

@ -1,4 +1,3 @@
let path = require('path');
let webpack = require('webpack'); let webpack = require('webpack');
let config = require('./webpack.desktop.config'); let config = require('./webpack.desktop.config');

View file

@ -1,7 +1,7 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { View, Text, Select } from './common'; import { View, Text, Select } from './common';
import Autocomplete, { defaultFilterSuggestion } from './Autocomplete'; import Autocomplete, { defaultFilterSuggestion } from './Autocomplete';
import { styles, colors } from '../style'; import { colors } from '../style';
import Split from '../svg/split'; import Split from '../svg/split';
export const NativeCategorySelect = React.forwardRef( export const NativeCategorySelect = React.forwardRef(

View file

@ -7,10 +7,9 @@ import React, {
useMemo useMemo
} from 'react'; } from 'react';
import * as d from 'date-fns'; import * as d from 'date-fns';
import { css } from 'glamor';
import Pikaday from 'pikaday'; import Pikaday from 'pikaday';
import 'pikaday/css/pikaday.css'; import 'pikaday/css/pikaday.css';
import { styles, colors } from '../style'; import { colors } from '../style';
import { View, Input, Tooltip } from './common'; import { View, Input, Tooltip } from './common';
import { import {
getDayMonthFormat, getDayMonthFormat,

View file

@ -1,5 +1,5 @@
import React, { useState, useMemo, useRef } from 'react'; import React, { useState, useMemo, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch } from 'react-redux';
import { getActivePayees } from 'loot-core/src/client/reducers/queries'; import { getActivePayees } from 'loot-core/src/client/reducers/queries';
import { createPayee } from 'loot-core/src/client/actions/queries'; import { createPayee } from 'loot-core/src/client/actions/queries';
import { useCachedPayees } from 'loot-core/src/client/data-hooks/payees'; import { useCachedPayees } from 'loot-core/src/client/data-hooks/payees';

View file

@ -1,8 +1,5 @@
import PropTypes from 'prop-types';
import React, { useEffect, useReducer, useState } from 'react'; import React, { useEffect, useReducer, useState } from 'react';
import * as d from 'date-fns';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { parse as parseDate } from 'date-fns';
import { sendCatch } from 'loot-core/src/platform/client/fetch'; import { sendCatch } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import { getRecurringDescription } from 'loot-core/src/shared/schedules';
@ -16,7 +13,7 @@ import {
Text, Text,
Stack Stack
} from '../components/common'; } from '../components/common';
import { colors, styles } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { useTooltip } from 'loot-design/src/components/tooltips'; import { useTooltip } from 'loot-design/src/components/tooltips';
import SubtractIcon from 'loot-design/src/svg/Subtract'; import SubtractIcon from 'loot-design/src/svg/Subtract';
import AddIcon from 'loot-design/src/svg/Add'; import AddIcon from 'loot-design/src/svg/Add';

View file

@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react'; import React from 'react';
import RecurringSchedulePicker from './RecurringSchedulePicker'; import RecurringSchedulePicker from './RecurringSchedulePicker';
import { Section } from '../guide/components'; import { Section } from '../guide/components';
import { Button, View } from './common'; import { Button, View } from './common';

View file

@ -1,4 +1,4 @@
import React, { useContext, useState, useMemo, useEffect } from 'react'; import React, { useContext, useState, useMemo } from 'react';
import ElementQuery from '../ElementQuery'; import ElementQuery from '../ElementQuery';
import { import {
View, View,

View file

@ -4,7 +4,6 @@ import React, {
useLayoutEffect, useLayoutEffect,
useState, useState,
useCallback, useCallback,
useMemo
} from 'react'; } from 'react';
import { css } from 'glamor'; import { css } from 'glamor';
import mergeRefs from 'react-merge-refs'; import mergeRefs from 'react-merge-refs';
@ -18,7 +17,6 @@ import {
useRouteMatch useRouteMatch
} from 'react-router-dom'; } from 'react-router-dom';
import { import {
Listbox,
ListboxInput, ListboxInput,
ListboxButton, ListboxButton,
ListboxPopover, ListboxPopover,

View file

@ -1,6 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, Text, Modal, Button, ButtonWithLoading } from '../common'; import { View, Text, Modal, ButtonWithLoading } from '../common';
import { styles, colors } from '../../style'; import { colors } from '../../style';
export default function DeleteMenu({ modalProps, actions, file }) { export default function DeleteMenu({ modalProps, actions, file }) {
let [loadingState, setLoadingState] = useState(null); let [loadingState, setLoadingState] = useState(null);

View file

@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, Block, Modal, Button, Link } from '../common'; import { View, Block, Modal, Button } from '../common';
import { styles, colors } from '../../style'; import { styles, colors } from '../../style';
function getErrorMessage(error) { function getErrorMessage(error) {

View file

@ -7,7 +7,6 @@ import {
Modal, Modal,
Button, Button,
ButtonWithLoading, ButtonWithLoading,
Link,
P P
} from '../common'; } from '../common';
import { styles, colors } from '../../style'; import { styles, colors } from '../../style';

View file

@ -7,7 +7,6 @@ import {
Modal, Modal,
ButtonWithLoading, ButtonWithLoading,
Button, Button,
Link,
P, P,
ExternalLink ExternalLink
} from '../common'; } from '../common';

View file

@ -1,5 +1,3 @@
import React from 'react';
export default function InputAccessoryView() { export default function InputAccessoryView() {
return null; return null;
} }

View file

@ -4,7 +4,6 @@ import { MobileScreen } from '../../guide/components';
import { categories, categoryGroups } from './budget.usage'; import { categories, categoryGroups } from './budget.usage';
import { BudgetTable, BudgetAccessoryView } from './budget'; import { BudgetTable, BudgetAccessoryView } from './budget';
import InputAccessoryView from './InputAccessoryView'; import InputAccessoryView from './InputAccessoryView';
import { debugDOM } from 'loot-core/src/mocks/util';
import SpreadsheetContext from '../spreadsheet/SpreadsheetContext'; import SpreadsheetContext from '../spreadsheet/SpreadsheetContext';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import makeSpreadsheet from 'loot-core/src/mocks/spreadsheet'; import makeSpreadsheet from 'loot-core/src/mocks/spreadsheet';

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import { MobileSection } from '../../guide/components'; import { MobileSection } from '../../guide/components';
import { BudgetTable, BudgetHeader, BudgetAccessoryView } from './budget'; import { BudgetTable, BudgetAccessoryView } from './budget';
import InputAccessoryView from './InputAccessoryView'; import InputAccessoryView from './InputAccessoryView';
import { generateCategoryGroups } from 'loot-core/src/mocks'; import { generateCategoryGroups } from 'loot-core/src/mocks';
import SpreadsheetContext from '../spreadsheet/SpreadsheetContext'; import SpreadsheetContext from '../spreadsheet/SpreadsheetContext';

View file

@ -22,7 +22,7 @@ import {
deleteTransaction, deleteTransaction,
realizeTempTransactions realizeTempTransactions
} from 'loot-core/src/shared/transactions'; } from 'loot-core/src/shared/transactions';
import { applyChanges, titleFirst } from 'loot-core/src/shared/util'; import { titleFirst } from 'loot-core/src/shared/util';
import { import {
integerToCurrency, integerToCurrency,
integerToAmount, integerToAmount,
@ -48,9 +48,6 @@ import {
import EditSkull1 from '../../svg/v2/EditSkull1'; import EditSkull1 from '../../svg/v2/EditSkull1';
import AlertTriangle from '../../svg/v2/AlertTriangle'; import AlertTriangle from '../../svg/v2/AlertTriangle';
import CalendarIcon from '../../svg/v2/Calendar';
import ValidationCheck from '../../svg/v2/ValidationCheck';
import FavoriteStar from '../../svg/v2/FavoriteStar';
import CheckCircle1 from '../../svg/v2/CheckCircle1'; import CheckCircle1 from '../../svg/v2/CheckCircle1';
import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize'; import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';

View file

@ -8,7 +8,6 @@ import {
P, P,
Select, Select,
FormError, FormError,
AnchorLink
} from '../common'; } from '../common';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { colors } from '../../style'; import { colors } from '../../style';

View file

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { toRelaxedNumber } from 'loot-core/src/shared/util'; import { toRelaxedNumber } from 'loot-core/src/shared/util';
import { determineOffBudget } from 'loot-core/src/shared/accounts'; import { determineOffBudget } from 'loot-core/src/shared/accounts';
import { styles, colors } from '../../style';
import { import {
View, View,
Modal, Modal,

View file

@ -4,7 +4,7 @@ import { parseISO, format as formatDate, parse as parseDate } from 'date-fns';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { amountToInteger } from 'loot-core/src/shared/util'; import { amountToInteger } from 'loot-core/src/shared/util';
import { currentDay, dayFromDate } from 'loot-core/src/shared/months'; import { currentDay, dayFromDate } from 'loot-core/src/shared/months';
import { View, Modal, Stack, Button, Input } from '../common'; import { View, Modal, Input } from '../common';
import DateSelect from '../DateSelect'; import DateSelect from '../DateSelect';
import CategoryAutocomplete from '../CategorySelect'; import CategoryAutocomplete from '../CategorySelect';
import AccountAutocomplete from '../AccountAutocomplete'; import AccountAutocomplete from '../AccountAutocomplete';

View file

@ -19,7 +19,7 @@ import {
} from '../common'; } from '../common';
import { Checkbox } from '../forms'; import { Checkbox } from '../forms';
import { TableHeader, TableWithNavigator, Row, Field } from '../table'; import { TableHeader, TableWithNavigator, Row, Field } from '../table';
import { SectionLabel, FieldLabel } from '../forms'; import { SectionLabel } from '../forms';
import { colors, styles } from '../../style'; import { colors, styles } from '../../style';
let dateFormats = [ let dateFormats = [

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { View, Text, Block, Modal, Button } from '../common'; import { View, Text, Block, Modal, Button } from '../common';
import { Row, Cell, DeleteCell } from '../table'; import { Row, Cell } from '../table';
import { styles, colors } from '../../style'; import { colors } from '../../style';
class BackupTable extends React.Component { class BackupTable extends React.Component {
state = { hoveredBackup: null }; state = { hoveredBackup: null };

View file

@ -8,7 +8,6 @@ import makeSpreadsheet from 'loot-core/src/mocks/spreadsheet';
import { Sidebar } from './sidebar'; import { Sidebar } from './sidebar';
import { Section } from '../guide/components'; import { Section } from '../guide/components';
import { generateAccount } from 'loot-core/src/mocks'; import { generateAccount } from 'loot-core/src/mocks';
import { colors } from '../style';
function withState(state, render) { function withState(state, render) {
const Component = lively(render, { getInitialState: () => state }); const Component = lively(render, { getInitialState: () => state });

View file

@ -34,7 +34,6 @@ import { keys } from '../util/keys';
import { import {
AvoidRefocusScrollProvider, AvoidRefocusScrollProvider,
useProperFocus, useProperFocus,
focusElement
} from './useProperFocus'; } from './useProperFocus';
import { useSelectedItems } from './useSelected'; import { useSelectedItems } from './useSelected';

View file

@ -1,4 +1,4 @@
import React, { useRef, useCallback } from 'react'; import { useRef, useCallback } from 'react';
export default function useResizeObserver(func) { export default function useResizeObserver(func) {
let observer = useRef(null); let observer = useRef(null);

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Add({ width, height, style, color = "black", ...props }) { function Add({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Bank({ width, height, style, color = "black", ...props }) { function Bank({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Budget({ width, height, style, color = "black", ...props }) { function Budget({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Delete({ width, height, style, color = "black", ...props }) { function Delete({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function DownArrow({ width, height, style, color = "black", ...props }) { function DownArrow({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function DragIos({ width, height, style, color = "black", ...props }) { function DragIos({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function ExpandArrow({ width, height, style, color = "black", ...props }) { function ExpandArrow({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function LeftArrow({ width, height, style, color = "black", ...props }) { function LeftArrow({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function LeftArrow2({ width, height, style, color = "black", ...props }) { function LeftArrow2({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function LeftArrow3({ width, height, style, color = "black", ...props }) { function LeftArrow3({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -4,18 +4,9 @@ import React from "react";
import { import {
Svg, Svg,
Circle, Circle,
Ellipse,
G, G,
LinearGradient, LinearGradient,
RadialGradient,
Line,
Path, Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs, Defs,
Stop Stop
} from "mobile/node_modules/react-native-svg"; } from "mobile/node_modules/react-native-svg";

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Logo({ width, height, style, color = "black", ...props }) { function Logo({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Math({ width, height, style, color = "black", ...props }) { function Math({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Pencil({ width, height, style, color = "black", ...props }) { function Pencil({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,8 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Reports({ width, height, style, color = "black", ...props }) { function Reports({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,8 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Polyline } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function RightArrow({ width, height, style, color = "black", ...props }) { function RightArrow({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function RightArrow2({ width, height, style, color = "black", ...props }) { function RightArrow2({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Search({ width, height, style, color = "black", ...props }) { function Search({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, G, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Settings({ width, height, style, color = "black", ...props }) { function Settings({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Add({ width, height, style, color = "black", ...props }) { function Add({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Merge({ width, height, style, color = "black", ...props }) { function Merge({ width, height, style, color = "black", ...props }) {
return ( return (

View file

@ -1,24 +1,7 @@
/* This file is auto-generated, do not touch! Please edit the SVG file instead. */ /* This file is auto-generated, do not touch! Please edit the SVG file instead. */
import React from "react"; import React from "react";
import { import { Svg, Path } from "mobile/node_modules/react-native-svg";
Svg,
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
Path,
Polygon,
Polyline,
Rect,
Symbol,
Text,
Use,
Defs,
Stop
} from "mobile/node_modules/react-native-svg";
function Split({ width, height, style, color = "black", ...props }) { function Split({ width, height, style, color = "black", ...props }) {
return ( return (