Skip to content

Commit

Permalink
Merge pull request #22622 from thiagobrez/refactor/selection_list/che…
Browse files Browse the repository at this point in the history
…ckbox_list

refactor: SelectionList multiple selection
  • Loading branch information
cristipaval authored Aug 22, 2023
2 parents 3112ed0 + d9191ad commit 1ec5bf4
Show file tree
Hide file tree
Showing 29 changed files with 1,480 additions and 1,058 deletions.
6 changes: 2 additions & 4 deletions src/components/CountryPicker/CountrySelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import CONST from '../../CONST';
import useLocalize from '../../hooks/useLocalize';
import HeaderWithBackButton from '../HeaderWithBackButton';
import SelectionListRadio from '../SelectionListRadio';
import SelectionList from '../SelectionList';
import Modal from '../Modal';
import ScreenWrapper from '../ScreenWrapper';
import styles from '../../styles/styles';
Expand Down Expand Up @@ -73,16 +73,14 @@ function CountrySelectorModal({currentCountry, isVisible, onClose, onCountrySele
title={translate('common.country')}
onBackButtonPress={onClose}
/>
<SelectionListRadio
<SelectionList
headerMessage={headerMessage}
textInputLabel={translate('common.country')}
textInputPlaceholder={translate('countrySelectorModal.placeholderText')}
textInputValue={searchValue}
sections={[{data: searchResults, indexOffset: 0}]}
onSelectRow={onCountrySelected}
onChangeText={setSearchValue}
shouldFocusOnSelectRow
shouldHaveOptionSeparator
shouldDelayFocus
initiallyFocusedOptionKey={currentCountry}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import _ from 'underscore';
import HeaderWithBackButton from '../../HeaderWithBackButton';
import CONST from '../../../CONST';
import SelectionListRadio from '../../SelectionListRadio';
import SelectionList from '../../SelectionList';
import Modal from '../../Modal';
import {radioListItemPropTypes} from '../../SelectionListRadio/selectionListRadioPropTypes';
import {radioListItemPropTypes} from '../../SelectionList/selectionListPropTypes';
import useLocalize from '../../../hooks/useLocalize';
import ScreenWrapper from '../../ScreenWrapper';
import styles from '../../../styles/styles';
Expand All @@ -15,7 +15,7 @@ const propTypes = {
isVisible: PropTypes.bool.isRequired,

/** The list of years to render */
years: PropTypes.arrayOf(PropTypes.shape(radioListItemPropTypes)).isRequired,
years: PropTypes.arrayOf(PropTypes.shape(radioListItemPropTypes.item)).isRequired,

/** Currently selected year */
currentYear: PropTypes.number,
Expand Down Expand Up @@ -69,7 +69,7 @@ function YearPickerModal(props) {
title={translate('yearPickerPage.year')}
onBackButtonPress={props.onClose}
/>
<SelectionListRadio
<SelectionList
shouldDelayFocus
textInputLabel={translate('yearPickerPage.selectYear')}
textInputValue={searchText}
Expand Down
Loading

0 comments on commit 1ec5bf4

Please sign in to comment.