mediasfu-reactnative-expo
Version:
mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r
22 lines • 1.41 kB
JavaScript
import React from 'react';
import ControlButtonsComponentTouch from '../../components/displayComponents/ControlButtonsComponentTouch';
import { getModernColors, resolveIsDarkMode } from '../core/modernTheme';
export const ModernControlButtonsComponentTouch = (props) => {
const hasLightModeAction = props.buttons.some((button) => button.name === 'Light Mode');
const hasDarkModeAction = props.buttons.some((button) => button.name === 'Dark Mode');
const isDarkMode = hasLightModeAction ? true : hasDarkModeAction ? false : resolveIsDarkMode(props);
const colors = getModernColors(isDarkMode);
const normalize = (value, fallback) => (isDarkMode && value === 'black' ? fallback : value ?? fallback);
return (<ControlButtonsComponentTouch {...props} buttons={props.buttons.filter((button) => button.show !== false).map((button) => ({
...button,
activeColor: normalize(button.activeColor, colors.invertedText),
inActiveColor: normalize(button.inActiveColor, colors.text),
color: normalize(button.color, colors.text),
backgroundColor: button.backgroundColor ?? {
default: button.active ? colors.accent : colors.surface,
pressed: colors.accentSoft,
},
}))}/>);
};
export default ModernControlButtonsComponentTouch;
//# sourceMappingURL=ModernControlButtonsComponentTouch.js.map