UNPKG

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

34 lines 1.86 kB
import React from 'react'; import ControlButtonsComponent from '../../components/displayComponents/ControlButtonsComponent'; import { getModernColors, resolveIsDarkMode } from '../core/modernTheme'; export const ModernControlButtonsComponent = (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 (<ControlButtonsComponent {...props} buttonBackgroundColor={props.buttonBackgroundColor ?? { default: isDarkMode ? 'rgba(255,255,255,0.08)' : 'rgba(15, 23, 42, 0.08)', pressed: colors.accentSoft, }} 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, }, }))} buttonsContainerStyle={[ { padding: 6, borderRadius: 18, backgroundColor: colors.surface, borderWidth: 1, borderColor: colors.border, }, props.buttonsContainerStyle, ]}/>); }; export default ModernControlButtonsComponent; //# sourceMappingURL=ModernControlButtonsComponent.js.map