Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/pages/settings/Report/WriteCapabilityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {ValueOf} from 'type-fest';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionListWithSections';
import RadioListItem from '@components/SelectionListWithSections/RadioListItem';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/ListItem/RadioListItem';
import useLocalize from '@hooks/useLocalize';
import useReportIsArchived from '@hooks/useReportIsArchived';
import {updateWriteCapability as updateWriteCapabilityUtil} from '@libs/actions/Report';
Expand All @@ -30,6 +30,7 @@ function WriteCapabilityPage({report, policy}: WriteCapabilityPageProps) {
keyForList: value,
isSelected: value === (report?.writeCapability ?? CONST.REPORT.WRITE_CAPABILITIES.ALL),
}));
const selectedOptionKey = writeCapabilityOptions.find((locale) => locale.isSelected)?.keyForList;
const isReportArchived = useReportIsArchived(report.reportID);
const isAbleToEdit = canEditWriteCapability(report, policy, isReportArchived);

Expand Down Expand Up @@ -57,11 +58,11 @@ function WriteCapabilityPage({report, policy}: WriteCapabilityPageProps) {
onBackButtonPress={goBack}
/>
<SelectionList
sections={[{data: writeCapabilityOptions}]}
data={writeCapabilityOptions}
ListItem={RadioListItem}
onSelectRow={(option) => updateWriteCapability(option.value)}
shouldSingleExecuteRowSelect
initiallyFocusedOptionKey={writeCapabilityOptions.find((locale) => locale.isSelected)?.keyForList}
initiallyFocusedItemKey={selectedOptionKey}
/>
</FullPageNotFoundView>
</ScreenWrapper>
Expand Down
Loading