chore: constants file, styling, and seek component

This commit is contained in:
Kyle Gill
2019-03-27 16:55:23 -06:00
parent f71fb0bb52
commit 043acd30cf
10 changed files with 103 additions and 9 deletions

View File

@@ -2,6 +2,8 @@ import React from "react";
import { Link } from "react-router-dom";
import styled from "@emotion/styled";
import { todayUrl, yearUrl, urls } from "../../utils/date";
import SignOut from "../SignOut";
import { withAuthentication } from "../session";
@@ -37,6 +39,8 @@ const Navbar = ({ authUser }) => (
<NavIcons>
{authUser ? (
<React.Fragment>
<Link to={yearUrl()}>Year</Link>
<Link to={todayUrl()}>Today</Link>
<Link to={"/user"}>Account</Link>
<SignOut />
</React.Fragment>

View File

@@ -0,0 +1,29 @@
import React from "react";
import styled from "@emotion/styled";
import { SIZES } from "../../styles/constants";
const SeekHeader = styled.header`
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: ${SIZES.normal};
`;
const SeekH1 = styled.h1`
display: block;
font-size: ${SIZES.normal};
`;
const SeekArrows = styled.div``;
const Seek = ({ title = "", prev = "", next = "" }) => (
<React.Fragment>
<SeekHeader>
<SeekH1>{title}</SeekH1>
<SeekArrows>asdf</SeekArrows>
</SeekHeader>
<hr />
</React.Fragment>
);
export default Seek;

View File

@@ -0,0 +1,2 @@
import Seek from "./Seek";
export default Seek;

View File

@@ -27,7 +27,10 @@ class Firebase {
doSignInWithEmailAndPassword = (email, password) =>
this.auth.signInWithEmailAndPassword(email, password);
doSignOut = () => this.auth.signOut();
doSignOut = () => {
this.auth.signOut();
window.location.replace("/login");
};
doPasswordReset = email => this.auth.sendPasswordResetEmail(email);

View File

@@ -1,5 +1,26 @@
import React from "react";
import React, { Component } from "react";
import isToday from "date-fns/is_today";
const Year = () => <div>Year</div>;
import Seek from "../../Seek";
class Year extends Component {
render() {
const {
match: {
params: { year }
}
} = this.props;
return (
<div>
<Seek
title={year}
prev={"Asdf"}
next={"asdf"}
disableNext={isToday(new Date())}
/>
</div>
);
}
}
export default Year;