From edf179dc16dfdaa2c798830637fc0a384cb70253 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Thu, 4 Jan 2024 10:16:47 -0800 Subject: [PATCH] ESLint no default exports 7 --- .eslintrc.js | 6 +-- .../src/components/Titlebar.tsx | 2 +- .../src/components/accounts/Account.jsx | 2 +- .../components/accounts/AccountSyncCheck.jsx | 2 +- .../src/components/accounts/MobileAccount.jsx | 4 +- .../accounts/MobileAccountDetails.jsx | 2 +- .../components/accounts/MobileAccounts.jsx | 2 +- .../autocomplete/AccountAutocomplete.tsx | 4 +- .../components/autocomplete/Autocomplete.tsx | 2 +- .../autocomplete/CategoryAutocomplete.tsx | 4 +- .../autocomplete/PayeeAutocomplete.tsx | 5 ++- .../autocomplete/SavedFilterAutocomplete.tsx | 4 +- .../budget/BalanceWithCarryover.tsx | 2 +- .../components/budget/BudgetCategories.jsx | 18 ++++----- .../components/budget/BudgetPageHeader.tsx | 4 +- .../src/components/budget/BudgetSummaries.tsx | 8 ++-- .../src/components/budget/BudgetTable.jsx | 10 ++--- .../src/components/budget/BudgetTotals.tsx | 6 +-- .../components/budget/DynamicBudgetTable.tsx | 37 ++++++++++--------- .../src/components/budget/ExpenseCategory.tsx | 8 ++-- .../src/components/budget/ExpenseGroup.tsx | 8 ++-- .../src/components/budget/IncomeCategory.tsx | 8 ++-- .../src/components/budget/IncomeGroup.tsx | 8 ++-- .../src/components/budget/IncomeHeader.tsx | 9 +++-- .../src/components/budget/MobileBudget.jsx | 6 +-- .../components/budget/MobileBudgetTable.jsx | 6 +-- .../src/components/budget/RenderMonths.tsx | 4 +- .../src/components/budget/SidebarCategory.tsx | 4 +- .../src/components/budget/SidebarGroup.tsx | 4 +- .../src/components/budget/index.tsx | 8 ++-- .../budget/report/BalanceTooltip.tsx | 2 +- .../budget/report/ReportComponents.tsx | 6 +-- .../report/budgetsummary/BudgetSummary.tsx | 8 ++-- .../report/budgetsummary/BudgetTotal.tsx | 2 +- .../report/budgetsummary/ExpenseProgress.tsx | 4 +- .../report/budgetsummary/ExpenseTotal.tsx | 4 +- .../report/budgetsummary/IncomeProgress.tsx | 9 ++--- .../report/budgetsummary/IncomeTotal.tsx | 6 +-- .../report/budgetsummary/PieProgress.tsx | 2 +- .../budget/report/budgetsummary/Saved.tsx | 2 +- .../budget/report/budgetsummary/fraction.ts | 2 +- .../budget/rollover/BalanceTooltip.tsx | 6 +-- .../budget/rollover/CoverTooltip.tsx | 4 +- .../budget/rollover/HoldTooltip.tsx | 2 +- .../budget/rollover/RolloverComponents.tsx | 6 +-- .../budget/rollover/TransferTooltip.tsx | 4 +- .../rollover/budgetsummary/BudgetSummary.tsx | 6 +-- .../rollover/budgetsummary/ToBudget.tsx | 8 ++-- .../rollover/budgetsummary/TotalsList.tsx | 2 +- .../src/components/modals/CloseAccount.tsx | 4 +- .../modals/ConfirmCategoryDelete.tsx | 2 +- .../src/components/modals/EditField.jsx | 9 +++-- .../modals/GoCardlessExternalMsg.tsx | 2 +- .../components/modals/ReportBudgetSummary.tsx | 6 +-- .../modals/RolloverBudgetSummary.tsx | 4 +- .../modals/SelectLinkedAccounts.jsx | 2 +- .../src/components/responsive/narrow.ts | 6 +-- .../src/components/responsive/wide.ts | 6 +-- .../src/components/schedules/EditSchedule.jsx | 4 +- .../transactions/TransactionsTable.jsx | 6 +-- .../src/components/util/GenericInput.jsx | 10 ++--- 61 files changed, 161 insertions(+), 182 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 042e1b72d6a..d3bc83bb308 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -246,9 +246,9 @@ module.exports = { './packages/crdt/**/*', './packages/desktop-client/src/*', './packages/desktop-client/src/components/*', - // './packages/desktop-client/src/components/accounts/**/*', - // './packages/desktop-client/src/components/autocomplete/**/*', - // './packages/desktop-client/src/components/budget/**/*', + './packages/desktop-client/src/components/accounts/**/*', + './packages/desktop-client/src/components/autocomplete/**/*', + './packages/desktop-client/src/components/budget/**/*', './packages/desktop-client/src/components/common/**/*', // './packages/desktop-client/src/components/filters/**/*', // './packages/desktop-client/src/components/gocardless/**/*', diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index c48ffe91b04..331bbc65e8a 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -25,7 +25,7 @@ import ViewShow from '../icons/v2/ViewShow'; import { useResponsive } from '../ResponsiveProvider'; import { theme, type CSSProperties, styles } from '../style'; -import AccountSyncCheck from './accounts/AccountSyncCheck'; +import { AccountSyncCheck } from './accounts/AccountSyncCheck'; import { AnimatedRefresh } from './AnimatedRefresh'; import { MonthCountSelector } from './budget/MonthCountSelector'; import { Button, ButtonWithLoading } from './common/Button'; diff --git a/packages/desktop-client/src/components/accounts/Account.jsx b/packages/desktop-client/src/components/accounts/Account.jsx index b55eac1e366..1c3689ac39b 100644 --- a/packages/desktop-client/src/components/accounts/Account.jsx +++ b/packages/desktop-client/src/components/accounts/Account.jsx @@ -1473,7 +1473,7 @@ function AccountHack(props) { ); } -export default function Account() { +export function Account() { const params = useParams(); const location = useLocation(); diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.jsx b/packages/desktop-client/src/components/accounts/AccountSyncCheck.jsx index d494675c67c..8507f75f766 100644 --- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.jsx +++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.jsx @@ -48,7 +48,7 @@ function getErrorMessage(type, code) { ); } -export default function AccountSyncCheck() { +export function AccountSyncCheck() { const accounts = useSelector(state => state.queries.accounts); const failedAccounts = useSelector(state => state.account.failedAccounts); const { unlinkAccount, pushModal } = useActions(); diff --git a/packages/desktop-client/src/components/accounts/MobileAccount.jsx b/packages/desktop-client/src/components/accounts/MobileAccount.jsx index 837764310ba..5eccb0e32f5 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccount.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccount.jsx @@ -24,7 +24,7 @@ import useNavigate from '../../hooks/useNavigate'; import { useSetThemeColor } from '../../hooks/useSetThemeColor'; import { theme } from '../../style'; -import AccountDetails from './MobileAccountDetails'; +import { AccountDetails } from './MobileAccountDetails'; const getSchedulesTransform = memoizeOne((id, hasSearch) => { let filter = queries.getAccountFilter(id, '_account'); @@ -68,7 +68,7 @@ function PreviewTransactions({ accountId, children }) { let paged; -export default function Account(props) { +export function Account(props) { const accounts = useSelector(state => state.queries.accounts); const navigate = useNavigate(); diff --git a/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx b/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx index 6cca3bc472b..0a5c329632b 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccountDetails.jsx @@ -61,7 +61,7 @@ function TransactionSearchInput({ accountName, onSearch }) { ); } -export default function AccountDetails({ +export function AccountDetails({ account, prependTransactions, transactions, diff --git a/packages/desktop-client/src/components/accounts/MobileAccounts.jsx b/packages/desktop-client/src/components/accounts/MobileAccounts.jsx index cd9212752f1..1f3edd629c9 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccounts.jsx +++ b/packages/desktop-client/src/components/accounts/MobileAccounts.jsx @@ -215,7 +215,7 @@ function AccountList({ ); } -export default function Accounts() { +export function Accounts() { const accounts = useSelector(state => state.queries.accounts); const newTransactions = useSelector(state => state.queries.newTransactions); const updatedAccounts = useSelector(state => state.queries.updatedAccounts); diff --git a/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx index ceedfd6311a..2cc9d25dab8 100644 --- a/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx @@ -9,7 +9,7 @@ import { useResponsive } from '../../ResponsiveProvider'; import { type CSSProperties, theme } from '../../style'; import { View } from '../common/View'; -import Autocomplete from './Autocomplete'; +import { Autocomplete } from './Autocomplete'; function AccountList({ items, @@ -77,7 +77,7 @@ type AccountAutoCompleteProps = { closeOnBlur?: boolean; } & ComponentProps; -export default function AccountAutocomplete({ +export function AccountAutocomplete({ embedded, includeClosedAccounts = true, renderAccountItemGroupHeader, diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx index 786c9a79cce..7f64805e373 100644 --- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx @@ -728,7 +728,7 @@ function isMultiAutocomplete( return multi; } -export default function Autocomplete({ +export function Autocomplete({ multi, ...props }: AutocompleteProps & { multi?: boolean }) { diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx index b2a62865653..b87520bdeba 100644 --- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx @@ -20,7 +20,7 @@ import { type CSSProperties, theme } from '../../style'; import { Text } from '../common/Text'; import { View } from '../common/View'; -import Autocomplete, { defaultFilterSuggestion } from './Autocomplete'; +import { Autocomplete, defaultFilterSuggestion } from './Autocomplete'; export type CategoryListProps = { items: Array; @@ -107,7 +107,7 @@ type CategoryAutocompleteProps = ComponentProps & { renderCategoryItem?: (props: CategoryItemProps) => ReactNode; }; -export default function CategoryAutocomplete({ +export function CategoryAutocomplete({ categoryGroups, showSplitOption, embedded, diff --git a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx index 5eb50a6392f..b3665a45d60 100644 --- a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx @@ -26,7 +26,8 @@ import { type CSSProperties, theme } from '../../style'; import { Button } from '../common/Button'; import { View } from '../common/View'; -import Autocomplete, { +import { + Autocomplete, defaultFilterSuggestion, AutocompleteFooter, } from './Autocomplete'; @@ -167,7 +168,7 @@ type PayeeAutocompleteProps = { payees?: PayeeEntity[]; }; -export default function PayeeAutocomplete({ +export function PayeeAutocomplete({ value, inputProps, showMakeTransfer = true, diff --git a/packages/desktop-client/src/components/autocomplete/SavedFilterAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/SavedFilterAutocomplete.tsx index 84f4a1163b9..a82ab2b2201 100644 --- a/packages/desktop-client/src/components/autocomplete/SavedFilterAutocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/SavedFilterAutocomplete.tsx @@ -6,7 +6,7 @@ import { type TransactionFilterEntity } from 'loot-core/src/types/models'; import { theme } from '../../style'; import { View } from '../common/View'; -import Autocomplete from './Autocomplete'; +import { Autocomplete } from './Autocomplete'; type FilterListProps = { items: T[]; @@ -60,7 +60,7 @@ type SavedFilterAutocompleteProps = { embedded?: boolean; } & ComponentProps>; -export default function SavedFilterAutocomplete({ +export function SavedFilterAutocomplete({ embedded, ...props }: SavedFilterAutocompleteProps) { diff --git a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx index d6866c36190..efe06864148 100644 --- a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx +++ b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx @@ -19,7 +19,7 @@ type BalanceWithCarryoverProps = { balanceStyle?: CSSProperties; carryoverStyle?: CSSProperties; }; -export default function BalanceWithCarryover({ +export function BalanceWithCarryover({ carryover, balance, goal, diff --git a/packages/desktop-client/src/components/budget/BudgetCategories.jsx b/packages/desktop-client/src/components/budget/BudgetCategories.jsx index ae1f82d1197..a223fea97e7 100644 --- a/packages/desktop-client/src/components/budget/BudgetCategories.jsx +++ b/packages/desktop-client/src/components/budget/BudgetCategories.jsx @@ -5,16 +5,16 @@ import { View } from '../common/View'; import { DropHighlightPosContext } from '../sort'; import { Row } from '../table'; -import ExpenseCategory from './ExpenseCategory'; -import ExpenseGroup from './ExpenseGroup'; -import IncomeCategory from './IncomeCategory'; -import IncomeGroup from './IncomeGroup'; -import IncomeHeader from './IncomeHeader'; -import SidebarCategory from './SidebarCategory'; -import SidebarGroup from './SidebarGroup'; +import { ExpenseCategory } from './ExpenseCategory'; +import { ExpenseGroup } from './ExpenseGroup'; +import { IncomeCategory } from './IncomeCategory'; +import { IncomeGroup } from './IncomeGroup'; +import { IncomeHeader } from './IncomeHeader'; +import { SidebarCategory } from './SidebarCategory'; +import { SidebarGroup } from './SidebarGroup'; import { separateGroups } from './util'; -const BudgetCategories = memo( +export const BudgetCategories = memo( ({ categoryGroups, newCategoryForGroup, @@ -313,5 +313,3 @@ const BudgetCategories = memo( ); }, ); - -export default BudgetCategories; diff --git a/packages/desktop-client/src/components/budget/BudgetPageHeader.tsx b/packages/desktop-client/src/components/budget/BudgetPageHeader.tsx index 62bd4aeaa6b..881aa892e80 100644 --- a/packages/desktop-client/src/components/budget/BudgetPageHeader.tsx +++ b/packages/desktop-client/src/components/budget/BudgetPageHeader.tsx @@ -14,7 +14,7 @@ type BudgetPageHeaderProps = { monthBounds: ComponentProps['monthBounds']; }; -const BudgetPageHeader = memo( +export const BudgetPageHeader = memo( ({ startMonth, onMonthSelect, numMonths, monthBounds }) => { function getValidMonth(month) { const start = monthBounds.start; @@ -43,5 +43,3 @@ const BudgetPageHeader = memo( ); }, ); - -export default BudgetPageHeader; diff --git a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx index 37ebe1d010f..3975b131b12 100644 --- a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx +++ b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx @@ -15,16 +15,14 @@ import useResizeObserver from '../../hooks/useResizeObserver'; import { View } from '../common/View'; import { MonthsContext } from './MonthsContext'; -import type ReportBudgetSummary from './report/budgetsummary/BudgetSummary'; -import type RolloverBudgetSummary from './rollover/budgetsummary/BudgetSummary'; +import { type BudgetSummary as ReportBudgetSummary } from './report/budgetsummary/BudgetSummary'; +import { type BudgetSummary as RolloverBudgetSummary } from './rollover/budgetsummary/BudgetSummary'; type BudgetSummariesProps = { SummaryComponent: typeof ReportBudgetSummary | typeof RolloverBudgetSummary; }; -export default function BudgetSummaries({ - SummaryComponent, -}: BudgetSummariesProps) { +export function BudgetSummaries({ SummaryComponent }: BudgetSummariesProps) { const { months } = useContext(MonthsContext); const [widthState, setWidthState] = useState(0); diff --git a/packages/desktop-client/src/components/budget/BudgetTable.jsx b/packages/desktop-client/src/components/budget/BudgetTable.jsx index a30d02c317c..3000ebb1af4 100644 --- a/packages/desktop-client/src/components/budget/BudgetTable.jsx +++ b/packages/desktop-client/src/components/budget/BudgetTable.jsx @@ -6,13 +6,13 @@ import { theme, styles } from '../../style'; import { View } from '../common/View'; import { IntersectionBoundary } from '../tooltips'; -import BudgetCategories from './BudgetCategories'; -import BudgetSummaries from './BudgetSummaries'; -import BudgetTotals from './BudgetTotals'; +import { BudgetCategories } from './BudgetCategories'; +import { BudgetSummaries } from './BudgetSummaries'; +import { BudgetTotals } from './BudgetTotals'; import { MonthsProvider } from './MonthsContext'; import { findSortDown, findSortUp, getScrollbarWidth } from './util'; -class BudgetTable extends Component { +export class BudgetTable extends Component { constructor(props) { super(props); this.budgetCategoriesRef = createRef(); @@ -285,5 +285,3 @@ class BudgetTable extends Component { ); } } - -export default BudgetTable; diff --git a/packages/desktop-client/src/components/budget/BudgetTotals.tsx b/packages/desktop-client/src/components/budget/BudgetTotals.tsx index 8d59c50cc00..27dd4b2da5e 100644 --- a/packages/desktop-client/src/components/budget/BudgetTotals.tsx +++ b/packages/desktop-client/src/components/budget/BudgetTotals.tsx @@ -7,7 +7,7 @@ import { Menu } from '../common/Menu'; import { View } from '../common/View'; import { Tooltip } from '../tooltips'; -import RenderMonths from './RenderMonths'; +import { RenderMonths } from './RenderMonths'; import { getScrollbarWidth } from './util'; type BudgetTotalsProps = { @@ -17,7 +17,7 @@ type BudgetTotalsProps = { collapseAllCategories: () => void; }; -const BudgetTotals = memo(function BudgetTotals({ +export const BudgetTotals = memo(function BudgetTotals({ MonthComponent, toggleHiddenCategories, expandAllCategories, @@ -109,5 +109,3 @@ const BudgetTotals = memo(function BudgetTotals({ ); }); - -export default BudgetTotals; diff --git a/packages/desktop-client/src/components/budget/DynamicBudgetTable.tsx b/packages/desktop-client/src/components/budget/DynamicBudgetTable.tsx index 360271855ad..a8655a5e4b0 100644 --- a/packages/desktop-client/src/components/budget/DynamicBudgetTable.tsx +++ b/packages/desktop-client/src/components/budget/DynamicBudgetTable.tsx @@ -6,8 +6,8 @@ import { useActions } from '../../hooks/useActions'; import { View } from '../common/View'; import { useBudgetMonthCount } from './BudgetMonthCountContext'; -import BudgetPageHeader from './BudgetPageHeader'; -import BudgetTable from './BudgetTable'; +import { BudgetPageHeader } from './BudgetPageHeader'; +import { BudgetTable } from './BudgetTable'; function getNumPossibleMonths(width: number) { const estimatedTableWidth = width - 200; @@ -100,19 +100,20 @@ const DynamicBudgetTableInner = forwardRef< }, ); -export default forwardRef( - (props, ref) => { - return ( - - {({ width, height }) => ( - - )} - - ); - }, -); +export const DynamicBudgetTable = forwardRef< + BudgetTable, + DynamicBudgetTableInnerProps +>((props, ref) => { + return ( + + {({ width, height }) => ( + + )} + + ); +}); diff --git a/packages/desktop-client/src/components/budget/ExpenseCategory.tsx b/packages/desktop-client/src/components/budget/ExpenseCategory.tsx index b24e7ee57b6..462fb7d88ec 100644 --- a/packages/desktop-client/src/components/budget/ExpenseCategory.tsx +++ b/packages/desktop-client/src/components/budget/ExpenseCategory.tsx @@ -14,8 +14,8 @@ import { } from '../sort'; import { Row } from '../table'; -import RenderMonths from './RenderMonths'; -import SidebarCategory from './SidebarCategory'; +import { RenderMonths } from './RenderMonths'; +import { SidebarCategory } from './SidebarCategory'; type ExpenseCategoryProps = { cat: CategoryEntity; @@ -32,7 +32,7 @@ type ExpenseCategoryProps = { onReorder: OnDropCallback; }; -function ExpenseCategory({ +export function ExpenseCategory({ cat, editingCell, dragState, @@ -108,5 +108,3 @@ function ExpenseCategory({ ); } - -export default ExpenseCategory; diff --git a/packages/desktop-client/src/components/budget/ExpenseGroup.tsx b/packages/desktop-client/src/components/budget/ExpenseGroup.tsx index 4c6b5ac7e9a..049a46032c6 100644 --- a/packages/desktop-client/src/components/budget/ExpenseGroup.tsx +++ b/packages/desktop-client/src/components/budget/ExpenseGroup.tsx @@ -12,8 +12,8 @@ import { } from '../sort'; import { Row, ROW_HEIGHT } from '../table'; -import RenderMonths from './RenderMonths'; -import SidebarGroup from './SidebarGroup'; +import { RenderMonths } from './RenderMonths'; +import { SidebarGroup } from './SidebarGroup'; type ExpenseGroupProps = { group: ComponentProps['group']; @@ -33,7 +33,7 @@ type ExpenseGroupProps = { onShowNewCategory?: ComponentProps['onShowNewCategory']; }; -function ExpenseGroup({ +export function ExpenseGroup({ group, collapsed, editingCell, @@ -131,5 +131,3 @@ function ExpenseGroup({ ); } - -export default ExpenseGroup; diff --git a/packages/desktop-client/src/components/budget/IncomeCategory.tsx b/packages/desktop-client/src/components/budget/IncomeCategory.tsx index 0d5625186da..d03e0b1307e 100644 --- a/packages/desktop-client/src/components/budget/IncomeCategory.tsx +++ b/packages/desktop-client/src/components/budget/IncomeCategory.tsx @@ -11,8 +11,8 @@ import { } from '../sort'; import { Row } from '../table'; -import RenderMonths from './RenderMonths'; -import SidebarCategory from './SidebarCategory'; +import { RenderMonths } from './RenderMonths'; +import { SidebarCategory } from './SidebarCategory'; type IncomeCategoryProps = { cat: CategoryEntity; @@ -29,7 +29,7 @@ type IncomeCategoryProps = { onShowActivity: (name: string, id: string, idx: number) => void; }; -function IncomeCategory({ +export function IncomeCategory({ cat, isLast, editingCell, @@ -89,5 +89,3 @@ function IncomeCategory({ ); } - -export default IncomeCategory; diff --git a/packages/desktop-client/src/components/budget/IncomeGroup.tsx b/packages/desktop-client/src/components/budget/IncomeGroup.tsx index e3bd787f83e..5ae414ec64b 100644 --- a/packages/desktop-client/src/components/budget/IncomeGroup.tsx +++ b/packages/desktop-client/src/components/budget/IncomeGroup.tsx @@ -3,8 +3,8 @@ import React from 'react'; import { theme } from '../../style'; import { Row } from '../table'; -import RenderMonths from './RenderMonths'; -import SidebarGroup from './SidebarGroup'; +import { RenderMonths } from './RenderMonths'; +import { SidebarGroup } from './SidebarGroup'; type IncomeGroupProps = { group: { @@ -25,7 +25,7 @@ type IncomeGroupProps = { onShowNewCategory: (groupId: string) => void; }; -function IncomeGroup({ +export function IncomeGroup({ group, editingCell, collapsed, @@ -60,5 +60,3 @@ function IncomeGroup({ ); } - -export default IncomeGroup; diff --git a/packages/desktop-client/src/components/budget/IncomeHeader.tsx b/packages/desktop-client/src/components/budget/IncomeHeader.tsx index 5d663a92521..344a3f9d9d8 100644 --- a/packages/desktop-client/src/components/budget/IncomeHeader.tsx +++ b/packages/desktop-client/src/components/budget/IncomeHeader.tsx @@ -3,14 +3,17 @@ import React from 'react'; import { Button } from '../common/Button'; import { View } from '../common/View'; -import RenderMonths from './RenderMonths'; +import { RenderMonths } from './RenderMonths'; type IncomeHeaderProps = { MonthComponent?: () => JSX.Element; onShowNewGroup: () => void; }; -function IncomeHeader({ MonthComponent, onShowNewGroup }: IncomeHeaderProps) { +export function IncomeHeader({ + MonthComponent, + onShowNewGroup, +}: IncomeHeaderProps) { return ( ); } - -export default IncomeHeader; diff --git a/packages/desktop-client/src/components/budget/MobileBudget.jsx b/packages/desktop-client/src/components/budget/MobileBudget.jsx index fa4d3eccd2c..9fb1e98122c 100644 --- a/packages/desktop-client/src/components/budget/MobileBudget.jsx +++ b/packages/desktop-client/src/components/budget/MobileBudget.jsx @@ -19,7 +19,7 @@ import { prewarmMonth, switchBudgetType } from './util'; const CATEGORY_BUDGET_EDIT_ACTION = 'category-budget'; const BALANCE_MENU_OPEN_ACTION = 'balance-menu'; -class Budget extends Component { +class BudgetInner extends Component { constructor(props) { super(props); @@ -456,7 +456,7 @@ class Budget extends Component { } } -export default function BudgetWrapper() { +export function Budget() { const { list: categories, grouped: categoryGroups } = useCategories(); const budgetType = useSelector( state => state.prefs.local.budgetType || 'rollover', @@ -467,7 +467,7 @@ export default function BudgetWrapper() { const spreadsheet = useSpreadsheet(); useSetThemeColor(theme.mobileViewTheme); return ( - void; }; -function SidebarCategory({ +export function SidebarCategory({ innerRef, category, dragPreview, @@ -178,5 +178,3 @@ function SidebarCategory({ ); } - -export default SidebarCategory; diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.tsx b/packages/desktop-client/src/components/budget/SidebarGroup.tsx index 03d99b6eac4..d574befd790 100644 --- a/packages/desktop-client/src/components/budget/SidebarGroup.tsx +++ b/packages/desktop-client/src/components/budget/SidebarGroup.tsx @@ -36,7 +36,7 @@ type SidebarGroupProps = { onToggleCollapse?: (id: string) => void; }; -function SidebarGroup({ +export function SidebarGroup({ group, editing, collapsed, @@ -204,5 +204,3 @@ function SidebarGroup({ ); } - -export default SidebarGroup; diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx index 1b35a2115a9..eb9916d4456 100644 --- a/packages/desktop-client/src/components/budget/index.tsx +++ b/packages/desktop-client/src/components/budget/index.tsx @@ -43,7 +43,7 @@ import { type TitlebarMessage, } from '../Titlebar'; -import DynamicBudgetTable from './DynamicBudgetTable'; +import { DynamicBudgetTable } from './DynamicBudgetTable'; import * as report from './report/ReportComponents'; import { ReportProvider } from './report/ReportContext'; import * as rollover from './rollover/RolloverComponents'; @@ -100,7 +100,7 @@ type BudgetProps = { addNotification: BoundActions['addNotification']; }; -function Budget(props: BudgetProps) { +function BudgetInner(props: BudgetProps) { const currentMonth = monthUtils.currentMonth(); const tableRef = useRef(null); @@ -532,7 +532,7 @@ const RolloverBudgetSummary = memo<{ month: string }>(props => { ); }); -export default function BudgetWrapper(props) { +export function Budget(props) { const startMonth = useSelector( state => state.prefs.local['budget.startMonth'], ); @@ -594,7 +594,7 @@ export default function BudgetWrapper(props) { overflow: 'hidden', }} > - void; }; -export default function BalanceTooltip({ +export function BalanceTooltip({ categoryId, tooltip, monthIndex, diff --git a/packages/desktop-client/src/components/budget/report/ReportComponents.tsx b/packages/desktop-client/src/components/budget/report/ReportComponents.tsx index 23e597f6dcd..a6cbe390ecb 100644 --- a/packages/desktop-client/src/components/budget/report/ReportComponents.tsx +++ b/packages/desktop-client/src/components/budget/report/ReportComponents.tsx @@ -15,10 +15,10 @@ import CellValue from '../../spreadsheet/CellValue'; import useFormat from '../../spreadsheet/useFormat'; import { Field, SheetCell } from '../../table'; import { Tooltip, useTooltip } from '../../tooltips'; -import BalanceWithCarryover from '../BalanceWithCarryover'; +import { BalanceWithCarryover } from '../BalanceWithCarryover'; import { makeAmountGrey } from '../util'; -import BalanceTooltip from './BalanceTooltip'; +import { BalanceTooltip } from './BalanceTooltip'; const headerLabelStyle: CSSProperties = { flex: 1, @@ -344,7 +344,7 @@ export const CategoryMonth = memo(function CategoryMonth({ ); }); -export { default as BudgetSummary } from './budgetsummary/BudgetSummary'; +export { BudgetSummary } from './budgetsummary/BudgetSummary'; export const ExpenseGroupMonth = GroupMonth; export const ExpenseCategoryMonth = CategoryMonth; diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx index d07f9e2c154..d17f15deb40 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetSummary.tsx @@ -18,14 +18,14 @@ import NamespaceContext from '../../../spreadsheet/NamespaceContext'; import { Tooltip } from '../../../tooltips'; import { useReport } from '../ReportContext'; -import ExpenseTotal from './ExpenseTotal'; -import IncomeTotal from './IncomeTotal'; -import Saved from './Saved'; +import { ExpenseTotal } from './ExpenseTotal'; +import { IncomeTotal } from './IncomeTotal'; +import { Saved } from './Saved'; type BudgetSummaryProps = { month?: string; }; -export default function BudgetSummary({ month }: BudgetSummaryProps) { +export function BudgetSummary({ month }: BudgetSummaryProps) { const { currentMonth, summaryCollapsed: collapsed, diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetTotal.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetTotal.tsx index 72a14bfcf0d..7adc3781b39 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetTotal.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/BudgetTotal.tsx @@ -17,7 +17,7 @@ type BudgetTotalProps = { ProgressComponent: ComponentType<{ current; target }>; style?: CSSProperties; }; -export default function BudgetTotal({ +export function BudgetTotal({ title, current, target, diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseProgress.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseProgress.tsx index 4613c957606..afa4cf12ced 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseProgress.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseProgress.tsx @@ -4,8 +4,8 @@ import { theme } from '../../../../style'; import type CellValue from '../../../spreadsheet/CellValue'; import useSheetValue from '../../../spreadsheet/useSheetValue'; -import fraction from './fraction'; -import PieProgress from './PieProgress'; +import { fraction } from './fraction'; +import { PieProgress } from './PieProgress'; type ExpenseProgressProps = { current: ComponentProps['binding']; diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseTotal.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseTotal.tsx index 3188c48bf3d..cd64acafa22 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseTotal.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/ExpenseTotal.tsx @@ -4,13 +4,13 @@ import { reportBudget } from 'loot-core/src/client/queries'; import { type CSSProperties } from '../../../../style'; -import BudgetTotal from './BudgetTotal'; +import { BudgetTotal } from './BudgetTotal'; import { ExpenseProgress } from './ExpenseProgress'; type ExpenseTotalProps = { style?: CSSProperties; }; -export default function ExpenseTotal({ style }: ExpenseTotalProps) { +export function ExpenseTotal({ style }: ExpenseTotalProps) { return ( ['binding']; target: ComponentProps['binding']; }; -export default function IncomeProgress({ - current, - target, -}: IncomeProgressProps) { +export function IncomeProgress({ current, target }: IncomeProgressProps) { let totalIncome = useSheetValue(current) || 0; const totalBudgeted = useSheetValue(target) || 0; diff --git a/packages/desktop-client/src/components/budget/report/budgetsummary/IncomeTotal.tsx b/packages/desktop-client/src/components/budget/report/budgetsummary/IncomeTotal.tsx index 26f9fc88399..5d41c5cb512 100644 --- a/packages/desktop-client/src/components/budget/report/budgetsummary/IncomeTotal.tsx +++ b/packages/desktop-client/src/components/budget/report/budgetsummary/IncomeTotal.tsx @@ -4,13 +4,13 @@ import { reportBudget } from 'loot-core/src/client/queries'; import { type CSSProperties } from '../../../../style'; -import BudgetTotal from './BudgetTotal'; -import IncomeProgress from './IncomeProgress'; +import { BudgetTotal } from './BudgetTotal'; +import { IncomeProgress } from './IncomeProgress'; type IncomeTotalProps = { style?: CSSProperties; }; -export default function IncomeTotal({ style }: IncomeTotalProps) { +export function IncomeTotal({ style }: IncomeTotalProps) { return ( 0) { return 1; diff --git a/packages/desktop-client/src/components/budget/rollover/BalanceTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/BalanceTooltip.tsx index 1df4d380638..d8f53712fdf 100644 --- a/packages/desktop-client/src/components/budget/rollover/BalanceTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/BalanceTooltip.tsx @@ -6,8 +6,8 @@ import { Menu } from '../../common/Menu'; import useSheetValue from '../../spreadsheet/useSheetValue'; import { Tooltip } from '../../tooltips'; -import CoverTooltip from './CoverTooltip'; -import TransferTooltip from './TransferTooltip'; +import { CoverTooltip } from './CoverTooltip'; +import { TransferTooltip } from './TransferTooltip'; type BalanceTooltipProps = { categoryId: string; @@ -16,7 +16,7 @@ type BalanceTooltipProps = { onBudgetAction: (idx: number, action: string, arg?: unknown) => void; onClose?: () => void; }; -export default function BalanceTooltip({ +export function BalanceTooltip({ categoryId, tooltip, monthIndex, diff --git a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx index 6cddacc5ee8..ebdecc7dc84 100644 --- a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx @@ -1,7 +1,7 @@ import React, { type ComponentProps, useState } from 'react'; import useCategories from '../../../hooks/useCategories'; -import CategoryAutocomplete from '../../autocomplete/CategoryAutocomplete'; +import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete'; import { Button } from '../../common/Button'; import { InitialFocus } from '../../common/InitialFocus'; import { View } from '../../common/View'; @@ -13,7 +13,7 @@ type CoverTooltipProps = { onSubmit: (category: unknown) => void; onClose: () => void; }; -export default function CoverTooltip({ +export function CoverTooltip({ tooltipProps, onSubmit, onClose, diff --git a/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx index 1417aa9d552..a2bbf282d45 100644 --- a/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/HoldTooltip.tsx @@ -20,7 +20,7 @@ import { Tooltip } from '../../tooltips'; type HoldTooltipProps = ComponentPropsWithoutRef & { onSubmit: (amount: number) => void; }; -export default function HoldTooltip({ +export function HoldTooltip({ onSubmit, onClose, position = 'bottom-right', diff --git a/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx b/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx index f08e5bfcda3..4515ccd3a23 100644 --- a/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx +++ b/packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx @@ -15,10 +15,10 @@ import CellValue from '../../spreadsheet/CellValue'; import useFormat from '../../spreadsheet/useFormat'; import { Row, Field, SheetCell } from '../../table'; import { Tooltip, useTooltip } from '../../tooltips'; -import BalanceWithCarryover from '../BalanceWithCarryover'; +import { BalanceWithCarryover } from '../BalanceWithCarryover'; import { makeAmountGrey } from '../util'; -import BalanceTooltip from './BalanceTooltip'; +import { BalanceTooltip } from './BalanceTooltip'; const headerLabelStyle: CSSProperties = { flex: 1, @@ -402,4 +402,4 @@ export function IncomeCategoryMonth({ ); } -export { default as BudgetSummary } from './budgetsummary/BudgetSummary'; +export { BudgetSummary } from './budgetsummary/BudgetSummary'; diff --git a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx index 18a6f239197..8e34a1abb7f 100644 --- a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx @@ -10,7 +10,7 @@ import evalArithmetic from 'loot-core/src/shared/arithmetic'; import { integerToCurrency, amountToInteger } from 'loot-core/src/shared/util'; import useCategories from '../../../hooks/useCategories'; -import CategoryAutocomplete from '../../autocomplete/CategoryAutocomplete'; +import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete'; import { Button } from '../../common/Button'; import { InitialFocus } from '../../common/InitialFocus'; import { Input } from '../../common/Input'; @@ -25,7 +25,7 @@ type TransferTooltipProps = ComponentPropsWithoutRef & { showToBeBudgeted?: boolean; onSubmit: (amount: number, category: unknown) => void; }; -export default function TransferTooltip({ +export function TransferTooltip({ initialAmount, initialAmountName, showToBeBudgeted, diff --git a/packages/desktop-client/src/components/budget/rollover/budgetsummary/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/rollover/budgetsummary/BudgetSummary.tsx index bbc9d97f6f1..084f99ef0c5 100644 --- a/packages/desktop-client/src/components/budget/rollover/budgetsummary/BudgetSummary.tsx +++ b/packages/desktop-client/src/components/budget/rollover/budgetsummary/BudgetSummary.tsx @@ -16,14 +16,14 @@ import NamespaceContext from '../../../spreadsheet/NamespaceContext'; import { Tooltip } from '../../../tooltips'; import { useRollover } from '../RolloverContext'; -import ToBudget from './ToBudget'; -import TotalsList from './TotalsList'; +import { ToBudget } from './ToBudget'; +import { TotalsList } from './TotalsList'; type BudgetSummaryProps = { month: string; isGoalTemplatesEnabled?: boolean; }; -export default function BudgetSummary({ +export function BudgetSummary({ month, isGoalTemplatesEnabled, }: BudgetSummaryProps) { diff --git a/packages/desktop-client/src/components/budget/rollover/budgetsummary/ToBudget.tsx b/packages/desktop-client/src/components/budget/rollover/budgetsummary/ToBudget.tsx index b2081d39827..6f9adc1b006 100644 --- a/packages/desktop-client/src/components/budget/rollover/budgetsummary/ToBudget.tsx +++ b/packages/desktop-client/src/components/budget/rollover/budgetsummary/ToBudget.tsx @@ -14,10 +14,10 @@ import useFormat from '../../../spreadsheet/useFormat'; import useSheetName from '../../../spreadsheet/useSheetName'; import useSheetValue from '../../../spreadsheet/useSheetValue'; import { Tooltip } from '../../../tooltips'; -import HoldTooltip from '../HoldTooltip'; -import TransferTooltip from '../TransferTooltip'; +import { HoldTooltip } from '../HoldTooltip'; +import { TransferTooltip } from '../TransferTooltip'; -import TotalsList from './TotalsList'; +import { TotalsList } from './TotalsList'; type ToBudgetProps = { month: string | number; @@ -31,7 +31,7 @@ type ToBudgetProps = { holdTooltipProps?: ComponentPropsWithoutRef; transferTooltipProps?: ComponentPropsWithoutRef; }; -export default function ToBudget({ +export function ToBudget({ month, prevMonthName, showTotalsTooltipOnHover, diff --git a/packages/desktop-client/src/components/budget/rollover/budgetsummary/TotalsList.tsx b/packages/desktop-client/src/components/budget/rollover/budgetsummary/TotalsList.tsx index 2d7fa7cd8b6..7383e71967b 100644 --- a/packages/desktop-client/src/components/budget/rollover/budgetsummary/TotalsList.tsx +++ b/packages/desktop-client/src/components/budget/rollover/budgetsummary/TotalsList.tsx @@ -15,7 +15,7 @@ type TotalsListProps = { prevMonthName: string; style?: CSSProperties; }; -export default function TotalsList({ prevMonthName, style }: TotalsListProps) { +export function TotalsList({ prevMonthName, style }: TotalsListProps) { const format = useFormat(); return (