init repo
This commit is contained in:
23
src/app.js
Normal file
23
src/app.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import Layout from './components/layout';
|
||||
import { MantineProvider, ColorSchemeProvider } from '@mantine/core';
|
||||
import { AuthProvider } from './tools/auth-provider';
|
||||
import { Notifications } from '@mantine/notifications';
|
||||
import { useColorSchemeToggle } from './tools/color-scheme-toggle'
|
||||
|
||||
const App = () => {
|
||||
const [ colorScheme, toggleColorScheme ] = useColorSchemeToggle();
|
||||
return (
|
||||
<>
|
||||
<AuthProvider>
|
||||
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}>
|
||||
<MantineProvider withGlobalStyles withNormalizeCSS theme={{ colorScheme }}>
|
||||
<Notifications />
|
||||
<Layout />
|
||||
</MantineProvider>
|
||||
</ColorSchemeProvider>
|
||||
</AuthProvider>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
10
src/index.js
Normal file
10
src/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './app';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
11
src/setupProxy.js
Normal file
11
src/setupProxy.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.use(
|
||||
'/api',
|
||||
createProxyMiddleware({
|
||||
target: 'http://192.168.2.183:5500',
|
||||
changeOrigin: true,
|
||||
})
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user