Skip to content

Commit 503fc7c

Browse files
committed
Built-in spinner is integrated
1 parent 0fd1ecc commit 503fc7c

File tree

4 files changed

+70
-15
lines changed

4 files changed

+70
-15
lines changed

README.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
<img alt="React Native Dynamic Search Bar" src="assets/Screenshots/RN-Dynamic-SearchBar.png" height="800" />
2222
</p>
2323

24+
<h1 align="center"> Built-in Spinner </h1>
25+
<p align="center">
26+
<img alt="React Native Dynamic Search Bar" src="assets/Screenshots/RN-Dynamic-Search-Bar-Spinner.gif" />
27+
</p>
28+
2429
## Installation
2530

2631
Add the dependency:
@@ -45,9 +50,10 @@ npm i WrathChaos/react-native-dynamic-vector-icons#expo
4550
```js
4651
"react": ">= 16.x.x",
4752
"react-native": ">= 0.55.x",
53+
"react-native-spinkit": ">= 1.5.0",
4854
"react-native-vector-icons": ">= 6.x.x",
4955
"react-native-dynamic-vector-icons": ">= x.x.x",
50-
"@freakycoder/react-native-helpers": ">= 0.1.0"
56+
"@freakycoder/react-native-helpers": ">= 0.1.0",
5157
```
5258

5359
# Usage
@@ -104,6 +110,54 @@ You can check the example for the advanced usage
104110
/>
105111
```
106112

113+
## Advanced Built-in Spinner Usage
114+
115+
You can check the example for the advanced built-in spinner usage
116+
117+
```js
118+
import React, { Component } from "react";
119+
import { View } from "react-native";
120+
import SearchBar from "react-native-dynamic-search-bar";
121+
122+
export default class Test extends Component {
123+
handleOnChangeText = (text) => {
124+
// ? Visible the spinner
125+
this.setState({
126+
searchText: text,
127+
spinnerVisibility: true,
128+
});
129+
130+
// ? After you've done to implement your use-case
131+
// ? Do not forget to set false to spinner's visibility
132+
this.setState({
133+
spinnerVisibility: false,
134+
});
135+
};
136+
137+
render() {
138+
const { spinnerVisibility } = this.state;
139+
return (
140+
<View>
141+
<SearchBar
142+
height={50}
143+
fontSize={24}
144+
fontColor="#fdfdfd"
145+
iconColor="#fdfdfd"
146+
shadowColor="#282828"
147+
cancelIconColor="#fdfdfd"
148+
backgroundColor="#ba312f"
149+
spinnerVisibility={spinnerVisibility}
150+
placeholder="Search any cosmetics ..."
151+
fontFamily="BurbankBigCondensed-Black"
152+
shadowStyle={styles.searchBarShadowStyle}
153+
onChangeText={this.handleOnChangeText}
154+
/>
155+
</View>
156+
);
157+
}
158+
}
159+
```
160+
107161
### Configuration - Props
108162

109163
| Property | Type | Default | Description |
@@ -136,6 +190,10 @@ You can check the example for the advanced usage
136190
| autoFocus | boolean | true | change the autoFocus mode for the TextInput |
137191
| noExtraMargin | boolean | false | remove extra padding on iPhone X devices |
138192
| onPressToFocus | boolean | false | when enable it, onPress will automatically focus on the TextInput and opens the soft virtual keyboard |
193+
| spinnerType | string | Circle | change the spinner type |
194+
| spinnerSize | number | default | change the spinner size |
195+
| spinnerColor | color | #fdfdfd | change the spinner color |
196+
| spinnerVisibility | boolean | false | change the spinner visibility |
139197

140198
## Expo Compatibility
141199

@@ -184,10 +242,10 @@ constructor() {
184242

185243
## [1.0.1](https://github.com/WrathChaos/react-native-dynamic-search-bar/tree/1.0.1) (2020-04-11)
186244

187-
* Typescript 😍
188-
* Fully refactored the code base 😇
189-
* Finally version 1.0 🥳
190-
* README is updated with new screenshots
245+
- Typescript 😍
246+
- Fully refactored the code base 😇
247+
- Finally version 1.0 🥳
248+
- README is updated with new screenshots
191249

192250
[Full Changelog](https://github.com/WrathChaos/react-native-dynamic-search-bar/releases/tag/1.0.1)
193251

@@ -198,7 +256,7 @@ constructor() {
198256
**Closed issues:**
199257

200258
- Missing backgroundColor and fontFamily from configuration props [\#22](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/22)
201-
- Module not found: Can't resolve '@expo/vector-icons/Fontisto' [\#19](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/19)
259+
- Module not found: Can't resolve '@expo/vector-icons/Fontisto' [\#19](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/19)
202260
- Expo install method is not working [\#18](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/18)
203261

204262
**Merged pull requests:**
@@ -214,7 +272,7 @@ constructor() {
214272

215273
**Closed issues:**
216274

217-
- How do you style the actual searchBar, I want to increase the height of the search bar. I don't see a prop like containerStyle [\#12](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/12)
275+
- How do you style the actual searchBar, I want to increase the height of the search bar. I don't see a prop like containerStyle [\#12](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/12)
218276
- react-native-iphone-x-helper module not found [\#8](https://github.com/WrathChaos/react-native-dynamic-search-bar/issues/8)
219277

220278
## [0.3.0](https://github.com/WrathChaos/react-native-dynamic-search-bar/tree/0.3.0) (2019-12-06)
@@ -272,9 +330,7 @@ constructor() {
272330

273331
[Full Changelog](https://github.com/WrathChaos/react-native-dynamic-search-bar/compare/53f0e9276ddb6a7edf52c5c70918b51d4c6f36b1...0.0.1)
274332

275-
276-
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
277-
333+
\* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_
278334

279335
## Author
280336

1.04 MB
Loading

lib/SearchBar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ interface IProps {
4242
cancelButtonDisable: boolean;
4343

4444
spinnerType: any;
45-
spinnerStyle: any;
4645
spinnerSize: number;
4746
spinnerColor: string;
4847
spinnerVisibility: boolean;
@@ -66,7 +65,6 @@ export default class SearchBar extends React.Component<IProps, IState> {
6665
spinnerType,
6766
spinnerSize,
6867
spinnerColor,
69-
spinnerStyle,
7068
spinnerVisibility,
7169
onPress,
7270
fontSize,

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-dynamic-search-bar",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Fully customizable and dynamic Search Bar for React Native.",
55
"keywords": [
66
"gradient",
@@ -35,6 +35,7 @@
3535
"peerDependencies": {
3636
"react": ">= 16.x.x",
3737
"react-native": ">= 0.55.x",
38+
"react-native-spinkit": ">= 1.5.0",
3839
"react-native-vector-icons": ">= 6.x.x",
3940
"react-native-dynamic-vector-icons": ">= x.x.x",
4041
"@freakycoder/react-native-helpers": ">= 0.1.0"
@@ -49,8 +50,8 @@
4950
"@freakycoder/react-native-helpers": "^0.1.2",
5051
"react": "16.9.0",
5152
"react-native": "0.61.5",
52-
"react-native-dynamic-vector-icons": "^0.2.2",
5353
"react-native-spinkit": "^1.5.0",
54-
"react-native-vector-icons": ">= 6.x.x"
54+
"react-native-vector-icons": "^6.6.0",
55+
"react-native-dynamic-vector-icons": "^0.2.2"
5556
}
5657
}

0 commit comments

Comments
 (0)