react-native-google-places-autocomplete 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -390,6 +390,7 @@ interface GooglePlacesAutocompleteProps {
390
390
  region?: string;
391
391
  components?: string;
392
392
  };
393
+ inbetweenCompo?: React.ReactNode;
393
394
  isRowScrollable?: boolean;
394
395
  keyboardShouldPersistTaps?: 'never' | 'always' | 'handled';
395
396
  /** use the ListEmptyComponent prop when no autocomplete results are found. */
@@ -17,6 +17,7 @@ import {
17
17
  Keyboard,
18
18
  Platform,
19
19
  ScrollView,
20
+ StyleSheet,
20
21
  Text,
21
22
  TextInput,
22
23
  TouchableHighlight,
@@ -54,7 +55,7 @@ const defaultStyles = {
54
55
  },
55
56
  description: {},
56
57
  separator: {
57
- height: 0.5,
58
+ height: StyleSheet.hairlineWidth,
58
59
  backgroundColor: '#c8c7cc',
59
60
  },
60
61
  poweredContainer: {
@@ -124,11 +125,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
124
125
  };
125
126
 
126
127
  const getRequestHeaders = (requestUrl) => {
127
- if (requestUrl) {
128
- return requestUrl.headers;
129
- } else {
130
- return {};
131
- }
128
+ return requestUrl?.headers || {};
132
129
  };
133
130
 
134
131
  const setRequestHeaders = (request, headers) => {
@@ -825,7 +822,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
825
822
  onFocus
826
823
  ? () => {
827
824
  _onFocus();
828
- onFocus();
825
+ onFocus(e);
829
826
  }
830
827
  : _onFocus
831
828
  }
@@ -833,7 +830,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
833
830
  onBlur
834
831
  ? (e) => {
835
832
  _onBlur(e);
836
- onBlur();
833
+ onBlur(e);
837
834
  }
838
835
  : _onBlur
839
836
  }
@@ -844,6 +841,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
844
841
  {_renderRightButton()}
845
842
  </View>
846
843
  )}
844
+ {props.inbetweenCompo}
847
845
  {_getFlatList()}
848
846
  {props.children}
849
847
  </View>
@@ -863,6 +861,7 @@ GooglePlacesAutocomplete.propTypes = {
863
861
  GooglePlacesDetailsQuery: PropTypes.object,
864
862
  GooglePlacesSearchQuery: PropTypes.object,
865
863
  GoogleReverseGeocodingQuery: PropTypes.object,
864
+ inbetweenCompo: PropTypes.object,
866
865
  isRowScrollable: PropTypes.bool,
867
866
  keyboardShouldPersistTaps: PropTypes.oneOf(['never', 'always', 'handled']),
868
867
  listEmptyComponent: PropTypes.func,
package/README.md CHANGED
@@ -8,6 +8,9 @@
8
8
 
9
9
  Version 2 of this library is now available. See more in the [releases](https://github.com/FaridSafi/react-native-google-places-autocomplete/releases/tag/v2.0.0) section.
10
10
 
11
+ # :warning: Maintainers Wanted ![Maintainers Wanted](https://img.shields.io/badge/Maintainers-Wanted-green)
12
+ We are in need of more people or companies willing to help. If you have enough time and knowledge, and want to become a maintainer, please open a new issue.
13
+
11
14
  ## Preview
12
15
 
13
16
  ![](https://raw.githubusercontent.com/FaridSafi/react-native-google-places-autocomplete/master/Assets/screenshot.png)
@@ -182,7 +185,7 @@ export default GooglePlacesInput;
182
185
  <details>
183
186
  <summary>Click to expand</summary>
184
187
 
185
- This is an example using the Text Input from [`react-native-elements`](https://reactnativeelements.com/docs/input).
188
+ This is an example using the Text Input from [`react-native-elements`](https://reactnativeelements.com/docs/components/input).
186
189
 
187
190
  ```js
188
191
  import React from 'react';
@@ -233,6 +236,7 @@ _This list is a work in progress. PRs welcome!_
233
236
  | GooglePlacesSearchQuery | object | "query" object for the Google Places Nearby API (when you use current location to find nearby places) | `{ rankby: 'distance', type: 'restaurant' }` | |
234
237
  | GoogleReverseGeocodingQuery | object | "query" object for the Google Geocode API (when you use current location to get the current address) | | |
235
238
  | isRowScrollable | boolean | enable/disable horizontal scrolling of a list result https://reactnative.dev/docs/scrollview#scrollenabled | true |
239
+ |inbetweenCompo|React.ReactNode|Insert a ReactNode in between the search bar and the search results Flatlist
236
240
  | keepResultsAfterBlur | boolean | show list of results after blur | false | true \| false |
237
241
  | keyboardShouldPersistTaps | string | Determines when the keyboard should stay visible after a tap https://reactnative.dev/docs/scrollview#keyboardshouldpersisttaps | 'always' | 'never' \| 'always' \| 'handled' |
238
242
  | listEmptyComponent | function | use FlatList's ListEmptyComponent prop when no autocomplete results are found. | | |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-places-autocomplete",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Customizable Google Places autocomplete component for iOS and Android React-Native apps",
5
5
  "main": "GooglePlacesAutocomplete.js",
6
6
  "types": "GooglePlacesAutocomplete.d.ts",