Skip to content

Add overlayBackground and able to change search Icon. #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/components/picker/PickerModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PickerModal extends BaseComponent {
onSearchChange: PropTypes.func,
renderCustomSearch: PropTypes.elementType,
listProps: PropTypes.object,
overlayBackgroundColor: PropTypes.string
pickerModalProps: PropTypes.object
};

static defaultProps = {
Expand Down Expand Up @@ -80,7 +80,7 @@ class PickerModal extends BaseComponent {
};

render() {
const {visible, enableModalBlur, topBarProps, listProps, children, onShow, overlayBackgroundColor} = this.props;
const {visible, enableModalBlur, topBarProps, listProps, children, onShow, pickerModalProps} = this.props;
return (
<Modal
animationType={'slide'}
Expand All @@ -89,7 +89,7 @@ class PickerModal extends BaseComponent {
visible={visible}
onRequestClose={topBarProps.onCancel}
onShow={onShow}
overlayBackgroundColor={overlayBackgroundColor}
overlayBackgroundColor={pickerModalProps.backgroundColor}
>
<Modal.TopBar {...topBarProps}/>
{this.renderSearchInput()}
Expand Down
8 changes: 4 additions & 4 deletions src/components/picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class Picker extends Component {
*/
listProps: PropTypes.object,
/**
* Pass a custom background color to the modal picker.
* Pass props to the picker modal
*/
overlayBackgroundColor: PropTypes.string
pickerModalProps: PropTypes.object
};

static defaultProps = {
Expand Down Expand Up @@ -370,7 +370,7 @@ class Picker extends Component {
listProps,
children,
testID,
overlayBackgroundColor
pickerModalProps
} = this.props;
const {showExpandableModal, selectedItemPosition, value} = this.state;

Expand Down Expand Up @@ -412,7 +412,7 @@ class Picker extends Component {
renderCustomSearch={renderCustomSearch}
listProps={listProps}
onShow={onShow}
overlayBackgroundColor={overlayBackgroundColor}
pickerModalProps={pickerModalProps}
>
{this.children}
</PickerModal>
Expand Down