chore: constants file, styling, and seek component
This commit is contained in:
@@ -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>
|
||||
|
||||
29
src/components/Seek/Seek.js
Normal file
29
src/components/Seek/Seek.js
Normal 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;
|
||||
2
src/components/Seek/index.js
Normal file
2
src/components/Seek/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import Seek from "./Seek";
|
||||
export default Seek;
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user