Added light theme

This commit is contained in:
Mitchell McCaffrey 2020-04-26 19:04:18 +10:00
parent 506f0287ab
commit 4f5f4706c6
5 changed files with 62 additions and 36 deletions

View File

@ -128,7 +128,7 @@ function MapTile({
}}
p={2}
>
<Text as="p" variant="heading">
<Text as="p" variant="heading" color="hsl(210, 50%, 96%)">
{map.name}
</Text>
</Flex>

View File

@ -55,12 +55,12 @@ function Party({
</Box>
<Flex sx={{ flexDirection: "column" }}>
<ChangeNicknameButton nickname={nickname} onChange={onNicknameChange} />
<AddPartyMemberButton gameId={gameId} />
<StartStreamButton
onStreamStart={onStreamStart}
onStreamEnd={onStreamEnd}
stream={stream}
/>
<AddPartyMemberButton gameId={gameId} />
<SettingsButton />
</Flex>
</Flex>

View File

@ -39,6 +39,7 @@ function TokenLabel({ label }) {
verticalAlign: "middle",
lineHeight: 1.4,
}}
color="hsl(210, 50%, 96%)"
>
{label}
</Text>

View File

@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Box, Label, Flex, Button } from "theme-ui";
import { Box, Label, Flex, Button, useColorMode, Checkbox } from "theme-ui";
import Modal from "../components/Modal";
@ -13,10 +13,23 @@ function SettingsModal({ isOpen, onRequestClose }) {
window.location.reload();
}
const [colorMode, setColorMode] = useColorMode();
return (
<>
<Modal isOpen={isOpen} onRequestClose={onRequestClose}>
<Box>
<Flex sx={{ flexDirection: "column" }}>
<Label py={2}>Settings</Label>
<Label py={2}>
Light theme
<Checkbox
checked={colorMode === "light"}
onChange={(e) =>
setColorMode(e.target.checked ? "light" : "default")
}
pl={1}
/>
</Label>
<Flex py={2}>
<Button
sx={{ flexGrow: 1 }}
@ -25,6 +38,8 @@ function SettingsModal({ isOpen, onRequestClose }) {
Erase all content and reset
</Button>
</Flex>
</Flex>
</Modal>
<Modal
isOpen={isDeleteModalOpen}
onRequestClose={() => setIsDeleteModalOpen(false)}
@ -45,8 +60,7 @@ function SettingsModal({ isOpen, onRequestClose }) {
</Flex>
</Box>
</Modal>
</Box>
</Modal>
</>
);
}

View File

@ -9,6 +9,17 @@ export default {
muted: "hsla(230, 20%, 0%, 20%)",
gray: "hsl(0, 0%, 70%)",
overlay: "hsla(230, 25%, 18%, 0.8)",
modes: {
light: {
text: "hsl(10, 20%, 20%)",
background: "hsl(10, 10%, 98%)",
primary: "hsl(260, 100%, 80%)",
secondary: "hsl(290, 100%, 80%)",
highlight: "hsl(260, 20%, 40%)",
muted: "hsla(230, 20%, 60%, 20%)",
overlay: "hsla(230, 100%, 97%, 0.8)",
},
},
},
fonts: {
body: "'Bree Serif', serif",