46 lines
1.8 KiB
TypeScript
46 lines
1.8 KiB
TypeScript
// Metro module 10796 (f10797).
|
|
import { useMemo } from "react";
|
|
import GameConsoleStore from "../../../game_console/GameConsoleStore";
|
|
import useMuteStates from "../../useMuteStates";
|
|
import { useStateFromStores } from "../../../../_bundle/Module589";
|
|
import { createMuteHandler } from "../VoiceActionUtils";
|
|
import { VoicePanelRiveMicButton } from "../../../voice_panel/native/controls/buttons/VoicePanelRiveMicButton";
|
|
import { ToggledActionButton } from "./CallBarAction";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import Module10801 from "../../../../_bundle/Module10801";
|
|
import Module10802 from "../../../../_bundle/Module10802";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
export function ChannelCallMicButton(props) {
|
|
const { channel, isSmallSize } = props;
|
|
let disableTint = props.disableTint;
|
|
if (disableTint === void 0) {
|
|
disableTint = false;
|
|
}
|
|
let mute;
|
|
mute = void 0;
|
|
const muteStates = useMuteStates(channel);
|
|
const stateFromStores = useStateFromStores([GameConsoleStore], () => GameConsoleStore.getAwaitingRemoteSessionInfo() != null);
|
|
const muteHandler = createMuteHandler(muteStates, stateFromStores);
|
|
mute = muteHandler.mute;
|
|
const onPress = muteHandler.onPress;
|
|
const memo = useMemo(() => <VoicePanelRiveMicButton muted={mute} />, [mute]);
|
|
const props2 = {
|
|
appearsDisabled: stateFromStores,
|
|
accessibilityLabel: intl.string(t.B3zz0G),
|
|
onPress,
|
|
source: mute ? Module10801 : Module10802,
|
|
isActive: null,
|
|
isSmallSize: null,
|
|
lottieComponent: null,
|
|
tintColor: null
|
|
};
|
|
if (!disableTint) {
|
|
disableTint = mute;
|
|
}
|
|
props2.isActive = disableTint;
|
|
props2.isSmallSize = isSmallSize;
|
|
props2.lottieComponent = memo;
|
|
props2.tintColor = mute ? Module712.unsafe_rawColors.RED_400 : void 0;
|
|
return <ToggledActionButton {...props2} />;
|
|
}
|