Skip to content

Commit 3c6f8e5

Browse files
author
HuyDo
committed
feat: add package json and example
1 parent 754ccc3 commit 3c6f8e5

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,22 @@ Then using our Addons component in ChatScreen
112112
```javascript
113113
import React from 'react'
114114
import {ChatScreen as BaseChatScreen} from 'rn-firebase-chat'
115-
import {CameraView, useCamera} from 'rn-firebase-chat/src/addons/camera'
115+
import {
116+
CameraView,
117+
useCamera,
118+
VoiceRecorderModalRef,
119+
VoiceRecorderModal,
120+
} from 'rn-firebase-chat/src/addons';
116121

117122
...
118123

119124
export const ChatScreen: React.FC = () => {
120125
const {onPressCamera, onPressGallery} = useCamera()
126+
const fileAttachmentRef = useRef<VoiceRecorderModalRef>(null);
127+
128+
const onPressAudio = useCallback(() => {
129+
fileAttachmentRef.current?.show();
130+
}, []);
121131
return (
122132
<BaseChatScreen
123133
memberIds={[partnerInfo.id]}
@@ -127,9 +137,17 @@ export const ChatScreen: React.FC = () => {
127137
hasGallery: true,
128138
onPressCamera,
129139
onPressGallery,
140+
renderLeftCustomView: () => (
141+
<Button onPress={onPressAudio} title="Audio" color="#000" />
142+
),
130143
}}
131144
>
132-
{({onSend}) => (<CameraView onSend={onSend} /> )}
145+
{({onSend}) => (
146+
<View>
147+
<CameraView onSend={onSend} /> )
148+
<VoiceRecorderModal ref={fileAttachmentRef} onSend={onSend} />
149+
</View>
150+
}
133151
</BaseChatScreen>
134152
)
135153
}

package.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"react-native-vision-camera": "^4.1.0",
6464
"release-it": "^15.0.0",
6565
"typescript": "^4.5.2",
66-
"uuid": "^10.0.0",
6766
"react-native-audio-recorder-player": "^3.6.11",
6867
"react-native-fs": "^2.20.0",
6968
"react-native-get-random-values": "^1.11.0",
@@ -169,14 +168,6 @@
169168
"react-native-gifted-chat": "^2.6.3",
170169
"react-native-image-picker": "^7.1.2",
171170
"react-native-reanimated": "^3.15.3",
172-
"react-native-safe-area-context": "^4.11.0",
173-
"react-native-audio-recorder-player": "^3.6.11",
174-
"react-native-fast-image": "^8.6.3",
175-
"react-native-fs": "^2.20.0",
176-
"react-native-svg": "^15.3.0",
177-
"react-native-uuid": "^2.0.2",
178-
"react-native-video": "^6.2.0",
179-
"react-native-vision-camera": "^4.1.0",
180-
"uuid": "^10.0.0"
171+
"react-native-safe-area-context": "^4.11.0"
181172
}
182173
}

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8439,9 +8439,9 @@ react-native-parsed-text@^0.0.22:
84398439
prop-types "^15.7.x"
84408440

84418441
react-native-reanimated@^3.15.3:
8442-
version "3.15.3"
8443-
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.15.3.tgz#580b5c1cb5a9f85e44b2850640514513d76e350d"
8444-
integrity sha512-5QBk/7PZvZ98Adxm4MRyglwzsRzReTQIe4Hd2wbBBAZ68IC4OYKvsc8cPEjgx3/1mG8HgHFYhbcDe5U2RjeFqw==
8442+
version "3.15.5"
8443+
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.15.5.tgz#c92085f054ddfc37b2b5489b7eadfc74da33e1f7"
8444+
integrity sha512-admqeZ0w235vQqYPy+IUgmHu5gwKi9+b7AQRV1yIK3MbAMLYx+RY+tTUtx1CNE5X+rNZ6eSQssW5z77yTwIusg==
84458445
dependencies:
84468446
"@babel/plugin-transform-arrow-functions" "^7.0.0-0"
84478447
"@babel/plugin-transform-class-properties" "^7.0.0-0"
@@ -8456,9 +8456,9 @@ react-native-reanimated@^3.15.3:
84568456
invariant "^2.2.4"
84578457

84588458
react-native-safe-area-context@^4.11.0:
8459-
version "4.11.0"
8460-
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.11.0.tgz#d45271363672dc1923ddb0ce5a6ad588e210c85d"
8461-
integrity sha512-Bg7bozxEB+ZS+H3tVYs5yY1cvxNXgR6nRQwpSMkYR9IN5CbxohLnSprrOPG/ostTCd4F6iCk0c51pExEhifSKQ==
8459+
version "4.11.1"
8460+
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.11.1.tgz#dae959f4512ca125f087a44c16b2c23de10b0e29"
8461+
integrity sha512-urF1m4nFiZFaWjsv2zj8J/hKvo4b2tJW+6CYU1mY4lKv1RwhG2eV8J/EHKuNlLhATZx3+6j7szrpHrQW2ZcAaQ==
84628462

84638463
react-native-svg@^15.3.0:
84648464
version "15.7.1"

0 commit comments

Comments
 (0)