"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7555/react/features/base/ui/components/JitsiThemeProvider.web.tsx" (28 Sep 2023, 1212 Bytes) of package /linux/misc/jitsi-meet-7555.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TSX (TypeScript with React) source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 import { StyledEngineProvider, ThemeProvider } from '@mui/material/styles';
    2 import * as React from 'react';
    3 import { connect } from 'react-redux';
    4 
    5 import { IReduxState } from '../../../app/types';
    6 
    7 import BaseTheme from './BaseTheme.web';
    8 
    9 interface IProps {
   10 
   11     /**
   12      * The default theme or theme set through advanced branding.
   13      */
   14     _theme: Object;
   15 
   16     /**
   17     * The children of the component.
   18     */
   19     children: React.ReactNode;
   20 }
   21 
   22 /**
   23  * The theme provider for the web app.
   24  *
   25  * @param {Object} props - The props of the component.
   26  * @returns {React.ReactNode}
   27  */
   28 function JitsiThemeProvider(props: IProps) {
   29     return (
   30         <StyledEngineProvider injectFirst = { true }>
   31             <ThemeProvider theme = { props._theme }>{ props.children }</ThemeProvider>
   32         </StyledEngineProvider>
   33     );
   34 }
   35 
   36 /**
   37  * Maps part of the Redux state to the props of this component.
   38  *
   39  * @param {Object} state - The Redux state.
   40  * @returns {IProps}
   41  */
   42 function _mapStateToProps(state: IReduxState) {
   43     const { muiBrandedTheme } = state['features/dynamic-branding'];
   44 
   45     return {
   46         _theme: muiBrandedTheme || BaseTheme
   47     };
   48 }
   49 
   50 export default connect(_mapStateToProps)(JitsiThemeProvider);