chore: componentize footer

This commit is contained in:
Kyle Gill
2019-05-19 11:38:22 -06:00
parent 35e11d6134
commit a67744c31d
6 changed files with 70 additions and 66 deletions

View File

@@ -116,9 +116,7 @@ class Day extends React.Component {
}
componentDidUpdate(prevProps) {
// Typical usage (don't forget to compare props):
if (this.props.uri !== prevProps.uri) {
console.log("here we go")
const [
,
,

View File

@@ -6,9 +6,9 @@ import { withTheme } from "emotion-theming"
import { SIZES } from "styles/constants"
import { Button, P } from "components/elements"
import { todayUrl } from "utils/date"
import Icon from "components/Icon"
import Logo from "components/Logo"
import Footer from "components/Footer"
import { todayUrl } from "utils/date"
const StartGrid = styled.div`
margin-top: 30px;
@@ -39,21 +39,6 @@ const FeatureTitle = styled.div`
const FeatureDescription = styled.div`
color: ${props => props.theme.colors.secondary};
`
const Footer = styled.footer`
margin-top: 120px;
padding: 30px 0px;
text-align: center;
color: ${props => props.theme.colors.secondary};
`
const FooterLink = styled(Link)`
cursor: pointer;
color: ${props => props.theme.colors.secondary};
text-decoration: none;
margin: 10px;
&:hover {
color: ${props => props.theme.colors.tertiary};
}
`
const features = [
{
@@ -107,7 +92,7 @@ class Start extends Component {
display: "flex",
flexDirection: "column",
alignItems: "center",
margin: "30 auto",
marginTop: 30,
maxHeight: 350,
}}
>
@@ -181,17 +166,7 @@ class Start extends Component {
</FeatureRow>
))}
</FeatureGrid>
<Footer>
<div>
<Logo color={theme.colors.logo} />
</div>
<div>
<FooterLink>View on GitHub</FooterLink>
<FooterLink to="terms">Terms of Service</FooterLink>
<FooterLink to="privacy">Privacy Policy</FooterLink>
</div>
<div>&copy; 2019</div>
</Footer>
<Footer />
</StartGrid>
)
}

View File

@@ -5,6 +5,7 @@ import { withTheme } from "emotion-theming"
import { Button, P } from "components/elements"
import Logo from "components/Logo"
import Footer from "components/Footer"
import { todayUrl } from "utils/date"
const WelcomeGrid = styled.div`
@@ -13,21 +14,6 @@ const WelcomeGrid = styled.div`
color: ${props => props.theme.colors.primary};
height: 100%;
`
const Footer = styled.footer`
margin-top: 120px;
padding: 30px 0px;
text-align: center;
color: ${props => props.theme.colors.secondary};
`
const FooterLink = styled(Link)`
cursor: pointer;
color: ${props => props.theme.colors.secondary};
text-decoration: none;
margin: 10px;
&:hover {
color: ${props => props.theme.colors.tertiary};
}
`
class Welcome extends Component {
render() {
@@ -42,17 +28,7 @@ class Welcome extends Component {
<Link to={`/app${todayUrl()}`} style={{ textDecoration: "none" }}>
<Button colors={theme.colors}>Write about today</Button>
</Link>
<Footer>
<div>
<Logo color={theme.colors.logo} />
</div>
<div>
<FooterLink>View on GitHub</FooterLink>
<FooterLink to="terms">Terms of Service</FooterLink>
<FooterLink to="privacy">Privacy Policy</FooterLink>
</div>
<div>&copy; 2019</div>
</Footer>
<Footer />
</WelcomeGrid>
)
}