A local-first personal finance app
TypeScript migration (partial). (#1660)
Shyam Guthikonda21d5f117eec2
diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.js b/packages/desktop-client/src/components/schedules/SchedulesTable.tsxsimilarity index 99%rename from packages/desktop-client/src/components/schedules/SchedulesTable.jsrename to packages/desktop-client/src/components/schedules/SchedulesTable.tsxindex 7b66b91510..e6b625c2dd 100644--- a/packages/desktop-client/src/components/schedules/SchedulesTable.js+++ b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx@@ -193,7 +193,6 @@ export function SchedulesTable({<Rowheight={ROW_HEIGHT}inset={15}- backgroundColor="transparent"onClick={() => onSelect(item.id)}style={{cursor: 'pointer',diff --git a/packages/desktop-client/src/components/schedules/StatusBadge.js b/packages/desktop-client/src/components/schedules/StatusBadge.tsxsimilarity index 85%rename from packages/desktop-client/src/components/schedules/StatusBadge.jsrename to packages/desktop-client/src/components/schedules/StatusBadge.tsxindex b5c6296445..3e1c395f2b 100644--- a/packages/desktop-client/src/components/schedules/StatusBadge.js+++ b/packages/desktop-client/src/components/schedules/StatusBadge.tsx@@ -9,11 +9,11 @@ import CheckCircleHollow from '../../icons/v2/CheckCircleHollow';import EditSkull1 from '../../icons/v2/EditSkull1';import FavoriteStar from '../../icons/v2/FavoriteStar';import ValidationCheck from '../../icons/v2/ValidationCheck';-import { colors } from '../../style';+import { colors, type CSSProperties } from '../../style';import Text from '../common/Text';import View from '../common/View';-export function getStatusProps(status) {+export function getStatusProps(status: Status) {let color, backgroundColor, Icon;switch (status) {@@ -67,7 +67,22 @@ export function getStatusProps(status) {return { color, backgroundColor, Icon };}-export function StatusBadge({ status, style }) {+type Status =+ | 'missed'+ | 'due'+ | 'upcoming'+ | 'paid'+ | 'completed'+ | 'pending'+ | 'scheduled'+ | 'cleared';++type StatusBadgeProps = {+ status: Status;+ style?: CSSProperties;+};++export function StatusBadge({ status, style }: StatusBadgeProps) {let { color, backgroundColor, Icon } = getStatusProps(status);return (<Viewdiff --git a/packages/desktop-client/src/components/table.tsx b/packages/desktop-client/src/components/table.tsxindex 504ff46393..19aead8b56 100644--- a/packages/desktop-client/src/components/table.tsx+++ b/packages/desktop-client/src/components/table.tsx@@ -858,8 +858,8 @@ type TableProps = {items: TableItem[];count?: number;headers?: ReactNode | TableHeaderProps['headers'];- contentHeader: ReactNode;- loading: boolean;+ contentHeader?: ReactNode;+ loading?: boolean;rowHeight?: number;backgroundColor?: string;renderItem: (arg: {@@ -871,16 +871,15 @@ type TableProps = {position: number;}) => ReactNode;renderEmpty?: ReactNode | (() => ReactNode);- getItemKey: (index: number) => TableItem['id'];+ getItemKey?: (index: number) => TableItem['id'];loadMore?: () => void;style?: CSSProperties;- navigator: ReturnType<typeof useTableNavigator>;- listRef;- onScroll: () => void;+ navigator?: ReturnType<typeof useTableNavigator>;+ onScroll?: () => void;version?: string;allowPopupsEscape?: boolean;isSelected?: (id: TableItem['id']) => boolean;- saveScrollWidth: (parent, child) => void;+ saveScrollWidth?: (parent, child) => void;};export const Table = forwardRef<TableHandleRef, TableProps>(@@ -899,7 +898,6 @@ export const Table = forwardRef<TableHandleRef, TableProps>(loadMore,style,navigator,- listRef,onScroll,version = 'v1',allowPopupsEscape,diff --git a/upcoming-release-notes/1660.md b/upcoming-release-notes/1660.mdnew file mode 100644index 0000000000..b570063ae5--- /dev/null+++ b/upcoming-release-notes/1660.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [doggan]+---++Migrate some components to TypeScript.