diff --git a/src/stories/EReceipt.stories.tsx b/src/stories/EReceipt.stories.tsx index 55a4cc6cb9b4..f652c08df6f6 100644 --- a/src/stories/EReceipt.stories.tsx +++ b/src/stories/EReceipt.stories.tsx @@ -1,14 +1,11 @@ -/* eslint-disable @typescript-eslint/naming-convention */ - -/* eslint-disable rulesdir/prefer-actions-set-data */ +/* eslint-disable @typescript-eslint/naming-convention, rulesdir/prefer-actions-set-data */ import type {ComponentMeta, ComponentStory} from '@storybook/react'; import React from 'react'; -import type {NullishDeep} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; import type {EReceiptOnyxProps, EReceiptProps} from '@components/EReceipt'; import EReceipt from '@components/EReceipt'; import ONYXKEYS from '@src/ONYXKEYS'; -import type {Transaction} from '@src/types/onyx'; +import type CollectionDataSet from '@src/types/utils/CollectionDataSet'; type EReceiptStory = ComponentStory; @@ -154,7 +151,7 @@ const transactionData = { created: '2023-01-11 13:46:20', hasEReceipt: true, }, -} as Record<`${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`, NullishDeep>; +} as CollectionDataSet; Onyx.mergeCollection(ONYXKEYS.COLLECTION.TRANSACTION, transactionData); Onyx.merge('cardList', { diff --git a/src/stories/SelectionList.stories.tsx b/src/stories/SelectionList.stories.tsx index e7b137d4ff2f..aeef37589761 100644 --- a/src/stories/SelectionList.stories.tsx +++ b/src/stories/SelectionList.stories.tsx @@ -110,7 +110,7 @@ function WithTextInput(props: BaseSelectionListProps) { const [selectedIndex, setSelectedIndex] = useState(1); const sections = props.sections.map((section) => { - const data = section.data.reduce>((memo, item, index) => { + const data = section.data.reduce((memo, item, index) => { if (!item.text.toLowerCase().includes(searchText.trim().toLowerCase())) { return memo; } @@ -210,9 +210,7 @@ function WithAlternateText(props: BaseSelectionListProps) { } WithAlternateText.args = { - sections: SECTIONS, - onSelectRow: () => {}, - initiallyFocusedOptionKey: 'option-2', + ...Default.args, }; function MultipleSelection(props: BaseSelectionListProps) { @@ -250,7 +248,7 @@ function MultipleSelection(props: BaseSelectionListProps) { }, [props.sections, selectedIds]); const onSelectRow = (item: ListItem) => { - const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((i) => i !== item.keyForList) : [...selectedIds, item.keyForList]; + const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((id) => id !== item.keyForList) : [...selectedIds, item.keyForList]; setSelectedIds(newSelectedIds); }; @@ -315,7 +313,7 @@ function WithSectionHeader(props: BaseSelectionListProps) { }, [props.sections, selectedIds]); const onSelectRow = (item: ListItem) => { - const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((i) => i !== item.keyForList) : [...selectedIds, item.keyForList]; + const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((id) => id !== item.keyForList) : [...selectedIds, item.keyForList]; setSelectedIds(newSelectedIds); }; @@ -378,7 +376,7 @@ function WithConfirmButton(props: BaseSelectionListProps) { }, [props.sections, selectedIds]); const onSelectRow = (item: ListItem) => { - const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((i) => i !== item.keyForList) : [...selectedIds, item.keyForList]; + const newSelectedIds = selectedIds.includes(item.keyForList) ? selectedIds.filter((id) => id !== item.keyForList) : [...selectedIds, item.keyForList]; setSelectedIds(newSelectedIds); };