Skip to content

Commit a8ec1c5

Browse files
authored
Merge pull request #1 from troberts-28/release-v1.1.0
Add tests and README, plus various bug fixes
2 parents f0d9a71 + 42ac362 commit a8ec1c5

26 files changed

+5790
-474
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "🚀 release"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: 🚀 release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v1
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 16
18+
registry-url: https://registry.npmjs.org
19+
- name: Install dependencies
20+
run: yarn install
21+
- name: Release
22+
run: npm publish
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/unit-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "🧪 unit-test"
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: 🧪 unit-test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v1
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 16
18+
registry-url: https://registry.npmjs.org
19+
- name: Install react
20+
run: yarn add [email protected]
21+
- name: Install react-native
22+
run: yarn add [email protected]
23+
- name: Install dependencies
24+
run: yarn install -D
25+
- name: Test
26+
run: yarn test

README.md

Lines changed: 386 additions & 2 deletions
Large diffs are not rendered by default.

babel.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
presets: ["module:metro-react-native-babel-preset"],
3+
plugins: [
4+
["@babel/plugin-transform-flow-strip-types", { loose: true }],
5+
["@babel/plugin-transform-class-properties", { loose: true }],
6+
["@babel/plugin-transform-private-methods", { loose: true }],
7+
],
8+
};

demos/example1.gif

2.16 MB
Loading

demos/example2.gif

2.81 MB
Loading

demos/example3.gif

4.58 MB
Loading

demos/example4.gif

2.51 MB
Loading

example/App.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TouchableOpacity,
88
View,
99
} from "react-native";
10+
import { LinearGradient } from "expo-linear-gradient";
1011

1112
import { TimerPicker, TimerPickerModal } from "./src";
1213

@@ -63,7 +64,7 @@ export default function App() {
6364
modalTitle="Set Alarm"
6465
onCancel={() => setShowPickerExample1(false)}
6566
closeOnOverlayPress
66-
disableInfiniteScroll
67+
LinearGradient={LinearGradient}
6768
styles={{
6869
theme: "dark",
6970
}}
@@ -114,13 +115,10 @@ export default function App() {
114115
modalTitle="Set Alarm"
115116
onCancel={() => setShowPickerExample2(false)}
116117
closeOnOverlayPress
117-
disableInfiniteScroll
118+
LinearGradient={LinearGradient}
118119
styles={{
119120
theme: "light",
120121
}}
121-
modalProps={{
122-
overlayOpacity: 0.2,
123-
}}
124122
/>
125123
</View>
126124
);
@@ -134,6 +132,7 @@ export default function App() {
134132
hourLabel=":"
135133
minuteLabel=":"
136134
secondLabel=""
135+
LinearGradient={LinearGradient}
137136
styles={{
138137
theme: "dark",
139138
backgroundColor: "#202020",
@@ -161,6 +160,7 @@ export default function App() {
161160
hideHours
162161
minuteLabel="min"
163162
secondLabel="sec"
163+
LinearGradient={LinearGradient}
164164
styles={{
165165
theme: "light",
166166
pickerItem: {
@@ -194,7 +194,6 @@ export default function App() {
194194

195195
const styles = StyleSheet.create({
196196
container: {
197-
backgroundColor: "#514242",
198197
alignItems: "center",
199198
justifyContent: "center",
200199
width: screenWidth,
@@ -244,7 +243,6 @@ const styles = StyleSheet.create({
244243
},
245244
buttonLight: { borderColor: "#8C8C8C", color: "#8C8C8C" },
246245
buttonContainer: {
247-
flexDirection: "row",
248246
marginTop: 30,
249247
},
250248
});

example/babel.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module.exports = function(api) {
2-
api.cache(true);
3-
return {
4-
presets: ['babel-preset-expo'],
5-
};
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: ["babel-preset-expo"],
5+
};
66
};

0 commit comments

Comments
 (0)