dark hihi
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import '../src/styles/App.scss';
|
import '../src/styles/App.scss';
|
||||||
import Router from "./config/Router";
|
import Router from "./config/Router";
|
||||||
|
import ThemeContextProvider, {useTheme} from "./utils/contexts/ThemeContext";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
|
const {isDarkMode} = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className={`app ${isDarkMode ? 'dark' : 'light'}`}>
|
||||||
<Router/>
|
<Router/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
|
import ThemeContextProvider from "./utils/contexts/ThemeContext";
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(
|
const root = ReactDOM.createRoot(
|
||||||
document.getElementById('root') as HTMLElement
|
document.getElementById('root') as HTMLElement
|
||||||
);
|
);
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
|
<ThemeContextProvider>
|
||||||
<App />
|
<App />
|
||||||
|
</ThemeContextProvider>
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import useTitle from "../../utils/hooks/TitleHook";
|
import useTitle from "../../utils/hooks/TitleHook";
|
||||||
import Card from "../components/Card";
|
import Card from "../components/Card";
|
||||||
|
import {useTheme} from "../../utils/contexts/ThemeContext";
|
||||||
|
|
||||||
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
||||||
|
|
||||||
@@ -26,11 +27,11 @@ const MainLobby = () => {
|
|||||||
<div className={"main-lobby__container"}>
|
<div className={"main-lobby__container"}>
|
||||||
<div className={"main-lobby__container-button clickable"} onClick={handleCreateRoom}>
|
<div className={"main-lobby__container-button clickable"} onClick={handleCreateRoom}>
|
||||||
<h2 className={"mau"}>Host Game</h2>
|
<h2 className={"mau"}>Host Game</h2>
|
||||||
<Card cardString={'SPADES ACE'} isClickable />
|
<Card cardString={'SPADES ACE'} isClickable/>
|
||||||
</div>
|
</div>
|
||||||
<div className={"main-lobby__container-button clickable"} onClick={gotoRooms}>
|
<div className={"main-lobby__container-button clickable"} onClick={gotoRooms}>
|
||||||
<h2 className={"mau"}>Join Game</h2>
|
<h2 className={"mau"}>Join Game</h2>
|
||||||
<Card cardString={'SPADES ACE'} isHidden isClickable />
|
<Card cardString={'SPADES ACE'} isHidden isClickable/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype');
|
src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
.mau {
|
.mau {
|
||||||
font-family: "Mau", serif;
|
font-family: "Mau", serif;
|
||||||
}
|
}
|
||||||
@@ -1 +1,2 @@
|
|||||||
@import "pointer";
|
@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>
|
</ThemeContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default ThemeContextProvider;
|
||||||
Reference in New Issue
Block a user