Skip to content

Commit 4da4b6e

Browse files
authored
Feature/#4 (#13)
* added possibility of changing default toast time on screen * finished time to dismiss feature
1 parent 7c02c07 commit 4da4b6e

File tree

12 files changed

+308
-165
lines changed

12 files changed

+308
-165
lines changed

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ PODS:
236236
- React-cxxreact (= 0.63.2)
237237
- React-jsi (= 0.63.2)
238238
- React-jsinspector (0.63.2)
239-
- react-native-safe-area-context (3.1.1):
239+
- react-native-safe-area-context (3.1.4):
240240
- React
241241
- React-RCTActionSheet (0.63.2):
242242
- React-Core/RCTActionSheetHeaders (= 0.63.2)
@@ -302,9 +302,9 @@ PODS:
302302
- React
303303
- RNGestureHandler (1.7.0):
304304
- React
305-
- RNReanimated (1.10.1):
305+
- RNReanimated (1.10.2):
306306
- React
307-
- RNScreens (2.9.0):
307+
- RNScreens (2.10.1):
308308
- React
309309
- Yoga (1.14.0)
310310
- YogaKit (1.18.1):
@@ -470,7 +470,7 @@ SPEC CHECKSUMS:
470470
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
471471
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
472472
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
473-
react-native-safe-area-context: 344b969c45af3d8464d36e8dea264942992ef033
473+
react-native-safe-area-context: eb91fe1fb3f7b87d9c30a7f0808407d8569d539d
474474
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
475475
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
476476
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
@@ -483,8 +483,8 @@ SPEC CHECKSUMS:
483483
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
484484
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
485485
RNGestureHandler: b6b359bb800ae399a9c8b27032bdbf7c18f08a08
486-
RNReanimated: c2bb7438b57a3d987bb2e4e6e4bca94787e30b02
487-
RNScreens: c526239bbe0e957b988dacc8d75ac94ec9cb19da
486+
RNReanimated: 7de2dca51deacff78bb880f63c1389a24311b376
487+
RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2
488488
Yoga: 7740b94929bbacbddda59bf115b5317e9a161598
489489
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
490490

example/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111
},
1212
"dependencies": {
1313
"@react-native-community/masked-view": "^0.1.10",
14-
"@react-navigation/native": "^5.7.2",
15-
"@react-navigation/stack": "^5.8.0",
14+
"@react-navigation/native": "^5.7.3",
15+
"@react-navigation/stack": "^5.9.0",
1616
"react": "16.13.1",
1717
"react-native": "0.63.2",
1818
"react-native-gesture-handler": "^1.7.0",
19-
"react-native-reanimated": "^1.10.1",
19+
"react-native-reanimated": "^1.10.2",
2020
"react-native-rooster": "file:.yalc/react-native-rooster",
21-
"react-native-safe-area-context": "^3.1.1",
22-
"react-native-screens": "^2.9.0",
21+
"react-native-safe-area-context": "^3.1.4",
22+
"react-native-screens": "^2.10.1",
2323
"styled-components": "^5.1.1"
2424
},
2525
"devDependencies": {
26-
"@babel/core": "^7.11.0",
27-
"@babel/runtime": "^7.11.0",
28-
"@types/jest": "^26.0.8",
29-
"@types/react-native": "^0.63.2",
30-
"@types/react-test-renderer": "^16.9.2",
31-
"@types/styled-components": "^5.1.1",
32-
"@typescript-eslint/eslint-plugin": "^3.7.1",
33-
"@typescript-eslint/parser": "^3.7.1",
26+
"@babel/core": "^7.11.1",
27+
"@babel/runtime": "^7.11.2",
28+
"@types/jest": "^26.0.9",
29+
"@types/react-native": "^0.63.5",
30+
"@types/react-test-renderer": "^16.9.3",
31+
"@types/styled-components": "^5.1.2",
32+
"@typescript-eslint/eslint-plugin": "^3.8.0",
33+
"@typescript-eslint/parser": "^3.8.0",
3434
"babel-jest": "^26.2.2",
35-
"eslint": "^7.5.0",
35+
"eslint": "^7.6.0",
3636
"eslint-config-airbnb": "^18.2.0",
3737
"eslint-config-prettier": "^6.11.0",
3838
"eslint-import-resolver-typescript": "^2.2.0",

example/src/pages/Home/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
22
import { useToast } from 'react-native-rooster';
33

44
import { Button } from 'react-native';
5+
56
import { Container, Label, TextInput } from './styles';
67

78
const Home: React.FC = () => {
@@ -35,6 +36,12 @@ const Home: React.FC = () => {
3536
});
3637
}, [setToastConfig]);
3738

39+
const handleChangeTimeToDismissOnPress = useCallback(() => {
40+
setToastConfig({
41+
timeToDismiss: 4000,
42+
});
43+
}, [setToastConfig]);
44+
3845
const handleRemoveToastOnPress = useCallback(() => {
3946
removeToast();
4047
}, [removeToast]);
@@ -69,6 +76,11 @@ const Home: React.FC = () => {
6976
title="Change font family to SpectralSC"
7077
onPress={handleChangeFontFamilyOnPress}
7178
/>
79+
80+
<Button
81+
title="Change time to dismiss to 4000ms"
82+
onPress={handleChangeTimeToDismissOnPress}
83+
/>
7284
<Button title="Remove Last Toast" onPress={handleRemoveToastOnPress} />
7385
</Container>
7486
);

example/yalc.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": "v1",
33
"packages": {
44
"react-native-rooster": {
5-
"signature": "75d78ae6df2a31e2b0c4f087698f5a7d",
5+
"signature": "9fc9647aba0dc577d08f76ccbe1c567d",
66
"file": true
77
}
88
}

0 commit comments

Comments
 (0)