This commit is contained in:
Maciej Caderek
2022-04-12 02:08:11 +02:00
parent a73c23b83a
commit e4bad17c0a
7 changed files with 96 additions and 2 deletions

View File

@@ -2,14 +2,16 @@ import { Component, Show } from "solid-js";
import type { DeepReadonly } from "solid-js/store";
import { Handlers } from "../types";
import { State, state } from "../state";
import { setState, State, state } from "../state";
import Header from "./components/Header";
import GameTabs from "./components/GameTabs";
import SetupTabs from "./components/SetupTabs";
import Controls from "./components/Controls";
import Popup from "./components/Popup";
import "./App.css";
import saveConfig from "../persistance/saveConfig";
const App: Component<{ handlers: Handlers; state: DeepReadonly<State> }> = (
props
@@ -42,6 +44,17 @@ const App: Component<{ handlers: Handlers; state: DeepReadonly<State> }> = (
></GameTabs>
</div>
</div>
<Show when={state.siteConfig.wrongBrowserPopup}>
<Popup
handlers={props.handlers}
onClose={() => {
setState("siteConfig", "wrongBrowserPopup", false);
saveConfig("site");
}}
>
{state.browser} | {state.os}
</Popup>
</Show>
</div>
);
};

View File

@@ -0,0 +1,34 @@
.popup {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
background-color: rgba(0, 0, 0, 0.5);
padding: 2rem;
display: grid;
vertical-align: middle;
}
.popup__box {
background-color: var(--color-bg-block);
max-width: 300px;
width: 100%;
margin: auto;
padding: 2rem;
border-radius: 0.5rem;
box-shadow: 0 0 2rem #00000099;
position: relative;
}
.popup__close {
width: 3.2rem;
position: absolute;
top: 1rem;
right: 1rem;
}
.popup__title {
text-align: left;
margin: 0 4.2rem 2rem 0;
/* background-color: aqua; */
}

View File

@@ -0,0 +1,23 @@
import { Component } from "solid-js";
import { Handlers } from "../../types";
import { state, setState } from "../../state";
import "./Popup.css";
const Popup: Component<{ handlers: Handlers; onClose: () => void }> = (
props
) => {
return (
<div className="popup">
<div className="popup__box">
<button className="popup__close" onClick={props.onClose}>
<i class="las la-times"></i>
</button>
<h2 className="popup__title">Popup title</h2>
<div className="popup__content">{props.children}</div>
</div>
</div>
);
};
export default Popup;