Skip to content

Commit 51f9373

Browse files
authored
Merge pull request Expensify#77025 from software-mansion-labs/@zfurtak/migrate-StatusClearAfterPage
Make `StatusClearAfterPage` use new `SelectionList`
2 parents b267902 + 7612235 commit 51f9373

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

src/pages/settings/Profile/CustomStatus/StatusClearAfterPage.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type {ValueOf} from 'type-fest';
33
import HeaderWithBackButton from '@components/HeaderWithBackButton';
44
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
55
import ScreenWrapper from '@components/ScreenWrapper';
6-
import SelectionList from '@components/SelectionListWithSections';
7-
import RadioListItem from '@components/SelectionListWithSections/RadioListItem';
6+
import SelectionList from '@components/SelectionList';
7+
import RadioListItem from '@components/SelectionList/ListItem/RadioListItem';
88
import Text from '@components/Text';
99
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
1010
import useLocalize from '@hooks/useLocalize';
@@ -176,21 +176,28 @@ function StatusClearAfterPage() {
176176
return statusType.find((item) => item.isSelected)?.keyForList;
177177
}, [statusType]);
178178

179+
const confirmButtonOptions = useMemo(
180+
() => ({
181+
showButton: true,
182+
text: translate('statusPage.save'),
183+
onConfirm: saveAndGoBack,
184+
}),
185+
[saveAndGoBack, translate],
186+
);
187+
179188
const timePeriodOptions = useCallback(
180189
() => (
181190
<SelectionList
182-
sections={[{data: statusType}]}
191+
data={statusType}
183192
ListItem={RadioListItem}
184193
onSelectRow={updateMode}
185194
listFooterContent={listFooterContent}
186-
showConfirmButton
187-
initiallyFocusedOptionKey={initialFocusedIndex}
195+
confirmButtonOptions={confirmButtonOptions}
196+
initiallyFocusedItemKey={initialFocusedIndex}
188197
shouldUpdateFocusedIndex
189-
confirmButtonText={translate('statusPage.save')}
190-
onConfirm={saveAndGoBack}
191198
/>
192199
),
193-
[statusType, updateMode, listFooterContent, saveAndGoBack, translate, initialFocusedIndex],
200+
[statusType, updateMode, listFooterContent, confirmButtonOptions, initialFocusedIndex],
194201
);
195202

196203
return (

0 commit comments

Comments
 (0)