2022-01-13 12:15:53 +00:00
|
|
|
// @flow
|
|
|
|
|
2022-03-18 14:16:56 +00:00
|
|
|
import React, { useCallback } from 'react';
|
2022-01-13 12:15:53 +00:00
|
|
|
import { TouchableOpacity } from 'react-native';
|
2022-03-18 14:16:56 +00:00
|
|
|
import { useDispatch } from 'react-redux';
|
2022-01-13 12:15:53 +00:00
|
|
|
|
|
|
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
|
|
|
import { RecordingLabel } from '../../../recording';
|
2022-03-18 14:16:56 +00:00
|
|
|
import { openHighlightDialog } from '../../../recording/actions.native';
|
|
|
|
import HighlightButton from '../../../recording/components/Recording/native/HighlightButton';
|
2023-02-14 15:24:38 +00:00
|
|
|
import VisitorsCountLabel from '../../../visitors/components/native/VisitorsCountLabel';
|
2022-01-13 12:15:53 +00:00
|
|
|
|
|
|
|
import RaisedHandsCountLabel from './RaisedHandsCountLabel';
|
|
|
|
import {
|
|
|
|
LABEL_ID_RAISED_HANDS_COUNT,
|
|
|
|
LABEL_ID_RECORDING,
|
2022-09-27 07:10:28 +00:00
|
|
|
LABEL_ID_STREAMING,
|
2023-02-14 15:24:38 +00:00
|
|
|
LABEL_ID_VISITORS_COUNT,
|
2022-09-27 07:10:28 +00:00
|
|
|
LabelHitSlop
|
2022-01-13 12:15:53 +00:00
|
|
|
} from './constants';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a function to be invoked when the onPress of the touchables are
|
|
|
|
* triggered.
|
|
|
|
*/
|
|
|
|
createOnPress: Function
|
|
|
|
}
|
|
|
|
|
2022-03-18 14:16:56 +00:00
|
|
|
const AlwaysOnLabels = ({ createOnPress }: Props) => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const openHighlightDialogCallback = useCallback(() => dispatch(openHighlightDialog()), [ dispatch ]);
|
|
|
|
|
|
|
|
return (<>
|
|
|
|
<TouchableOpacity
|
|
|
|
hitSlop = { LabelHitSlop }
|
|
|
|
onPress = { createOnPress(LABEL_ID_RECORDING) } >
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
|
|
</TouchableOpacity>
|
|
|
|
<TouchableOpacity
|
|
|
|
hitSlop = { LabelHitSlop }
|
|
|
|
onPress = { createOnPress(LABEL_ID_STREAMING) } >
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
|
|
</TouchableOpacity>
|
|
|
|
<TouchableOpacity
|
|
|
|
hitSlop = { LabelHitSlop }
|
|
|
|
onPress = { openHighlightDialogCallback }>
|
|
|
|
<HighlightButton />
|
|
|
|
</TouchableOpacity>
|
|
|
|
<TouchableOpacity
|
|
|
|
hitSlop = { LabelHitSlop }
|
|
|
|
onPress = { createOnPress(LABEL_ID_RAISED_HANDS_COUNT) } >
|
|
|
|
<RaisedHandsCountLabel />
|
|
|
|
</TouchableOpacity>
|
2023-02-14 15:24:38 +00:00
|
|
|
<TouchableOpacity
|
|
|
|
hitSlop = { LabelHitSlop }
|
|
|
|
onPress = { createOnPress(LABEL_ID_VISITORS_COUNT) } >
|
|
|
|
<VisitorsCountLabel />
|
|
|
|
</TouchableOpacity>
|
2022-03-18 14:16:56 +00:00
|
|
|
</>);
|
|
|
|
};
|
2022-01-13 12:15:53 +00:00
|
|
|
|
|
|
|
export default AlwaysOnLabels;
|