chore: additional theming implementation
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import React from "react";
|
||||
import styled from "@emotion/styled";
|
||||
import { Book, Calendar, Circle, User } from "react-feather";
|
||||
import {
|
||||
Book,
|
||||
Calendar,
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
Circle,
|
||||
Moon,
|
||||
User
|
||||
} from "react-feather";
|
||||
import { withTheme } from "emotion-theming";
|
||||
|
||||
const IconBase = styled.div`
|
||||
display: flex;
|
||||
@@ -10,18 +19,23 @@ const IconBase = styled.div`
|
||||
border-radius: 12px;
|
||||
padding: 5px;
|
||||
transition: 0.1s all ease-in-out;
|
||||
color: ${props => props.theme.colors.secondary};
|
||||
&:hover {
|
||||
background-color: yellow;
|
||||
background-color: ${props => props.theme.colors.hover};
|
||||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
|
||||
const Icon = ({ name }) => (
|
||||
<IconBase>
|
||||
const Icon = ({ name, ...rest }) => (
|
||||
<IconBase {...rest}>
|
||||
{name === "Book" && <Book />}
|
||||
{name === "Calendar" && <Calendar />}
|
||||
{name === "ChevronLeft" && <ChevronLeft />}
|
||||
{name === "ChevronRight" && <ChevronRight />}
|
||||
{name === "Circle" && <Circle />}
|
||||
{name === "Moon" && <Moon />}
|
||||
{name === "User" && <User />}
|
||||
</IconBase>
|
||||
);
|
||||
|
||||
export default Icon;
|
||||
export default withTheme(Icon);
|
||||
|
||||
@@ -11,12 +11,15 @@ import SignOut from "../SignOut";
|
||||
import { withAuthentication } from "../session";
|
||||
|
||||
const Header = styled.div`
|
||||
background-color: ${props => props.theme.colors.background};
|
||||
background-color: ${props => props.theme.colors.headerBackground};
|
||||
height: 60px;
|
||||
display: grid;
|
||||
grid-template-areas: "... nav ...";
|
||||
grid-template-columns: 1fr minmax(240px, 720px) 1fr;
|
||||
align-items: center;
|
||||
border-width: 1px;
|
||||
border-color: ${props => props.theme.colors.quarternary};
|
||||
border-style: solid;
|
||||
`;
|
||||
const Nav = styled.div`
|
||||
grid-area: nav;
|
||||
@@ -35,17 +38,24 @@ const NavIcons = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const Navbar = ({ authUser, theme }) => (
|
||||
const Navbar = ({ authUser, theme, toggleTheme }) => (
|
||||
<Header>
|
||||
<Nav>
|
||||
<Logo>Logo</Logo>
|
||||
<NavIcons>
|
||||
<Icon onClick={() => toggleTheme()} name="Moon" />
|
||||
{authUser ? (
|
||||
<React.Fragment>
|
||||
<Link to={yearUrl()}>Year</Link>
|
||||
<Link to={todayUrl()}>Today</Link>
|
||||
<Link to={"/user"}>Account</Link>
|
||||
<Icon name="Book" />
|
||||
<Link to={yearUrl()}>
|
||||
<Icon name="Calendar" />
|
||||
</Link>
|
||||
<Link to={todayUrl()}>
|
||||
<Icon name="Book" />
|
||||
</Link>
|
||||
<Link to={"/user"}>
|
||||
<Icon name="User" />
|
||||
</Link>
|
||||
|
||||
<SignOut />
|
||||
</React.Fragment>
|
||||
) : (
|
||||
|
||||
@@ -1,31 +1,38 @@
|
||||
import React from "react";
|
||||
import styled from "@emotion/styled";
|
||||
import { withTheme } from "emotion-theming";
|
||||
|
||||
import { SIZES } from "../../styles/constants";
|
||||
import Icon from "../Icon";
|
||||
|
||||
const SeekHeader = styled.header`
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
border-color: ${props => props.theme.colors.quarternary};
|
||||
`;
|
||||
const SeekH1 = styled.h1`
|
||||
display: block;
|
||||
font-size: ${SIZES.normal};
|
||||
color: ${props => props.theme.colors.secondary};
|
||||
`;
|
||||
const SeekArrows = styled.div``;
|
||||
const SeekHr = styled.hr`
|
||||
margin: 0;
|
||||
const SeekArrows = styled.div`
|
||||
display: grid;
|
||||
grid-template-columns: auto auto;
|
||||
grid-gap: 10px;
|
||||
`;
|
||||
|
||||
const Seek = ({ title = "", prev = "", next = "" }) => (
|
||||
<React.Fragment>
|
||||
<SeekHeader>
|
||||
<SeekH1>{title}</SeekH1>
|
||||
<SeekArrows>asdf</SeekArrows>
|
||||
</SeekHeader>
|
||||
<SeekHr />
|
||||
</React.Fragment>
|
||||
<SeekHeader>
|
||||
<SeekH1>{title}</SeekH1>
|
||||
<SeekArrows>
|
||||
<Icon name="ChevronLeft" />
|
||||
<Icon name="ChevronRight" />
|
||||
</SeekArrows>
|
||||
</SeekHeader>
|
||||
);
|
||||
|
||||
export default Seek;
|
||||
export default withTheme(Seek);
|
||||
|
||||
Reference in New Issue
Block a user