Skip to content

Commit 7a071b5

Browse files
Merge pull request #23 from SimformSolutionsPvtLtd/develop
Release v0.0.3
2 parents 6b06aba + ae28bff commit 7a071b5

File tree

8 files changed

+27
-8
lines changed

8 files changed

+27
-8
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# react-native-country-code-select
44

5-
[![npm version](https://img.shields.io/badge/npm%20package-0.0.2-orange)](https://www.npmjs.org/package/react-native-country-code-select) [![Android](https://img.shields.io/badge/Platform-Android-green?logo=android)](https://www.android.com) [![iOS](https://img.shields.io/badge/Platform-iOS-green?logo=apple)](https://developer.apple.com/ios) [![MIT](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
5+
[![npm version](https://img.shields.io/badge/npm%20package-0.0.3-orange)](https://www.npmjs.org/package/react-native-country-code-select) [![Android](https://img.shields.io/badge/Platform-Android-green?logo=android)](https://www.android.com) [![iOS](https://img.shields.io/badge/Platform-iOS-green?logo=apple)](https://developer.apple.com/ios) [![MIT](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
66

77
---
88

@@ -71,6 +71,14 @@ export default const App = () => {
7171
7272
---
7373
74+
## Compatibility
75+
76+
---
77+
78+
Only supports `react-native` `0.62+`
79+
80+
---
81+
7482
## CountryPicker
7583
7684
#### 🎬 Preview
@@ -210,6 +218,8 @@ const styles = StyleSheet.create({
210218
> | renderCustomEmptyComponent | - | function | Render custom component when there's no search result found |
211219
> | customCloseButton | - | function | Render custom modal close button |
212220
> | renderSearchInputClear | - | function | Render custom cancel image in search input |
221+
> | handleStyle | {} | ViewStyle | View style to be applied to the handle bar component |
222+
> | handleComponent | - | function | Render custom handle bar component |
213223

214224
---
215225

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-country-code-select",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "React Native component to select a country code",
55
"homepage": "https://github.com/SimformSolutionsPvtLtd/react-native-country-code-select#readme",
66
"main": "lib/index.js",

src/components/CountryList/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default StyleSheet.create({
1414
},
1515
emptyContainer: {
1616
flex: 1,
17-
justifyContent: 'center',
1817
alignItems: 'center',
18+
marginTop: verticalScale(90),
1919
},
2020
emptyText: {
2121
fontSize: moderateScale(18),

src/components/CountryPickerModal/CountryPickerModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const CountryPickerModal = ({
3939
renderCustomEmptyComponent,
4040
customCloseButton,
4141
renderSearchInputClear,
42+
handleStyle = {},
43+
handleComponent,
4244
}: CountryPickerModalProps) => {
4345
const [countries, setCountries] = useState<Country[]>([]);
4446
const [filterString, setFilterString] = useState<string>('');
@@ -60,9 +62,10 @@ export const CountryPickerModal = ({
6062
setFilterString('');
6163
}
6264
}, [isVisible]);
63-
6465
return (
65-
<CustomModal {...{ onClose, modalContainerStyle }}>
66+
<CustomModal
67+
{...{ onClose, modalContainerStyle, handleStyle, handleComponent }}
68+
>
6669
<SafeAreaView style={[styles.container, modalContentStyle]}>
6770
<Header
6871
onClose={onClose}

src/components/CountryPickerModal/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export interface CountryPickerModalAdditionalProps {
3636
renderCustomEmptyComponent?: () => JSX.Element;
3737
customCloseButton?: () => JSX.Element;
3838
renderSearchInputClear?: ({ setFilterString }: FunctionProps) => JSX.Element;
39+
handleStyle?: StyleProp<ViewStyle>;
40+
handleComponent?: () => JSX.Element;
3941
}
4042

4143
export interface CountryPickerModalProps

src/components/CustomModal/CustomModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const CustomModal = ({
1212
children,
1313
onClose,
1414
modalContainerStyle,
15+
handleStyle,
16+
handleComponent,
1517
}: CustomModalProps) => {
1618
const { gestureHandler, animatedBottomStyle, toggleModal } = useCustomModal({
1719
onClose,
@@ -32,8 +34,9 @@ const CustomModal = ({
3234

3335
return (
3436
<GestureDetector gesture={gestureHandler}>
35-
<Animated.View style={[topViewStyles, animatedBottomStyle]}>
36-
<View style={styles.line} />
37+
<Animated.View style={[animatedBottomStyle, topViewStyles]}>
38+
{handleComponent && handleComponent()}
39+
{!handleComponent && <View style={[styles.line, handleStyle]} />}
3740
{children}
3841
</Animated.View>
3942
</GestureDetector>

src/components/CustomModal/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export interface onCloseModalProps {
77
export interface CustomModalProps extends onCloseModalProps {
88
children: React.ReactNode;
99
modalContainerStyle?: StyleProp<ViewStyle>;
10+
handleStyle?: StyleProp<ViewStyle>;
11+
handleComponent?: () => JSX.Element;
1012
}
1113
export interface CustomModalRefProps {
1214
toggleModal: (isVisible: boolean) => void;

src/components/Header/styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default StyleSheet.create({
1010
},
1111
headerContainer: {
1212
flexDirection: 'row',
13-
height: verticalScale(55),
1413
},
1514
headerTitleContainer: {
1615
flex: 1,

0 commit comments

Comments
 (0)