Skip to content

Commit ae2cf8e

Browse files
committed
Make the example run on Exponent
1 parent c262259 commit ae2cf8e

File tree

10 files changed

+56
-103
lines changed

10 files changed

+56
-103
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ React Native component for creating circular slider.
2525
Import Circular Slider
2626

2727
```js
28-
import { CircularSlider } from 'react-native-circular-slider';
28+
import CircularSlider from 'react-native-circular-slider';
2929
```
3030

3131
Use as follows:
@@ -69,16 +69,22 @@ You can configure the passing by following props:
6969

7070
## Working example app
7171

72-
You can find working example in the `example` directory of this repository. You can run it by:
72+
You can find working example in the `example` directory of this
73+
repository.
7374

74-
```sh
75-
git clone https://github.com/bgryszko/react-native-circular-slider.git
76-
cd react-native-circular-slider/example/Bedtime
77-
npm install
78-
open ios/Bedtime.xcodeproj
79-
```
80-
XCode will open. Click Run button and that's it.
75+
The easiest way to run it is with Exponent: https://getexponent.com/@community/bedtime
76+
77+
If you'd rather build it locally, follow these steps:
78+
79+
1. [Download XDE](https://docs.getexponent.com/versions/latest/introduction/installation.html)
80+
2. Clone the repo and install dependencies
8181

82+
```sh
83+
git clone https://github.com/bgryszko/react-native-circular-slider.git
84+
cd react-native-circular-slider/example/Bedtime
85+
npm install
86+
```
87+
3. Open the project with XDE
8288

8389
## License
8490

example/Bedtime/.babelrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"presets": ["react-native"]
3-
}
2+
"presets": [
3+
"babel-preset-exponent"
4+
]
5+
}

example/Bedtime/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ buck-out/
4040
\.buckd/
4141
android/app/libs
4242
*.keystore
43+
44+
.exponent

example/Bedtime/__tests__/index.android.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

example/Bedtime/__tests__/index.ios.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

example/Bedtime/exp.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Bedtime",
3+
"description": "react-native-circular-slider is a component for creating circular sliders, this example uses it to re-create Apple Bedtime.",
4+
"slug": "bedtime",
5+
"sdkVersion": "12.0.0",
6+
"version": "1.0.0",
7+
"orientation": "portrait",
8+
"primaryColor": "#cccccc",
9+
"iconUrl": "http://url.brentvatne.ca/YBqq.png",
10+
"loading": {
11+
"iconUrl": "http://url.brentvatne.ca/YBqq.png",
12+
"hideExponentText": false
13+
},
14+
"packagerOpts": {
15+
"assetExts": [
16+
"ttf"
17+
]
18+
}
19+
}

example/Bedtime/index.android.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

example/Bedtime/index.ios.js renamed to example/Bedtime/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import Exponent from 'exponent';
12
import React, { Component } from 'react';
2-
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
3+
import { StyleSheet, Text, View } from 'react-native';
34
import Svg, { G, Path } from 'react-native-svg';
45

56
import CircularSlider from 'react-native-circular-slider';
@@ -168,4 +169,4 @@ const styles = StyleSheet.create({
168169
}
169170
});
170171

171-
AppRegistry.registerComponent('Bedtime', () => Bedtime);
172+
Exponent.registerRootComponent(Bedtime);

example/Bedtime/package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"react-native-circular-slider": "^1.0.0",
11-
"react": "15.4.1",
12-
"react-native": "0.39.2",
13-
"react-native-svg": "^4.4.1"
14-
},
15-
"devDependencies": {
16-
"babel-jest": "18.0.0",
17-
"babel-preset-react-native": "1.9.1",
18-
"jest": "18.0.0",
19-
"react-test-renderer": "15.4.1"
10+
"react-native-circular-slider": "file:../..",
11+
"react": "~15.3.2",
12+
"react-native": "github:exponentjs/react-native#sdk-12.0.0",
13+
"@exponent/vector-icons": "~2.0.3",
14+
"exponent": "~12.0.3"
2015
},
2116
"jest": {
2217
"preset": "react-native"
23-
}
18+
},
19+
"main": "main.js"
2420
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-circular-slider",
33
"version": "1.0.0",
44
"description": "React Native component for creating circular slider",
5-
"main": "index.js",
5+
"main": "src/CircularSlider.js",
66
"repository": {
77
"type": "git",
88
"url": "git+ssh://git@github.com/bgryszko/react-native-circular-slider.git"
@@ -25,6 +25,10 @@
2525
"name": "Bart Gryszko",
2626
"email": "b@gryszko.com"
2727
},
28+
"files": [
29+
"src",
30+
"README.md"
31+
],
2832
"license": "MIT",
2933
"bugs": {
3034
"url": "https://github.com/bgryszko/react-native-circular-slider/issues"
@@ -33,6 +37,6 @@
3337
"dependencies": {
3438
"d3-interpolate": "^1.1.2",
3539
"lodash.range": "^3.2.0",
36-
"react-native-svg": "^4.4.1"
40+
"react-native-svg": ">=4.3.3"
3741
}
3842
}

0 commit comments

Comments
 (0)