feat: user page

This commit is contained in:
Kyle Gill
2019-03-29 11:03:44 -06:00
parent eee11f9437
commit f3ac895199
6 changed files with 89 additions and 20 deletions

View File

@@ -1,8 +1,34 @@
import React from "react"
import styled from "@emotion/styled"
import { compose } from "recompose"
import { withFirebase } from "../../firebase"
import { withAuthentication } from "../../session"
import { SIZES } from "../../../styles/constants"
import SignOut from "../../SignOut"
const ProfileGrid = styled.div`
display: grid;
grid-template-rows: 1fr;
grid-gap: 20px;
`
const ProfileSection = styled.div`
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
padding: 10px 0;
`
const ProfileSectionHeader = styled.h2`
font-size: ${SIZES.normal};
color: ${props => props.theme.colors.tertiary};
`
const ProfileSectionText = styled.span`
font-size: ${SIZES.normal};
color: ${props => props.theme.colors.secondary};
`
class User extends React.Component {
state = {
name: "",
@@ -28,22 +54,22 @@ class User extends React.Component {
}
render() {
const { authUser } = this.props
return (
<React.Fragment>
<SignOut />
<form onSubmit={this.addUser}>
<input
type="text"
name="name"
placeholder="Name"
onChange={this.updateInput}
value={this.state.name}
/>
<button type="submit">Submit</button>
</form>
</React.Fragment>
<ProfileGrid>
<ProfileSection>
<ProfileSectionHeader>
User: <ProfileSectionText>{authUser.email}</ProfileSectionText>
</ProfileSectionHeader>
<SignOut />
</ProfileSection>
{/* <ProfileSection>Export Entries</ProfileSection> */}
</ProfileGrid>
)
}
}
export default withFirebase(User)
export default compose(
withFirebase,
withAuthentication
)(User)