Skip to content

Commit

Permalink
feat: add package json and example
Browse files Browse the repository at this point in the history
  • Loading branch information
HuyDo committed Oct 17, 2024
1 parent 754ccc3 commit 3c6f8e5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,22 @@ Then using our Addons component in ChatScreen
```javascript
import React from 'react'
import {ChatScreen as BaseChatScreen} from 'rn-firebase-chat'
import {CameraView, useCamera} from 'rn-firebase-chat/src/addons/camera'
import {
CameraView,
useCamera,
VoiceRecorderModalRef,
VoiceRecorderModal,
} from 'rn-firebase-chat/src/addons';

...

export const ChatScreen: React.FC = () => {
const {onPressCamera, onPressGallery} = useCamera()
const fileAttachmentRef = useRef<VoiceRecorderModalRef>(null);

const onPressAudio = useCallback(() => {
fileAttachmentRef.current?.show();
}, []);
return (
<BaseChatScreen
memberIds={[partnerInfo.id]}
Expand All @@ -127,9 +137,17 @@ export const ChatScreen: React.FC = () => {
hasGallery: true,
onPressCamera,
onPressGallery,
renderLeftCustomView: () => (
<Button onPress={onPressAudio} title="Audio" color="#000" />
),
}}
>
{({onSend}) => (<CameraView onSend={onSend} /> )}
{({onSend}) => (
<View>
<CameraView onSend={onSend} /> )
<VoiceRecorderModal ref={fileAttachmentRef} onSend={onSend} />
</View>
}
</BaseChatScreen>
)
}
Expand Down
11 changes: 1 addition & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"react-native-vision-camera": "^4.1.0",
"release-it": "^15.0.0",
"typescript": "^4.5.2",
"uuid": "^10.0.0",
"react-native-audio-recorder-player": "^3.6.11",
"react-native-fs": "^2.20.0",
"react-native-get-random-values": "^1.11.0",
Expand Down Expand Up @@ -169,14 +168,6 @@
"react-native-gifted-chat": "^2.6.3",
"react-native-image-picker": "^7.1.2",
"react-native-reanimated": "^3.15.3",
"react-native-safe-area-context": "^4.11.0",
"react-native-audio-recorder-player": "^3.6.11",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-svg": "^15.3.0",
"react-native-uuid": "^2.0.2",
"react-native-video": "^6.2.0",
"react-native-vision-camera": "^4.1.0",
"uuid": "^10.0.0"
"react-native-safe-area-context": "^4.11.0"
}
}
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8439,9 +8439,9 @@ react-native-parsed-text@^0.0.22:
prop-types "^15.7.x"

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

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

react-native-svg@^15.3.0:
version "15.7.1"
Expand Down

0 comments on commit 3c6f8e5

Please sign in to comment.