File tree Expand file tree Collapse file tree 7 files changed +65
-10
lines changed
Expand file tree Collapse file tree 7 files changed +65
-10
lines changed Original file line number Diff line number Diff line change 1717 }
1818 }
1919
20+ & --primary {
21+ position : static;
22+ background : var (--primary-color );
23+ }
24+
2025 & --logo {
2126 width : 10rem ;
2227 height : 10rem ;
Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
2+ import { Link , navigate } from 'gatsby' ;
3+ import classnames from 'classnames' ;
24
35import Container from '../container' ;
46import Logo from '../logo' ;
57
68import './index.css' ;
79
810export default class Header extends Component {
9- onNavClick ( e ) {
11+ static defaultProps = {
12+ variant : 'transparent' ,
13+ } ;
14+
15+ onNavClick = e => {
1016 e . preventDefault ( ) ;
1117
1218 const target = e . target ;
1319 const destinationId = target . getAttribute ( 'data-destination' ) ;
20+
21+ if ( this . props . variant === 'primary' ) {
22+ navigate ( `/#${ destinationId } ` ) ;
23+ return ;
24+ }
25+
1426 const destinationDom = window . document . querySelector ( `#${ destinationId } ` ) ;
1527
1628 if ( ! destinationDom ) {
@@ -21,13 +33,21 @@ export default class Header extends Component {
2133 top : destinationDom . offsetTop ,
2234 behavior : 'smooth' ,
2335 } ) ;
24- }
36+ } ;
2537
2638 render ( ) {
39+ const { variant } = this . props ;
40+
2741 return (
28- < div className = "Header" >
42+ < div
43+ className = { classnames ( 'Header' , {
44+ 'Header--primary' : variant === 'primary' ,
45+ } ) }
46+ >
2947 < Container size = "large" >
30- < Logo />
48+ < Link to = "/" >
49+ < Logo />
50+ </ Link >
3151 < ul className = "Header--links" >
3252 < li >
3353 < a
Original file line number Diff line number Diff line change @@ -2,14 +2,16 @@ import React from 'react';
22import PropTypes from 'prop-types' ;
33
44import Footer from '../footer' ;
5+ import Header from '../header' ;
56
67import './reset.css' ;
78import './theme.css' ;
89import './fonts.css' ;
910import './typography.css' ;
1011
11- const Layout = ( { children } ) => (
12+ const Layout = ( { children, is404 } ) => (
1213 < >
14+ < Header variant = { is404 ? 'primary' : 'transparent' } />
1315 < main > { children } </ main >
1416 < Footer />
1517 </ >
Original file line number Diff line number Diff line change 2828 --grid-columns : 1fr 1fr 1fr ;
2929 }
3030}
31+
32+ # ___gatsby {
33+ min-height : 100vh ;
34+ }
35+
36+ # gatsby-focus-wrapper {
37+ display : flex;
38+ flex-direction : column;
39+
40+ min-height : 100vh ;
41+ }
42+
43+ main {
44+ flex-grow : 1 ;
45+ }
Original file line number Diff line number Diff line change 1+ .page-404 {
2+ margin-top : 5rem ;
3+ margin-bottom : 5rem ;
4+ }
Original file line number Diff line number Diff line change @@ -2,12 +2,23 @@ import React from 'react';
22
33import Layout from '../components/layout' ;
44import SEO from '../components/seo' ;
5+ import Container from '../components/container' ;
6+
7+ import './404.css' ;
58
69const NotFoundPage = ( ) => (
7- < Layout >
10+ < Layout is404 >
811 < SEO title = "404: Not found" />
9- < h1 > NOT FOUND</ h1 >
10- < p > You just hit a route that doesn't exist... the sadness.</ p >
12+ < Container className = "page-404" size = "medium" >
13+ < h1 > Oh no :(</ h1 >
14+ < p >
15+ Can't find any{ ' ' }
16+ < span role = "image" aria-label = "pizza" >
17+ 🍕
18+ </ span > { ' ' }
19+ here
20+ </ p >
21+ </ Container >
1122 </ Layout >
1223) ;
1324
Original file line number Diff line number Diff line change @@ -2,15 +2,13 @@ import React from 'react';
22
33import Layout from '../components/layout' ;
44import SEO from '../components/seo' ;
5- import Header from '../components/header' ;
65import Hero from '../components/hero' ;
76import PastEvents from '../components/past-events' ;
87import ContactUs from '../components/contact-us' ;
98
109export default props => (
1110 < Layout >
1211 < SEO title = "Home" />
13- < Header />
1412 < Hero />
1513 < PastEvents />
1614 < ContactUs />
You can’t perform that action at this time.
0 commit comments