Skip to content

Commit

Permalink
Update VWC to Gatsby V2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-t-james committed Sep 28, 2018
1 parent 1fd9499 commit 502f3b8
Show file tree
Hide file tree
Showing 35 changed files with 5,125 additions and 1,145 deletions.
10 changes: 8 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
presets: ["react", "env"],
plugins: ["transform-class-properties"]
presets: [
"@babel/react",
"@babel/env"
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
"transform-class-properties"
]
}
67 changes: 50 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,28 @@
"version": "1.0.0",
"repository": "Vets-Who-Code/vwc-site",
"dependencies": {
"gatsby": "1.9.273",
"gatsby-link": "1.6.34",
"gatsby-plugin-create-client-paths": "1.0.1",
"gatsby-plugin-react-helmet": "1.0.8",
"enzyme-adapter-react-16": "1.5.0",
"gatsby": "2.0.11",
"gatsby-link": "2.0.2",
"gatsby-plugin-create-client-paths": "2.0.0",
"gatsby-plugin-react-helmet": "3.0.0",
"generate": "0.14.0",
"jest": "23.5.0",
"react-modal": "3.4.5",
"jest": "23.6.0",
"react": "16.5.2",
"react-dom": "16.5.2",
"react-helmet": "5.2.0",
"react-modal": "3.6.1",
"react-slick": "0.23.1",
"slick-carousel": "1.8.1"
},
"keywords": ["gatsby"],
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format":
"prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"src/**/*.js\"",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --env=jsdom --coverage",
Expand All @@ -28,19 +33,29 @@
"heroku-postbuild": "gatsby build"
},
"devDependencies": {
"@babel/core": "7.1.0",
"@babel/plugin-proposal-class-properties": "7.1.0",
"@babel/plugin-proposal-optional-chaining": "7.0.0",
"@babel/preset-env": "7.1.0",
"@babel/preset-react": "7.0.0",
"babel-core": "^7.0.0-0",
"babel-eslint": "10.0.0",
"babel-jest": "23.6.0",
"enzyme": "3.3.0",
"enzyme-adapter-react-15": "1.0.6",
"enzyme-to-json": "3.3.4",
"eslint": "5.6.0",
"eslint-plugin-react": "7.11.1",
"ghooks": "2.0.4",
"lint-staged": "7.3.0",
"prettier": "^1.9.2",
"react-test-renderer": "15.6.1"
"prettier": "1.14.3",
"react-test-renderer": "16.5.2"
},
"lint-staged": {
"src/**/*.js": ["yarn format", "git add"]
"src/**/*.js": [
"yarn format",
"git add"
]
},
"config": {
"ghooks": {
Expand All @@ -49,17 +64,35 @@
}
},
"jest": {
"testPathIgnorePatterns": ["/node_modules/", "/.cache/"],
"snapshotSerializers": ["enzyme-to-json/serializer"],
"setupFiles": ["./tests/setupTests.js"],
"testPathIgnorePatterns": [
"node_modules",
".cache"
],
"transform": {
"^.+\\.jsx?$": "<rootDir>/tests/jest-preprocess.js"
},
"transformIgnorePatterns": [
"node_modules/(?!(gatsby)/)"
],
"globals": {
"__PATH_PREFIX__": ""
},
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"setupFiles": [
"./tests/setupTests.js",
"./tests/jest-preprocess.js",
"./tests/loadershim.js"
],
"testURL": "http://localhost",
"collectCoverageFrom": [
"src/components/**/*.{js,jsx}",
"src/pages/**/*.{js,jsx}",
"!/static/vendor/jquery/dist"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/tests/__mocks__/image-mock.js",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/__mocks__/image-mock.js",
"\\.(css|scss|sass)$": "<rootDir>/tests/__mocks__/style-mock.js"
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class Nav extends Component {
itemType="https://schema.org/Organization"
>
{' '}
<span itemProp="name" className="sr-only">
<span className="sr-only">
#VetsWhoCode
</span>
<Link itemProp="url" to="/">
<Link to="/">
<img
src={logo}
alt="#VetsWhoCode Logo"
Expand Down Expand Up @@ -111,7 +111,7 @@ class Nav extends Component {
</li>
<li>
{' '}
<a href="https://medium.com/vets-who-code" without rel="noopener noreferrer" target="_blank">
<a href="https://medium.com/vets-who-code" without="true" rel="noopener noreferrer" target="_blank">
<span>Blog</span>
</a>
</li>
Expand Down
105 changes: 105 additions & 0 deletions src/components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
// import { withPrefix } from 'gatsby';
import Helmet from 'react-helmet';

import Nav from './Nav';
// import Loader from './Loader';
import Footer from './Footer';

import '../assets/lib/bootstrap/dist/css/bootstrap.min.css';
import '../assets/lib/owlcarousel/owl-carousel/owl.carousel.css';
import '../assets/lib/owlcarousel/owl-carousel/owl.theme.css';
import '../assets/lib/ionicons/css/ionicons.css';
import '../assets/lib/fontawesome/css/font-awesome.min.css';
import '../assets/extras/swipebox/css/swipebox.min.css';
import '../assets/extras/rotating-carousel/css/style.css';
import '../assets/extras/slick/slick.css';
import '../assets/extras/magnificpopup/magnific-popup.css';
import '../assets/lib/FlexSlider/flexslider.css';
import '../assets/css/main.css';
import '../assets/css/custom.css';




class TemplateWrapper extends Component {
componentDidMount() {
global.jQuery = require('../../static/vendor/jquery/dist/jquery');
require('../../static/vendor/bootstrap/dist/bootstrap');
window.$ = jQuery;
window.jQuery = jQuery;
}

render() {
const { children } = this.props;

return (
<div>
<Helmet>
{/* <script src={withPrefix('/vendor/jquery/dist/jquery.js')} /> */}
{/* <script src={withPrefix('/vendor/bootstrap/dist/bootstrap.js')} /> */}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQt6WATWNedQ8TSM7sCKOI1uoPR2JrG-4" />
<script src="https://linked.chat/web/a9LB63" />

<title>#VetsWhoCode</title>
<meta
name="description"
content="#VetsWhoCode is a veteran-led 501(c)(3) charitable non-profit that focuses on teaching
veterans how to program free of charge so that they may find gainful employment after service."
/>

<meta itemProp="name" content="#VetsWhoCode 🇺🇸 " />
<meta
itemProp="description"
content="#VetsWhoCode is a veteran-led 501(c)(3) charitable non-profit that focuses on
teaching veterans how to program free of charge so that they may find gainful employment after service."
/>
<meta
itemProp="image"
content="https://cdn-images-1.medium.com/max/1000/1*idlh1wOIqUQOj1LkOt51gA.png"
/>

<meta property="og:url" content="http://www.vetswhocode.io" />
<meta property="og:type" content="website" />
<meta property="og:title" content="#VetsWhoCode 🇺🇸 " />
<meta
property="og:description"
content="#VetsWhoCode is a veteran-led 501(c)(3) charitable non-profit that focuses on
teaching veterans how to program free of charge so that they may find gainful employment after service."
/>
<meta
property="og:image"
content="https://cdn-images-1.medium.com/max/1000/1*idlh1wOIqUQOj1LkOt51gA.png"
/>

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="#VetsWhoCode 🇺🇸 " />
<meta
name="twitter:description"
content="#VetsWhoCode is a veteran-led 501(c)(3) charitable non-profit that focuses on
teaching veterans how to program free of charge so that they may find gainful employment after service."
/>
<meta
name="twitter:image"
content="https://cdn-images-1.medium.com/max/1000/1*idlh1wOIqUQOj1LkOt51gA.png"
/>
</Helmet>

<main className="main_container">
{/* <Loader /> */}
<Nav />
{children}
<Footer />
</main>
</div>

);
}
}

TemplateWrapper.propTypes = {
children: PropTypes.array || PropTypes.object
};

export default TemplateWrapper;
88 changes: 0 additions & 88 deletions src/layouts/index.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import Layout from '../components/layout';

const NotFoundPage = () => (
<div>
<Layout>
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</div>
</Layout>
);

export default NotFoundPage;
Loading

0 comments on commit 502f3b8

Please sign in to comment.