mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 03:32:54 -05:00
[Maintenance] Remove modals.d.ts (#2298)
* Remove modals.d.ts * Release notes * Fix typecheck * Fix lint error
This commit is contained in:
committed by
GitHub
parent
3324dd5fa0
commit
f4d80fad92
@@ -3,12 +3,12 @@ import React, { useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { type PopModalAction } from 'loot-core/src/client/state-types/modals';
|
||||
import { send } from 'loot-core/src/platform/client/fetch';
|
||||
|
||||
import { useActions } from '../hooks/useActions';
|
||||
import { useCategories } from '../hooks/useCategories';
|
||||
import { useSyncServerStatus } from '../hooks/useSyncServerStatus';
|
||||
import { type CommonModalProps } from '../types/modals';
|
||||
|
||||
import { CategoryGroupMenu } from './modals/CategoryGroupMenu';
|
||||
import { CategoryMenu } from './modals/CategoryMenu';
|
||||
@@ -40,6 +40,15 @@ import { PostsOfflineNotification } from './schedules/PostsOfflineNotification';
|
||||
import { ScheduleDetails } from './schedules/ScheduleDetails';
|
||||
import { ScheduleLink } from './schedules/ScheduleLink';
|
||||
|
||||
export type CommonModalProps = {
|
||||
onClose: () => PopModalAction;
|
||||
onBack: () => PopModalAction;
|
||||
showBack: boolean;
|
||||
isCurrent: boolean;
|
||||
isHidden: boolean;
|
||||
stackIndex: number;
|
||||
};
|
||||
|
||||
export function Modals() {
|
||||
const modalStack = useSelector(state => state.modals.modalStack);
|
||||
const isHidden = useSelector(state => state.modals.isHidden);
|
||||
|
||||
@@ -4,11 +4,11 @@ import { type File } from 'loot-core/src/types/file';
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { ButtonWithLoading } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type DeleteFileProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -2,12 +2,12 @@ import React, { useState } from 'react';
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { styles, theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Block } from '../common/Block';
|
||||
import { Button } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
function getErrorMessage(error: 'not-ynab4' | boolean) {
|
||||
switch (error) {
|
||||
|
||||
@@ -9,11 +9,11 @@ import { useCategories } from '../../hooks/useCategories';
|
||||
import { SvgDotsHorizontalTriple, SvgAdd, SvgTrash } from '../../icons/v1';
|
||||
import { SvgNotesPaper, SvgViewHide, SvgViewShow } from '../../icons/v2';
|
||||
import { type CSSProperties, styles, theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { Menu } from '../common/Menu';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { Notes } from '../Notes';
|
||||
import { Tooltip } from '../tooltips';
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import { useCategories } from '../../hooks/useCategories';
|
||||
import { SvgDotsHorizontalTriple, SvgTrash } from '../../icons/v1';
|
||||
import { SvgNotesPaper, SvgViewHide, SvgViewShow } from '../../icons/v2';
|
||||
import { type CSSProperties, styles, theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { Menu } from '../common/Menu';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { Notes } from '../Notes';
|
||||
import { Tooltip } from '../tooltips';
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
|
||||
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
|
||||
import { Button } from '../common/Button';
|
||||
@@ -19,6 +18,7 @@ import { Modal } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
function needsCategory(
|
||||
account: AccountEntity,
|
||||
|
||||
@@ -4,13 +4,13 @@ import React, { useState } from 'react';
|
||||
import { type CategoryGroupEntity } from 'loot-core/src/types/models';
|
||||
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
|
||||
import { Block } from '../common/Block';
|
||||
import { Button } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type ConfirmCategoryDeleteProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// @ts-strict-ignore
|
||||
import React from 'react';
|
||||
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Block } from '../common/Block';
|
||||
import { Button } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type ConfirmTransactionEditProps = {
|
||||
modalProps: Partial<CommonModalProps>;
|
||||
|
||||
@@ -10,13 +10,13 @@ import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus';
|
||||
import { useSimpleFinStatus } from '../../hooks/useSimpleFinStatus';
|
||||
import { type SyncServerStatus } from '../../hooks/useSyncServerStatus';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button, ButtonWithLoading } from '../common/Button';
|
||||
import { ExternalLink } from '../common/ExternalLink';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type CreateAccountProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -8,7 +8,6 @@ import { getCreateKeyError } from 'loot-core/src/shared/errors';
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { ButtonWithLoading } from '../common/Button';
|
||||
import { ExternalLink } from '../common/ExternalLink';
|
||||
import { InitialFocus } from '../common/InitialFocus';
|
||||
@@ -17,6 +16,7 @@ import { Modal, ModalButtons } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type CreateEncryptionKeyProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -6,7 +6,6 @@ import { toRelaxedNumber } from 'loot-core/src/shared/util';
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { useNavigate } from '../../hooks/useNavigate';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { ExternalLink } from '../common/ExternalLink';
|
||||
import { FormError } from '../common/FormError';
|
||||
@@ -17,6 +16,7 @@ import { Modal, ModalButtons } from '../common/Modal';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { Checkbox } from '../forms';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type CreateLocalAccountProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -7,7 +7,6 @@ import { getTestKeyError } from 'loot-core/src/shared/errors';
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button, ButtonWithLoading } from '../common/Button';
|
||||
import { ExternalLink } from '../common/ExternalLink';
|
||||
import { InitialFocus } from '../common/InitialFocus';
|
||||
@@ -16,6 +15,7 @@ import { Modal, ModalButtons } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type FixEncryptionKeyProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -13,7 +13,6 @@ import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus';
|
||||
import { AnimatedLoading } from '../../icons/AnimatedLoading';
|
||||
import { SvgDotsHorizontalTriple } from '../../icons/v1';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Error, Warning } from '../alerts';
|
||||
import { Autocomplete } from '../autocomplete/Autocomplete';
|
||||
import { Button } from '../common/Button';
|
||||
@@ -24,6 +23,7 @@ import { Modal } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { View } from '../common/View';
|
||||
import { FormField, FormLabel } from '../forms';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { Tooltip } from '../tooltips';
|
||||
|
||||
import { COUNTRY_OPTIONS } from './countries';
|
||||
|
||||
@@ -4,9 +4,9 @@ import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { isNonProductionEnvironment } from 'loot-core/src/shared/environment';
|
||||
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { ManageRules } from '../ManageRules';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type ManageRulesModalProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -5,10 +5,10 @@ import { useLiveQuery } from 'loot-core/src/client/query-hooks';
|
||||
import { q } from 'loot-core/src/shared/query';
|
||||
|
||||
import { SvgCheck } from '../../icons/v2';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { Notes as NotesComponent } from '../Notes';
|
||||
|
||||
type NotesProps = {
|
||||
|
||||
@@ -3,13 +3,13 @@ import React, { useState, useRef } from 'react';
|
||||
|
||||
import { AnimatedLoading } from '../../icons/AnimatedLoading';
|
||||
import { theme } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Error } from '../alerts';
|
||||
import { Button } from '../common/Button';
|
||||
import { Modal, ModalButtons } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
function renderError(error) {
|
||||
return (
|
||||
|
||||
@@ -4,12 +4,12 @@ import { sheetForMonth } from 'loot-core/src/shared/months';
|
||||
import * as monthUtils from 'loot-core/src/shared/months';
|
||||
|
||||
import { styles } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { ExpenseTotal } from '../budget/report/budgetsummary/ExpenseTotal';
|
||||
import { IncomeTotal } from '../budget/report/budgetsummary/IncomeTotal';
|
||||
import { Saved } from '../budget/report/budgetsummary/Saved';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Stack } from '../common/Stack';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { NamespaceContext } from '../spreadsheet/NamespaceContext';
|
||||
|
||||
type ReportBudgetSummaryProps = {
|
||||
|
||||
@@ -3,10 +3,10 @@ import React from 'react';
|
||||
import { format, sheetForMonth, prevMonth } from 'loot-core/src/shared/months';
|
||||
|
||||
import { styles } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { ToBudget } from '../budget/rollover/budgetsummary/ToBudget';
|
||||
import { TotalsList } from '../budget/rollover/budgetsummary/TotalsList';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { NamespaceContext } from '../spreadsheet/NamespaceContext';
|
||||
|
||||
type RolloverBudgetSummaryProps = {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { styles } from '../../style';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { FormError } from '../common/FormError';
|
||||
import { InitialFocus } from '../common/InitialFocus';
|
||||
import { Input } from '../common/Input';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type SingleInputProps = {
|
||||
modalProps: Partial<CommonModalProps>;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
import React from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Button } from '../common/Button';
|
||||
import { ExternalLink } from '../common/ExternalLink';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Text } from '../common/Text';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
type SwitchBudgetTypeProps = {
|
||||
modalProps: CommonModalProps;
|
||||
|
||||
@@ -17,12 +17,12 @@ import {
|
||||
} from '../../hooks/useSelected';
|
||||
import { useSendPlatformRequest } from '../../hooks/useSendPlatformRequest';
|
||||
import { theme } from '../../style';
|
||||
import type { CommonModalProps } from '../../types/modals';
|
||||
import { ButtonWithLoading } from '../common/Button';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Paragraph } from '../common/Paragraph';
|
||||
import { Stack } from '../common/Stack';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
import { Table, TableHeader, Row, Field, SelectCell } from '../table';
|
||||
import { DisplayId } from '../util/DisplayId';
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ import { send } from 'loot-core/src/platform/client/fetch';
|
||||
import { type Query } from 'loot-core/src/shared/query';
|
||||
|
||||
import { type BoundActions } from '../../hooks/useActions';
|
||||
import { type CommonModalProps } from '../../types/modals';
|
||||
import { Modal } from '../common/Modal';
|
||||
import { Search } from '../common/Search';
|
||||
import { Text } from '../common/Text';
|
||||
import { View } from '../common/View';
|
||||
import { type CommonModalProps } from '../Modals';
|
||||
|
||||
import { ROW_HEIGHT, SchedulesTable } from './SchedulesTable';
|
||||
|
||||
|
||||
10
packages/desktop-client/src/types/modals.d.ts
vendored
10
packages/desktop-client/src/types/modals.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
import { type PopModalAction } from 'loot-core/src/client/state-types/modals';
|
||||
|
||||
export type CommonModalProps = {
|
||||
onClose: () => PopModalAction;
|
||||
onBack: () => PopModalAction;
|
||||
showBack: boolean;
|
||||
isCurrent: boolean;
|
||||
isHidden: boolean;
|
||||
stackIndex: number;
|
||||
};
|
||||
6
upcoming-release-notes/2298.md
Normal file
6
upcoming-release-notes/2298.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [joel-jeremy]
|
||||
---
|
||||
|
||||
Remove modals.d.ts file
|
||||
Reference in New Issue
Block a user