Skip to content

Commit

Permalink
Revert "#3 Add Back to Top Button"
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenAJ authored Oct 2, 2020
1 parent a372afc commit d31cb3d
Show file tree
Hide file tree
Showing 8 changed files with 2,111 additions and 2,163 deletions.
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

4,112 changes: 2,074 additions & 2,038 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"gatsby-plugin-sitemap": "^1.2.25",
"gatsby-source-filesystem": "^1.5.39",
"gatsby-transformer-remark": "^1.7.44",
"react": "16.8.0",
"react-dom": "16.8.0",
"react-helmet": "^5.2.0"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion public/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@

gitme.js.org
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><title data-react-helmet="true"></title><link rel="sitemap" type="application/xml" href="/sitemap.xml"/><script src="/socket.io/socket.io.js"></script></head><body><div id="___gatsby"></div><script src="/commons.js"></script></body></html>
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><title data-react-helmet="true"></title><link rel="sitemap" type="application/xml" href="/sitemap.xml"/><script src="/socket.io/socket.io.js"></script></head><body><div id="___gatsby"></div><script src="/commons.js"></script></body></html>
2 changes: 1 addition & 1 deletion public/render-page.js.map

Large diffs are not rendered by default.

31 changes: 1 addition & 30 deletions src/layouts/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ a {
display: block;
height: 200px;
width: 400px;

}

.nav .brand-text {
Expand Down Expand Up @@ -207,35 +207,6 @@ footer a {
text-decoration: none;
}

.toTop {
display: flex;
position: fixed;
bottom: 20px;
right: 20px;
justify-content: center;
align-items: center;
border: 1px solid #a1a1a1;
padding: 8px;
border-radius: 50px;
outline: none;
}

.toTop:hover {
cursor: pointer;
background: #e1e1e1;
}

.toTop svg {
border: 1px solid #d1d1d1;
border-radius: 50px;
padding: 8px;
}

.toTop span {
margin: 0 8px;
}


/*
##Device = Most of the Smartphones Mobiles (Portrait)
##Screen = B/w 320px to 479px
Expand Down
121 changes: 33 additions & 88 deletions src/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
import Link from 'gatsby-link'
Expand All @@ -8,98 +8,43 @@ import Footer from '../components/footer'

import './index.css'

const Layout = ({ children, data }) => {
const [showBackToTop, setShowBackToTop] = useState(false)
const Layout = ({ children, data }) => (
<div>
<Helmet
title={data.site.siteMetadata.title}
meta={[
{ name: 'description', content: 'Make your first GitHub Pull Request' },
{ name: 'keywords', content: 'GitHub, PullRequest, First OpenSource, contribution' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1'},
{ name: 'msapplication-TileColor', content: '#603cba'},
{ name: 'theme-color', content: '#261f28'}
]}
>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</Helmet>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
<link rel="manifest" href="/site.webmanifest"/>
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ed11ca"/>
<Header siteTitle={data.site.siteMetadata.title} />

useEffect(() => {
const onScroll = (e) => {
setShowBackToTop(!!e.target.documentElement.scrollTop);
};
window.addEventListener("scroll", onScroll);

return () => window.removeEventListener("scroll", onScroll);
}, []);

return (
<div>
<Helmet
title={data.site.siteMetadata.title}
meta={[
{
name: "description",
content: "Make your first GitHub Pull Request",
},
{
name: "keywords",
content: "GitHub, PullRequest, First OpenSource, contribution",
},
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ name: "msapplication-TileColor", content: "#603cba" },
{ name: "theme-color", content: "#261f28" },
]}
>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</Helmet>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#ed11ca" />
<Header siteTitle={data.site.siteMetadata.title} />
<div className="container">
<div className="card">
<div className="container">
<div className="card">
<div className="tab-holder">
<ul className="tabs">
<li>
<Link to="/" exact={true} activeClassName="active">
Instructions
</Link>
</li>
<li>
<Link to="/submissions/" exact={true} activeClassName="active">
Submissions
</Link>
</li>
</ul>
<ul className="tabs">
<li><Link to="/" exact={true} activeClassName="active">Instructions</Link></li>
<li><Link to="/submissions/" exact={true} activeClassName="active">Submissions</Link></li>
</ul>
</div>
<div className="content">
{children()}
</div>
<div className="content">{children()}</div>
</div>
</div>
<Footer
author={data.site.siteMetadata.author}
profile={data.site.siteMetadata.author}
/>
{ showBackToTop &&
<button className="toTop" onClick={() => window.scrollTo(0, 0)}>
<span>Back to Top</span>{" "}
<svg
width="1em"
height="1em"
viewBox="0 0 16 16"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M7.247 4.86l-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z" />
</svg>
</button>
}
</div>
);
}
<Footer author={data.site.siteMetadata.author} profile={data.site.siteMetadata.author} />
</div>
)

Layout.propTypes = {
children: PropTypes.func,
Expand Down

0 comments on commit d31cb3d

Please sign in to comment.