diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.js b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx similarity index 99% rename from packages/desktop-client/src/components/schedules/SchedulesTable.js rename to packages/desktop-client/src/components/schedules/SchedulesTable.tsx index 7b66b915104..e6b625c2dd7 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({ 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.tsx similarity index 85% rename from packages/desktop-client/src/components/schedules/StatusBadge.js rename to packages/desktop-client/src/components/schedules/StatusBadge.tsx index b5c62964459..3e1c395f2b1 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 ( ReactNode; renderEmpty?: ReactNode | (() => ReactNode); - getItemKey: (index: number) => TableItem['id']; + getItemKey?: (index: number) => TableItem['id']; loadMore?: () => void; style?: CSSProperties; - navigator: ReturnType; - listRef; - onScroll: () => void; + navigator?: ReturnType; + onScroll?: () => void; version?: string; allowPopupsEscape?: boolean; isSelected?: (id: TableItem['id']) => boolean; - saveScrollWidth: (parent, child) => void; + saveScrollWidth?: (parent, child) => void; }; export const Table = forwardRef( @@ -899,7 +898,6 @@ export const Table = forwardRef( loadMore, style, navigator, - listRef, onScroll, version = 'v1', allowPopupsEscape, diff --git a/upcoming-release-notes/1660.md b/upcoming-release-notes/1660.md new file mode 100644 index 00000000000..b570063ae55 --- /dev/null +++ b/upcoming-release-notes/1660.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [doggan] +--- + +Migrate some components to TypeScript.