-
Notifications
You must be signed in to change notification settings - Fork 372
Expand file tree
/
Copy pathMessageInputTrailingView.tsx
More file actions
42 lines (36 loc) · 1.29 KB
/
MessageInputTrailingView.tsx
File metadata and controls
42 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import { StyleSheet } from 'react-native';
import Animated from 'react-native-reanimated';
import { OutputButtons } from './components/OutputButtons';
import { audioRecorderSelector } from './utils/audioRecorderSelectors';
import { useMessageInputContext } from '../../contexts/messageInputContext/MessageInputContext';
import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { useStateStore } from '../../hooks/useStateStore';
import { primitives } from '../../theme';
import { transitions } from '../../utils/transitions';
export const MessageInputTrailingView = () => {
const {
theme: {
messageComposer: { outputButtonsContainer },
},
} = useTheme();
const { audioRecorderManager } = useMessageInputContext();
const { micLocked, recordingStatus } = useStateStore(
audioRecorderManager.state,
audioRecorderSelector,
);
return (recordingStatus === 'idle' || recordingStatus === 'recording') && !micLocked ? (
<Animated.View
layout={transitions.layout200}
style={[styles.outputButtonsContainer, outputButtonsContainer]}
>
<OutputButtons />
</Animated.View>
) : null;
};
const styles = StyleSheet.create({
outputButtonsContainer: {
alignSelf: 'flex-end',
padding: primitives.spacingXs,
},
});