Skip to content

Commit cb95c1d

Browse files
authored
Merge pull request #48 from troberts-28/patch/v2.0.3
Patch v2.0.3
2 parents 5840ed1 + 9202971 commit cb95c1d

File tree

8 files changed

+271
-289
lines changed

8 files changed

+271
-289
lines changed

.github/workflows/unit-test.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
pull_request:
44
branches:
55
- main
6+
types:
7+
- opened # When PR is first created
8+
- synchronize # When new commits are pushed to the PR
9+
- reopened # When a closed PR is reopened
610

711
jobs:
812
release:
@@ -17,10 +21,10 @@ jobs:
1721
node-version: 20
1822
registry-url: https://registry.npmjs.org
1923
- name: Install react
20-
run: yarn add [email protected]
24+
run: yarn add [email protected] -D
2125
- name: Install react-native
22-
run: yarn add [email protected]
26+
run: yarn add [email protected] -D
2327
- name: Install dependencies
24-
run: yarn install -D
28+
run: yarn install
2529
- name: Test
2630
run: yarn test

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,10 @@ import { TimerPicker } from "react-native-timer-picker";
528528

529529
```
530530

531+
Please note that this solution does not work for all bottom-sheet components (e.g. `@tamagui/sheet`) as it depends on the implementation of each component.
532+
531533
**Important**:
532-
The custom component needs to have the same interface as React Native's `<FlatList />` in order for it to work as expected. A complete reference of the current usage can be found [here](/src/components/DurationScroll/index.tsx)
534+
The custom component needs to have the same interface as React Native's `<FlatList />` in order for it to work as expected. A complete reference of the current usage can be found [here](/src/components/DurationScroll/index.tsx).
533535

534536
#### Generic feedback
535537

examples/example-expo/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
},
1111
"dependencies": {
1212
"@expo/vector-icons": "^14.0.3",
13-
"expo": "^52.0.11",
14-
"expo-av": "~15.0.1",
15-
"expo-haptics": "~14.0.0",
16-
"expo-linear-gradient": "~14.0.1",
13+
"expo": "~52.0.31",
14+
"expo-av": "~15.0.2",
15+
"expo-haptics": "~14.0.1",
16+
"expo-linear-gradient": "~14.0.2",
1717
"react": "18.3.1",
18-
"react-native": "0.76.3"
18+
"react-native": "0.76.7"
1919
},
2020
"devDependencies": {
2121
"@babel/core": "^7.24.0",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": "https://github.com/troberts-28"
77
},
88
"license": "MIT",
9-
"version": "2.0.2",
9+
"version": "2.0.3",
1010
"main": "dist/commonjs/index.js",
1111
"module": "dist/module/index.js",
1212
"types": "dist/typescript/index.d.ts",

src/components/Modal/styles.ts

-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import { StyleSheet } from "react-native";
22

33
export const styles = StyleSheet.create({
4-
container: {
5-
position: "absolute",
6-
top: 0,
7-
left: 0,
8-
right: 0,
9-
bottom: 0,
10-
},
114
backdrop: {
125
position: "absolute",
136
top: 0,

src/components/TimerPicker/styles.ts

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const generateStyles = (
125125
},
126126
durationScrollFlatList: {
127127
minWidth: 1,
128+
width: "300%",
128129
...customStyles?.durationScrollFlatList,
129130
},
130131
durationScrollFlatListContainer: {

src/tests/DurationScroll.test.tsx

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ describe("DurationScroll", () => {
2424
const { getByTestId } = render(
2525
<DurationScroll
2626
aggressivelyGetLatestDuration={false}
27-
numberOfItems={1}
27+
interval={1}
28+
maximumValue={1}
2829
onDurationChange={onDurationChangeMock}
2930
padWithNItems={0}
31+
repeatNumbersNTimesNotExplicitlySet={true}
3032
styles={emptyStyles}
3133
testID="duration-scroll"
3234
/>
@@ -39,24 +41,28 @@ describe("DurationScroll", () => {
3941
const { getAllByTestId } = render(
4042
<DurationScroll
4143
aggressivelyGetLatestDuration={false}
42-
numberOfItems={2}
44+
interval={1}
45+
maximumValue={23}
4346
onDurationChange={onDurationChangeMock}
4447
padWithNItems={1}
48+
repeatNumbersNTimesNotExplicitlySet={true}
4549
styles={emptyStyles}
4650
/>
4751
);
4852
const items = getAllByTestId("picker-item");
49-
expect(items).toHaveLength(7);
53+
expect(items).toHaveLength(10);
5054
});
5155

5256
it("renders the label if provided", () => {
5357
const { getByText } = render(
5458
<DurationScroll
5559
aggressivelyGetLatestDuration={false}
60+
interval={1}
5661
label="Duration"
57-
numberOfItems={59}
62+
maximumValue={59}
5863
onDurationChange={onDurationChangeMock}
5964
padWithNItems={1}
65+
repeatNumbersNTimesNotExplicitlySet={true}
6066
styles={emptyStyles}
6167
/>
6268
);

0 commit comments

Comments
 (0)