Skip to content

Commit 1784869

Browse files
author
Sibtain Ali
committed
Feat(#67):
- Added multi select option. - Added husky, making auto linting possible. - Upgraded RN to the latest version.
1 parent db400f0 commit 1784869

File tree

17 files changed

+624
-101
lines changed

17 files changed

+624
-101
lines changed

.DS_Store

6 KB
Binary file not shown.

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
no-console: 1,
5555
no-unused-vars: 1,
5656
jsx-quotes: ["error", "prefer-double"],
57-
no-unused-expressions: 2,
57+
no-unused-expressions: "off",
5858
require-await: 2,
5959
no-irregular-whitespace: 2,
6060
arrow-spacing: "error",

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ Prop | Type | Optional | Default | Description
179179
`cancelButtonAccessibilityLabel` | string | Yes | undefined | Accessibility label for the cancel button
180180
`modalOpenerHitSlop` | object | Yes | {} | How far touch can stray away from touchable that opens modal ([RN docs](https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#hitslop))
181181
`customSelector` | node | Yes | undefined | Render a custom node instead of the built-in select box.
182-
`selectedKey` | any | Yes | '' | Key of the item to be initially selected
182+
`initSelectedKeys` | array<any> | Yes | [] | Key of the items to be initially selected. Should contain only one key if `multiple` is selected as false.
183+
`multiple` | bool | No | false | Adds the ability to select multiple options.
183184

184185
### Methods
185186

186-
`getSelectedItem()`: get current selected item, updated by onChange event.
187+
`getSelectedItems()`: get current selected items, updated by onChange event.

SampleApp/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ModalSelector from 'react-native-modal-selector';
99
class SampleApp extends Component {
1010
constructor() {
1111
super();
12-
1312
this.state = {
1413
textInputValue: '',
1514
};
@@ -53,9 +52,10 @@ class SampleApp extends Component {
5352
{/* Default mode: a clickable button will re rendered */}
5453
<ModalSelector
5554
data={data}
55+
multiple={true}
5656
initValue="Select something yummy!"
5757
onChange={option => {
58-
alert(`${option.label} (${option.key}) nom nom nom`);
58+
alert(`${JSON.stringify(option)} nom nom nom`);
5959
}}
6060
/>
6161

SampleApp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This demo app demonstrates how to use this component.
44

55
```
66
$ npm install
7+
$ cd ios && pod install
78
$ react-native run-[ios|android]
89
```
910

@@ -19,7 +20,6 @@ $ npm run nodemon
1920

2021
You can now edit the files in `../`, and they will be synced to `node_modules/react-native-modal-selector/`
2122

22-
2323
# Modifying react-native-modal-selector (RNMS) code during development
2424

25-
The RNMS source code is copied post-install due to a circular symlink bug. If the RNMS code changes, you must run `npm run postinstall` to update it in this sample app.
25+
The RNMS source code is copied post-install due to a circular symlink bug. If the RNMS code changes, you must run `npm run postinstall` to update it in this sample app.

SampleApp/ios/Podfile.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ PODS:
217217
- React-cxxreact (= 0.61.5)
218218
- React-jsi (= 0.61.5)
219219
- ReactCommon/jscallinvoker (= 0.61.5)
220+
- RNVectorIcons (6.6.0):
221+
- React
220222
- Yoga (1.14.0)
221223

222224
DEPENDENCIES:
@@ -247,6 +249,7 @@ DEPENDENCIES:
247249
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
248250
- ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
249251
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
252+
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
250253
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
251254

252255
SPEC REPOS:
@@ -302,6 +305,8 @@ EXTERNAL SOURCES:
302305
:path: "../node_modules/react-native/Libraries/Vibration"
303306
ReactCommon:
304307
:path: "../node_modules/react-native/ReactCommon"
308+
RNVectorIcons:
309+
:path: "../node_modules/react-native-vector-icons"
305310
Yoga:
306311
:path: "../node_modules/react-native/ReactCommon/yoga"
307312

@@ -331,8 +336,9 @@ SPEC CHECKSUMS:
331336
React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
332337
React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
333338
ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
339+
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
334340
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
335341

336-
PODFILE CHECKSUM: 46501af6cbd9a31b42321626f7da1e4bf8267022
342+
PODFILE CHECKSUM: b52ba057ceacea7e94d7c922e56231e2e6648f1b
337343

338344
COCOAPODS: 1.8.4

SampleApp/ios/SampleApp.xcodeproj/project.pbxproj

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
13B07F8C1A680F5B00A75B9A /* Frameworks */,
231231
13B07F8E1A680F5B00A75B9A /* Resources */,
232232
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
233+
A8E72D0E6F58F625F1B6C93C /* [CP] Copy Pods Resources */,
233234
);
234235
buildRules = (
235236
);
@@ -409,6 +410,54 @@
409410
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
410411
showEnvVarsInLog = 0;
411412
};
413+
A8E72D0E6F58F625F1B6C93C /* [CP] Copy Pods Resources */ = {
414+
isa = PBXShellScriptBuildPhase;
415+
buildActionMask = 2147483647;
416+
files = (
417+
);
418+
inputPaths = (
419+
"${PODS_ROOT}/Target Support Files/Pods-SampleApp/Pods-SampleApp-resources.sh",
420+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
421+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
422+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
423+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
424+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
425+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
426+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
427+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
428+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
429+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
430+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
431+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
432+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
433+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
434+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
435+
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
436+
);
437+
name = "[CP] Copy Pods Resources";
438+
outputPaths = (
439+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
440+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
441+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
442+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
443+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
444+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
445+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
446+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
447+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
448+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
449+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
450+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
451+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
452+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
453+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
454+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
455+
);
456+
runOnlyForDeploymentPostprocessing = 0;
457+
shellPath = /bin/sh;
458+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleApp/Pods-SampleApp-resources.sh\"\n";
459+
showEnvVarsInLog = 0;
460+
};
412461
B62BD319A7525609C8E195F8 /* [CP] Check Pods Manifest.lock */ = {
413462
isa = PBXShellScriptBuildPhase;
414463
buildActionMask = 2147483647;

SampleApp/ios/SampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)