diff --git a/demo/src/screens/componentScreens/PickerScreen.tsx b/demo/src/screens/componentScreens/PickerScreen.tsx index fa7459bffa..8d3b95b48a 100644 --- a/demo/src/screens/componentScreens/PickerScreen.tsx +++ b/demo/src/screens/componentScreens/PickerScreen.tsx @@ -15,7 +15,9 @@ import { PanningProvider, PickerProps, RenderCustomModalProps, - PickerMethods + PickerMethods, + SegmentedControl, + PickerSelectionStatusProps } from 'react-native-ui-lib'; //eslint-disable-line import contactsData from '../../data/conversations'; import {longOptions} from './PickerScreenLongOptions'; @@ -24,6 +26,16 @@ const tagIcon = require('../../assets/icons/tags.png'); const dropdown = require('../../assets/icons/chevronDown.png'); const dropdownIcon = ; +const selectAllSegment = [{label: 'button'}, {label: 'checkbox'}]; + +const buttonProps = { + onPress: (selectionValue: any) => console.log('onPress', selectionValue) +}; + +const checkboxProps = { + onValueChange: (value: boolean) => console.log('onValueChange', value) +}; + const renderContact = (contactValue: any, props: any) => { const contact = contacts[contactValue as number]; return ( @@ -107,7 +119,12 @@ export default class PickerScreen extends Component { filter: undefined, statOption: [], scheme: undefined, - contact: 0 + contact: 0, + selectAllType: 'button' as PickerSelectionStatusProps['selectAllType'] + }; + + onSegmentChange = (index: number) => { + this.setState({selectAllType: selectAllSegment[index].label}); }; renderDialog: PickerProps['renderOverlay'] = (modalProps: RenderCustomModalProps) => { @@ -148,7 +165,7 @@ export default class PickerScreen extends Component { Picker - + - - Custom Top Element: - + + + Selection Status: + + + { - const allOptionsSelected = Array.isArray(value) && value.length === statusOptions.length; - return ( - -