Skip to content

Commit 2b2fcdd

Browse files
committed
Consolidate functionality between nested components
1 parent ed19b33 commit 2b2fcdd

File tree

6 files changed

+19
-27
lines changed

6 files changed

+19
-27
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

33
// Spacer component
4-
export default styled.div`
5-
height: 35vh;
4+
export default styled.section`
5+
margin: 35vh 0pt;
66
`

src/pages/index.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,16 @@ import { Helmet } from 'react-helmet'
33
import { graphql, useStaticQuery } from 'gatsby'
44
import styled from 'styled-components'
55
import GlobalStyle from '../styling'
6-
import Spacer from '../components/spacer'
76
import Hero from '../sections/hero'
87
import About from '../sections/about'
98
import Projects from '../sections/projects'
109
import Work from '../sections/work'
1110
import Footer from '../sections/footer'
1211

1312
const StyledMain = styled.main`
14-
margin: 12pt;
15-
`
16-
17-
const WidthLockContainer = styled.div`
1813
margin: 0pt auto;
19-
padding-left: env(safe-area-inset-left, 0px);
20-
padding-right: env(safe-area-inset-right, 0pt);
14+
padding-left: calc(12pt + env(safe-area-inset-left, 0px));
15+
padding-right: calc(12pt + env(safe-area-inset-right, 0pt));
2116
max-width: 1200px;
2217
`
2318

@@ -43,19 +38,12 @@ export default function Home() {
4338
</Helmet>
4439
<GlobalStyle />
4540
<Hero/>
46-
<WidthLockContainer>
47-
<StyledMain>
48-
<Spacer />
49-
<About />
50-
<Spacer />
51-
<Projects />
52-
<Spacer />
53-
<Work />
54-
<Spacer />
55-
</StyledMain>
56-
</WidthLockContainer>
41+
<StyledMain>
42+
<About />
43+
<Projects />
44+
<Work />
45+
</StyledMain>
5746
<Footer />
58-
<Spacer />
5947
</div>
6048
)
6149
}

src/sections/about.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled from 'styled-components'
44
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
55
import { faGithub } from '@fortawesome/free-brands-svg-icons'
66
import { GatsbyImage, getImage } from 'gatsby-plugin-image'
7+
import Section from '../components/section'
78

89
const Grid = styled.div`
910
display: grid;
@@ -105,7 +106,7 @@ export default function About() {
105106
`)
106107

107108
return (
108-
<section id="about">
109+
<Section id="about">
109110
<h1
110111
data-sal="slide-up"
111112
data-sal-duration="500"
@@ -142,6 +143,6 @@ export default function About() {
142143
</StyledLink>
143144
</Description>
144145
</Grid>
145-
</section>
146+
</Section>
146147
)
147148
}

src/sections/footer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import styled from 'styled-components'
1111

1212
const StyledFooter = styled.footer`
13+
margin: 35vh 0px;
1314
padding: 12pt 0pt;
1415
text-align: center;
1516
color: var(--faded);

src/sections/projects.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'
66
import { faGithub } from '@fortawesome/free-brands-svg-icons'
77
import IconLink from '../components/iconlink'
88
import { GatsbyImage, getImage } from 'gatsby-plugin-image'
9+
import Section from '../components/section'
910
const githubLink = github => {
1011
let path = github.split('/')
1112
return `http:`
@@ -39,7 +40,7 @@ export default function Projects() {
3940

4041
// Render
4142
return (
42-
<section id="projects">
43+
<Section id="projects">
4344
<h1
4445
data-sal="slide-up"
4546
data-sal-duration="500"
@@ -85,6 +86,6 @@ export default function Projects() {
8586
)
8687
)}
8788
</Grid>
88-
</section>
89+
</Section>
8990
)
9091
}

src/sections/work.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22
import { useStaticQuery, graphql } from 'gatsby'
33
import styled from 'styled-components'
4+
import Section from '../components/section'
45

56
const Title = styled.h3`
67
font-weight: 600;
@@ -98,7 +99,7 @@ export default function Work() {
9899

99100
// Render
100101
return (
101-
<section id="work-experience">
102+
<Section id="work-experience">
102103
<h1
103104
data-sal="slide-up"
104105
data-sal-duration="500"
@@ -137,6 +138,6 @@ export default function Work() {
137138
)}
138139
</tbody>
139140
</WorkTable>
140-
</section>
141+
</Section>
141142
)
142143
}

0 commit comments

Comments
 (0)