Skip to content

Commit

Permalink
income cateogry to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
MikesGlitch committed Nov 11, 2023
1 parent cc63d32 commit 782c1ca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import React from 'react';
import React, { ComponentProps } from 'react';

Check warning on line 1 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Import "ComponentProps" is only used as types

import { useDraggable, useDroppable, DropHighlight } from '../sort';
import { useDraggable, useDroppable, DropHighlight, OnDragChangeCallback, OnDropCallback } from '../sort';

Check warning on line 3 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Imports "OnDragChangeCallback" and "OnDropCallback" are only used as types

Check warning on line 3 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `·useDraggable,·useDroppable,·DropHighlight,·OnDragChangeCallback,·OnDropCallback·` with `⏎··useDraggable,⏎··useDroppable,⏎··DropHighlight,⏎··OnDragChangeCallback,⏎··OnDropCallback,⏎`
import { Row } from '../table';

import RenderMonths from './RenderMonths';
import SidebarCategory from './SidebarCategory';

Check warning on line 7 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

There should be at least one empty line between import groups
import { CategoryEntity } from 'loot-core/src/types/models';

Check warning on line 8 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

All imports in the declaration are only used as types. Use `import type`

Check warning on line 8 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

`loot-core/src/types/models` import should occur before import of `../sort`

type IncomeCategoryProps = {
cat: CategoryEntity;
isLast?: boolean;
editingCell: { id: string; cell: string } | null;
MonthComponent: ComponentProps<typeof RenderMonths>["component"];

Check warning on line 14 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"component"` with `'component'`
onEditName: ComponentProps<typeof SidebarCategory>["onEditName"];

Check warning on line 15 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"onEditName"` with `'onEditName'`
onEditMonth?: (id: string, monthIndex: number) => void;
onSave: ComponentProps<typeof SidebarCategory>["onSave"];

Check warning on line 17 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"onSave"` with `'onSave'`
onDelete: ComponentProps<typeof SidebarCategory>["onDelete"];

Check warning on line 18 in packages/desktop-client/src/components/budget/IncomeCategory.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"onDelete"` with `'onDelete'`
onDragChange: OnDragChangeCallback<CategoryEntity>;
onBudgetAction: (idx: number, action: string, arg: unknown) => void;
onReorder: OnDropCallback;
onShowActivity: (name: string, id: string, idx: number) => void;
};

function IncomeCategory({
cat,
Expand All @@ -19,7 +35,7 @@ function IncomeCategory({
onBudgetAction,
onReorder,
onShowActivity,
}) {
}: IncomeCategoryProps) {
let { dragRef } = useDraggable({
type: 'income-category',
onDragChange,
Expand Down
2 changes: 1 addition & 1 deletion upcoming-release-notes/1897.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ category: Maintenance
authors: [MikesGlitch]
---

Convert ExpenseGroup, ExpenseCategory components to Typescript.
Convert ExpenseGroup, ExpenseCategory, IncomeCategory components to Typescript.

0 comments on commit 782c1ca

Please sign in to comment.