dark hihi
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import React from 'react';
|
||||
import '../src/styles/App.scss';
|
||||
import Router from "./config/Router";
|
||||
import ThemeContextProvider, {useTheme} from "./utils/contexts/ThemeContext";
|
||||
|
||||
function App() {
|
||||
|
||||
const {isDarkMode} = useTheme();
|
||||
|
||||
return (
|
||||
<div className={`app ${isDarkMode ? 'dark' : 'light'}`}>
|
||||
<Router/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
import ThemeContextProvider from "./utils/contexts/ThemeContext";
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById('root') as HTMLElement
|
||||
);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<ThemeContextProvider>
|
||||
<App />
|
||||
</ThemeContextProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import useTitle from "../../utils/hooks/TitleHook";
|
||||
import Card from "../components/Card";
|
||||
import {useTheme} from "../../utils/contexts/ThemeContext";
|
||||
|
||||
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
||||
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype');
|
||||
}
|
||||
|
||||
.app {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.mau {
|
||||
font-family: "Mau", serif;
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
@import "pointer";
|
||||
@import "theme";
|
||||
8
src/styles/utils/theme.scss
Normal file
8
src/styles/utils/theme.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
.dark {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
}
|
||||
.light {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
}
|
||||
@@ -24,3 +24,5 @@ const ThemeContextProvider = ({children}: any) => {
|
||||
</ThemeContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeContextProvider;
|
||||
Reference in New Issue
Block a user