Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gbhasha committed Jul 25, 2018
1 parent 3fd2850 commit 58e47bd
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
11 changes: 4 additions & 7 deletions Example/ExampleMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,25 @@ class ExampleMain extends Component {
this.state = {
selectedIndex: 0,
badgesStyleIndex: 0,
customStyleIndex: 0,
customStyleIndex: 0
}
}

handleSingleIndexSelect = (index) => {
this.setState({
...this.state,
selectedIndex: index,
selectedIndex: index
});
}

handleBadgesSelect = (index) => {
this.setState({
...this.state,
badgesStyleIndex: index,
badgesStyleIndex: index
});
}

handleCustomIndexSelect = (index) => {
this.setState({
...this.state,
customStyleIndex: index,
customStyleIndex: index
});
}

Expand Down
13 changes: 13 additions & 0 deletions Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ Updating the `react-native-scripts` dependency of your app should be as simple a

Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility.

# Example
To run this example
1. create a symlink package from the root directory, as shown below:
```shell
npm link
```
2. switch to the example folder and then run `yarn start` command, which would launch the app on simulator using the [expo](https://expo.io/) app

```shell
cd Example
yarn start
```

## Available Scripts

If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.
Expand Down
3 changes: 3 additions & 0 deletions Example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-native-segmented-control-ui": "1.0.0"
"react-native-segmented-control-ui": "file:.."
}
}
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
A react native component similar to iOS SegmentedControl, Primarily built to support both IOS and Android.

# Example
To run example
To run the example
1. create a symlink package from the root directory, as shown below:
```shell
npm link
```
2. switch to the example folder and then run `yarn start` command, which would launch the app on simulator using the [expo](https://expo.io/) app

```shell
cd Example
Expand All @@ -25,19 +30,18 @@ yarn start
```javascript
import SegmentedControlTab from 'react-native-segmented-control-ui'

class ConsumerComponent extends Component {
const ConsumerComponent extends Component {

constructor(){
super()
this.state = {
selectedIndex: 0,
selectedIndex: 0
};
}

handleIndexChange = (index) => {
this.setState({
...this.state,
selectedIndex: index,
selectedIndex: index
});
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-segmented-control-ui",
"version": "1.0.0",
"version": "1.0.1",
"description": "SegmentedControl using react-native,support android and ios",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 58e47bd

Please sign in to comment.