Spaces:
Running
Running
Commit ·
1978b68
1
Parent(s): 681d8f4
commit 6
Browse files- src/index.js +22 -5
src/index.js
CHANGED
|
@@ -1,17 +1,34 @@
|
|
| 1 |
import React from 'react';
|
| 2 |
import ReactDOM from 'react-dom/client';
|
| 3 |
-
import './index.css';
|
| 4 |
import App from './App';
|
|
|
|
| 5 |
import reportWebVitals from './reportWebVitals';
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
const root = ReactDOM.createRoot(document.getElementById('root'));
|
| 8 |
root.render(
|
| 9 |
<React.StrictMode>
|
| 10 |
-
<
|
|
|
|
|
|
|
|
|
|
| 11 |
</React.StrictMode>
|
| 12 |
);
|
| 13 |
|
| 14 |
-
// If you want to start measuring performance in your app, pass a function
|
| 15 |
-
// to log results (for example: reportWebVitals(console.log))
|
| 16 |
-
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
| 17 |
reportWebVitals();
|
|
|
|
| 1 |
import React from 'react';
|
| 2 |
import ReactDOM from 'react-dom/client';
|
|
|
|
| 3 |
import App from './App';
|
| 4 |
+
import './index.css';
|
| 5 |
import reportWebVitals from './reportWebVitals';
|
| 6 |
|
| 7 |
+
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
| 8 |
+
import CssBaseline from '@mui/material/CssBaseline';
|
| 9 |
+
|
| 10 |
+
// ✅ Dark theme configuration
|
| 11 |
+
const darkTheme = createTheme({
|
| 12 |
+
palette: {
|
| 13 |
+
mode: 'dark',
|
| 14 |
+
primary: {
|
| 15 |
+
main: '#90caf9',
|
| 16 |
+
},
|
| 17 |
+
secondary: {
|
| 18 |
+
main: '#f48fb1',
|
| 19 |
+
},
|
| 20 |
+
},
|
| 21 |
+
});
|
| 22 |
+
|
| 23 |
+
// ✅ React 18 root rendering with MUI ThemeProvider
|
| 24 |
const root = ReactDOM.createRoot(document.getElementById('root'));
|
| 25 |
root.render(
|
| 26 |
<React.StrictMode>
|
| 27 |
+
<ThemeProvider theme={darkTheme}>
|
| 28 |
+
<CssBaseline />
|
| 29 |
+
<App />
|
| 30 |
+
</ThemeProvider>
|
| 31 |
</React.StrictMode>
|
| 32 |
);
|
| 33 |
|
|
|
|
|
|
|
|
|
|
| 34 |
reportWebVitals();
|