From 7839ef9a52078df08132ddfaffdd8270cb80c012 Mon Sep 17 00:00:00 2001 From: Kyle Gill Date: Thu, 28 Mar 2019 15:36:51 -0600 Subject: [PATCH] feat: traversal of dates in Seek component --- src/App.js | 26 +++++++++++++++--------- src/components/Icon/Icon.js | 4 +++- src/components/Navbar/Navbar.js | 9 +++++---- src/components/Seek/Seek.js | 19 +++++++++++++++--- src/components/screens/Day/Day.js | 29 +++++++++++++++++++++++++-- src/components/screens/Month/Month.js | 27 +++++++++++++++++++++++-- src/components/screens/User/User.js | 25 ++++++++++++++--------- src/components/screens/Year/Year.js | 10 +++++---- src/styles/theme.js | 2 ++ 9 files changed, 115 insertions(+), 36 deletions(-) diff --git a/src/App.js b/src/App.js index b3ec444..cf70fb5 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,7 @@ import { withAuthentication } from "./components/session"; const RouteLayout = styled.div` margin: 0 auto; + padding: 0 10px; max-width: 720px; min-height: calc(100vh - 60px); background-color: ${props => props.theme.colors.bodyBackground}; @@ -30,15 +31,12 @@ class App extends Component { onChangeTheme = () => { const { selectedTheme } = this.state; const root = document.documentElement; - console.log(root); const newTheme = selectedTheme === "LIGHT" ? "DARK" : "LIGHT"; root.style.setProperty( "background-color", theme[newTheme].colors.bodyBackground ); - this.setState(prevState => ({ - selectedTheme: newTheme - })); + this.setState({ selectedTheme: newTheme }); }; render() { @@ -50,12 +48,20 @@ class App extends Component { - - - - - - + + + + + + diff --git a/src/components/Icon/Icon.js b/src/components/Icon/Icon.js index d854223..c88ca3b 100644 --- a/src/components/Icon/Icon.js +++ b/src/components/Icon/Icon.js @@ -7,6 +7,7 @@ import { ChevronRight, Circle, Moon, + Sun, User } from "react-feather"; import { withTheme } from "emotion-theming"; @@ -21,7 +22,7 @@ const IconBase = styled.div` transition: 0.1s all ease-in-out; color: ${props => props.theme.colors.secondary}; &:hover { - background-color: ${props => props.theme.colors.hover}; + background-color: ${props => !props.disabled && props.theme.colors.hover}; cursor: pointer; } `; @@ -34,6 +35,7 @@ const Icon = ({ name, ...rest }) => ( {name === "ChevronRight" && } {name === "Circle" && } {name === "Moon" && } + {name === "Sun" && } {name === "User" && } ); diff --git a/src/components/Navbar/Navbar.js b/src/components/Navbar/Navbar.js index be4b599..7565ef3 100644 --- a/src/components/Navbar/Navbar.js +++ b/src/components/Navbar/Navbar.js @@ -7,7 +7,6 @@ import { withTheme } from "emotion-theming"; import { todayUrl, yearUrl } from "../../utils/date"; import Icon from "../Icon"; -import SignOut from "../SignOut"; import { withAuthentication } from "../session"; const Header = styled.div` @@ -16,6 +15,7 @@ const Header = styled.div` display: grid; grid-template-areas: "... nav ..."; grid-template-columns: 1fr minmax(240px, 720px) 1fr; + grid-gap: 10px; align-items: center; border-width: 1px; border-color: ${props => props.theme.colors.quarternary}; @@ -43,7 +43,10 @@ const Navbar = ({ authUser, theme, toggleTheme }) => (