Skip to content

Commit

Permalink
new: placeholderTextColor prop is available now
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Jun 6, 2021
1 parent 39b691f commit fb74496
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 91 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# Version 2.0 🥳

Version 2.0 is here :O
Version 2.0 is here 🥳

- Completely re-written from scratch 💪
- Much better coding for maintenance and less dependency
Expand Down Expand Up @@ -186,6 +186,7 @@ export default class Test extends Component {
| clearIconImageSource | ISource | default | change the clear icon image source |
| clearIconImageSource | ISource | default | change the clear icon image source |
| placeholder | string | "Search here..." | set your own placeholder string |
| placeholderTextColor | color | undefined | set placeholder text color |
| spinnerColor | color | #fdfdfd | change the spinner color |
| spinnerSize | number | default | change the spinner size |
| SpinnerType | component | Circle | change the spinner type |
Expand Down
8 changes: 0 additions & 8 deletions example/.prettierrc.js

This file was deleted.

3 changes: 2 additions & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { ScreenWidth } from "@freakycoder/react-native-helpers";
/**
* ? Local Imports
*/
import SearchBar from "react-native-dynamic-search-bar";
// import SearchBar from "react-native-dynamic-search-bar";
import SearchBar from "./build/dist/SearchBar";
import styles, { centerSubtitleStyle } from "./styles";
// Static Data
import staticData from "./src/data/staticData";
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target 'example' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
post_install do |installer|
flipper_post_install(installer)
end
Expand Down
154 changes: 76 additions & 78 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ PODS:
- boost-for-react-native (1.63.0)
- BVLinearGradient (2.5.6):
- React
- CocoaAsyncSocket (7.6.4)
- CocoaLibEvent (1.0.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.63.3)
- FBReactNativeSpec (0.63.3):
Expand All @@ -13,50 +12,50 @@ PODS:
- React-Core (= 0.63.3)
- React-jsi (= 0.63.3)
- ReactCommon/turbomodule/core (= 0.63.3)
- Flipper (0.54.0):
- Flipper-Folly (~> 2.2)
- Flipper-RSocket (~> 1.1)
- Flipper (0.75.1):
- Flipper-Folly (~> 2.5)
- Flipper-RSocket (~> 1.3)
- Flipper-DoubleConversion (1.1.7)
- Flipper-Folly (2.2.0):
- Flipper-Folly (2.5.3):
- boost-for-react-native
- CocoaLibEvent (~> 1.0)
- Flipper-DoubleConversion
- Flipper-Glog
- OpenSSL-Universal (= 1.0.2.19)
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.1.0):
- Flipper-Folly (~> 2.2)
- FlipperKit (0.54.0):
- FlipperKit/Core (= 0.54.0)
- FlipperKit/Core (0.54.0):
- Flipper (~> 0.54.0)
- Flipper-RSocket (1.3.1):
- Flipper-Folly (~> 2.5)
- FlipperKit (0.75.1):
- FlipperKit/Core (= 0.75.1)
- FlipperKit/Core (0.75.1):
- Flipper (~> 0.75.1)
- FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines
- FlipperKit/FKPortForwarding
- FlipperKit/CppBridge (0.54.0):
- Flipper (~> 0.54.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.54.0):
- Flipper-Folly (~> 2.2)
- FlipperKit/FBDefines (0.54.0)
- FlipperKit/FKPortForwarding (0.54.0):
- FlipperKit/CppBridge (0.75.1):
- Flipper (~> 0.75.1)
- FlipperKit/FBCxxFollyDynamicConvert (0.75.1):
- Flipper-Folly (~> 2.5)
- FlipperKit/FBDefines (0.75.1)
- FlipperKit/FKPortForwarding (0.75.1):
- CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.54.0)
- FlipperKit/FlipperKitLayoutPlugin (0.54.0):
- FlipperKit/FlipperKitHighlightOverlay (0.75.1)
- FlipperKit/FlipperKitLayoutPlugin (0.75.1):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.54.0)
- FlipperKit/FlipperKitNetworkPlugin (0.54.0):
- FlipperKit/FlipperKitLayoutTextSearchable (0.75.1)
- FlipperKit/FlipperKitNetworkPlugin (0.75.1):
- FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.54.0):
- FlipperKit/FlipperKitReactPlugin (0.75.1):
- FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.54.0):
- FlipperKit/FlipperKitUserDefaultsPlugin (0.75.1):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.54.0):
- FlipperKit/SKIOSNetworkPlugin (0.75.1):
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- Folly (2020.01.13.00):
Expand All @@ -69,18 +68,17 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- libwebp (1.1.0):
- libwebp/demux (= 1.1.0)
- libwebp/mux (= 1.1.0)
- libwebp/webp (= 1.1.0)
- libwebp/demux (1.1.0):
- libevent (2.1.12)
- libwebp (1.2.0):
- libwebp/demux (= 1.2.0)
- libwebp/mux (= 1.2.0)
- libwebp/webp (= 1.2.0)
- libwebp/demux (1.2.0):
- libwebp/webp
- libwebp/mux (1.1.0):
- libwebp/mux (1.2.0):
- libwebp/demux
- libwebp/webp (1.1.0)
- OpenSSL-Universal (1.0.2.19):
- OpenSSL-Universal/Static (= 1.0.2.19)
- OpenSSL-Universal/Static (1.0.2.19)
- libwebp/webp (1.2.0)
- OpenSSL-Universal (1.1.180)
- RCTRequired (0.63.3)
- RCTTypeSafety (0.63.3):
- FBLazyVector (= 0.63.3)
Expand Down Expand Up @@ -247,7 +245,7 @@ PODS:
- React-cxxreact (= 0.63.3)
- React-jsi (= 0.63.3)
- React-jsinspector (0.63.3)
- react-native-safe-area-context (3.1.8):
- react-native-safe-area-context (3.2.0):
- React-Core
- react-native-spinkit (1.4.1):
- React
Expand Down Expand Up @@ -311,17 +309,17 @@ PODS:
- React-Core (= 0.63.3)
- React-cxxreact (= 0.63.3)
- React-jsi (= 0.63.3)
- RNFastImage (8.3.2):
- React
- RNFastImage (8.3.4):
- React-Core
- SDWebImage (~> 5.8)
- SDWebImageWebPCoder (~> 0.6.1)
- RNGestureHandler (1.8.0):
- React
- RNSVG (12.1.0):
- RNGestureHandler (1.10.3):
- React-Core
- RNSVG (12.1.1):
- React
- SDWebImage (5.9.2):
- SDWebImage/Core (= 5.9.2)
- SDWebImage/Core (5.9.2)
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
- SDWebImage/Core (5.11.1)
- SDWebImageWebPCoder (0.6.1):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7)
Expand All @@ -334,25 +332,25 @@ DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
- Flipper (~> 0.54.0)
- Flipper (= 0.75.1)
- Flipper-DoubleConversion (= 1.1.7)
- Flipper-Folly (~> 2.2)
- Flipper-Folly (= 2.5.3)
- Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (~> 0.0.4)
- Flipper-RSocket (~> 1.1)
- FlipperKit (~> 0.54.0)
- FlipperKit/Core (~> 0.54.0)
- FlipperKit/CppBridge (~> 0.54.0)
- FlipperKit/FBCxxFollyDynamicConvert (~> 0.54.0)
- FlipperKit/FBDefines (~> 0.54.0)
- FlipperKit/FKPortForwarding (~> 0.54.0)
- FlipperKit/FlipperKitHighlightOverlay (~> 0.54.0)
- FlipperKit/FlipperKitLayoutPlugin (~> 0.54.0)
- FlipperKit/FlipperKitLayoutTextSearchable (~> 0.54.0)
- FlipperKit/FlipperKitNetworkPlugin (~> 0.54.0)
- FlipperKit/FlipperKitReactPlugin (~> 0.54.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.54.0)
- FlipperKit/SKIOSNetworkPlugin (~> 0.54.0)
- Flipper-RSocket (= 1.3.1)
- FlipperKit (= 0.75.1)
- FlipperKit/Core (= 0.75.1)
- FlipperKit/CppBridge (= 0.75.1)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.75.1)
- FlipperKit/FBDefines (= 0.75.1)
- FlipperKit/FKPortForwarding (= 0.75.1)
- FlipperKit/FlipperKitHighlightOverlay (= 0.75.1)
- FlipperKit/FlipperKitLayoutPlugin (= 0.75.1)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.75.1)
- FlipperKit/FlipperKitNetworkPlugin (= 0.75.1)
- FlipperKit/FlipperKitReactPlugin (= 0.75.1)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.75.1)
- FlipperKit/SKIOSNetworkPlugin (= 0.75.1)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
Expand Down Expand Up @@ -388,14 +386,14 @@ SPEC REPOS:
trunk:
- boost-for-react-native
- CocoaAsyncSocket
- CocoaLibEvent
- Flipper
- Flipper-DoubleConversion
- Flipper-Folly
- Flipper-Glog
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- libevent
- libwebp
- OpenSSL-Universal
- SDWebImage
Expand Down Expand Up @@ -471,22 +469,22 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 878b59e31113e289e275165efbe4b54fa614d43d
FBReactNativeSpec: 7da9338acfb98d4ef9e5536805a0704572d33c2f
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7
FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: e90b9c01d99205d03b6bb8f2c8c415e5a4ef66f0
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCTRequired: 48884c74035a0b5b76dbb7a998bd93bcfc5f2047
RCTTypeSafety: edf4b618033c2f1c5b7bc3d90d8e085ed95ba2ab
React: f36e90f3ceb976546e97df3403e37d226f79d0e3
Expand All @@ -497,7 +495,7 @@ SPEC CHECKSUMS:
React-jsi: df07aa95b39c5be3e41199921509bfa929ed2b9d
React-jsiexecutor: b56c03e61c0dd5f5801255f2160a815f4a53d451
React-jsinspector: 8e68ffbfe23880d3ee9bafa8be2777f60b25cbe2
react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6
react-native-safe-area-context: e471852c5ed67eea4b10c5d9d43c1cebae3b231d
react-native-spinkit: da294fd828216ad211fe36a5c14c1e09f09e62db
React-RCTActionSheet: 53ea72699698b0b47a6421cb1c8b4ab215a774aa
React-RCTAnimation: 1befece0b5183c22ae01b966f5583f42e69a83c2
Expand All @@ -509,14 +507,14 @@ SPEC CHECKSUMS:
React-RCTText: 65a6de06a7389098ce24340d1d3556015c38f746
React-RCTVibration: 8e9fb25724a0805107fc1acc9075e26f814df454
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
RNFastImage: e19ba191922e7dab9d932a4d59d62d76660aa222
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb
RNFastImage: d4870d58f5936111c56218dbd7fcfc18e65b58ff
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 311cf87a4a33d759b7ec994ec3735e03d4ededbf
PODFILE CHECKSUM: fec3dba33f2962dc296b77040d0a9e7709263a61

COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.10.1
38 changes: 38 additions & 0 deletions example/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
58359CF74F590193FC5F06F0 /* [CP] Copy Pods Resources */,
2E7D9E5F97730E7068443E36 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -232,6 +233,7 @@
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
C407AE09DF99F010E0ACF785 /* [CP] Copy Pods Resources */,
50160BEAC220FA81AAB59561 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -435,6 +437,42 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
2E7D9E5F97730E7068443E36 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
50160BEAC220FA81AAB59561 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
58359CF74F590193FC5F06F0 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
8 changes: 7 additions & 1 deletion lib/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface ISearchBarProps
spinnerSize?: number;
spinnerColor?: string;
spinnerVisibility?: boolean;
placeholderTextColor?: string;
searchIconComponent?: React.ReactChild;
clearIconComponent?: React.ReactChild;
searchIconImageSource?: ISource;
Expand Down Expand Up @@ -121,10 +122,15 @@ export default class SearchBar extends React.Component<
textInputStyle,
darkMode = false,
placeholder = "Search here...",
placeholderTextColor,
} = this.props;
let _placeholderTextColor = placeholderTextColor;
if (!placeholderTextColor) {
_placeholderTextColor = darkMode ? "#fdfdfd" : "#19191a";
}
return (
<TextInput
placeholderTextColor={darkMode ? "#fdfdfd" : "#19191a"}
placeholderTextColor={_placeholderTextColor}
{...this.props}
onBlur={onBlur}
onFocus={onFocus}
Expand Down
Loading

0 comments on commit fb74496

Please sign in to comment.