aboutsummaryrefslogtreecommitdiff
path: root/modern/src/AppThemeProvider.js
blob: 0f1c5479ba6660dc0db1146b3d937d9e9f1e09b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import React from 'react';
import { useSelector } from 'react-redux';
import { ThemeProvider } from '@mui/material';
import theme from './common/theme';

const AppThemeProvider = ({ children }) => {
  const server = useSelector((state) => state.session.server);
  const themeInstance = theme(server);

  return (
    <ThemeProvider theme={themeInstance}>
      {children}
    </ThemeProvider>
  );
};

export default AppThemeProvider;