diff --git a/src/components/Cart/Cart.js b/src/components/Cart/Cart.js index f04cc2d9..3b2d6a93 100644 --- a/src/components/Cart/Cart.js +++ b/src/components/Cart/Cart.js @@ -10,7 +10,6 @@ import { } from 'react-icons/md'; import StoreContext from '../../context/StoreContext'; -import InterfaceContext from '../../context/InterfaceContext'; import CartList from './CartList'; import CartIndicator from './CartIndicator'; import EmptyCart from './EmptyCart'; @@ -22,7 +21,6 @@ import { breakpoints, colors, fonts, - radius, spacing, dimensions } from '../../utils/styles'; diff --git a/src/components/Cart/CartIndicator.js b/src/components/Cart/CartIndicator.js index b02c11c7..59584ab5 100644 --- a/src/components/Cart/CartIndicator.js +++ b/src/components/Cart/CartIndicator.js @@ -2,10 +2,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import { MdSentimentSatisfied } from 'react-icons/md'; - import { colors, dimensions, radius, spacing } from '../../utils/styles'; -import gift from '../../assets/gift.png'; const CartIndicatorRoot = styled(`div`)` background: ${colors.lemon}; @@ -26,7 +23,7 @@ class CartIndicator extends Component { message: '' }; - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps) { if (prevProps.adding !== this.props.adding) { if (this.props.adding) { this.setState({ diff --git a/src/components/Cart/CartThumbail.js b/src/components/Cart/CartThumbail.js index d8382d11..999eec97 100644 --- a/src/components/Cart/CartThumbail.js +++ b/src/components/Cart/CartThumbail.js @@ -3,7 +3,7 @@ import { graphql, StaticQuery } from 'gatsby'; import styled from 'react-emotion'; import Image from 'gatsby-image'; -import { colors, spacing, radius } from '../../utils/styles'; +import { colors, radius } from '../../utils/styles'; const CartThumbailRoot = styled(Image)` border: 1px solid ${colors.brandLight}; diff --git a/src/components/Cart/Gift.js b/src/components/Cart/Gift.js index efc2e73d..87a91216 100644 --- a/src/components/Cart/Gift.js +++ b/src/components/Cart/Gift.js @@ -1,5 +1,4 @@ import React from 'react'; -import { colors } from '../../utils/styles'; export default () => ( { + toggle = () => { this.setState({ detailsVisible: !this.state.detailsVisible }); }; diff --git a/src/components/ContributorArea/AreaTypography.js b/src/components/ContributorArea/AreaTypography.js index f2742767..b246334e 100644 --- a/src/components/ContributorArea/AreaTypography.js +++ b/src/components/ContributorArea/AreaTypography.js @@ -1,13 +1,6 @@ import styled from 'react-emotion'; -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions -} from '../../utils/styles'; +import { colors, fonts, spacing } from '../../utils/styles'; export const SectionHeading = styled(`h3`)` color: ${colors.lightest}; diff --git a/src/components/ContributorArea/CloseBar.js b/src/components/ContributorArea/CloseBar.js index e8caef79..4e8cdd3e 100644 --- a/src/components/ContributorArea/CloseBar.js +++ b/src/components/ContributorArea/CloseBar.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import styled, { keyframes } from 'react-emotion'; +import styled from 'react-emotion'; import { MdArrowForward, MdClose } from 'react-icons/md'; @@ -8,18 +8,12 @@ import { breakpoints, colors, fonts, - radius, spacing, - dimensions, - durations + dimensions } from '../../utils/styles'; const { - contributorAreaWidth: { - openDesktop: desktopMaxWidth, - openHd: hdMaxWidth, - closed: desktopMinWidth - }, + contributorAreaWidth: { openDesktop: desktopMaxWidth, openHd: hdMaxWidth }, contributorAreaBarHeight: height } = dimensions; @@ -154,7 +148,7 @@ class CloseBar extends Component { } render() { - const { status, onClick, isDesktopViewport } = this.props; + const { onClick, isDesktopViewport } = this.props; const { className } = this.state; return ( diff --git a/src/components/ContributorArea/ContentContainer.js b/src/components/ContributorArea/ContentContainer.js index 894c56bb..b68ed7a9 100644 --- a/src/components/ContributorArea/ContentContainer.js +++ b/src/components/ContributorArea/ContentContainer.js @@ -1,21 +1,12 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React from 'react'; import styled, { keyframes } from 'react-emotion'; import UserContext from '../../context/UserContext'; import Butler from '../../assets/Butler'; -import { Button } from '../shared/Buttons'; import ContentForNotLoggedIn from './ContentForNotLoggedIn'; import ContentForLoggedIn from './ContentForLoggedIn'; -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions -} from '../../utils/styles'; +import { breakpoints, colors, spacing, dimensions } from '../../utils/styles'; const ContentContainerRoot = styled(`div`)` -webkit-overflow-scrolling: touch; @@ -76,38 +67,36 @@ const ButlerBox = styled(`div`)` } `; -const ContentContainer = props => { - return ( - - - {({ - contributor, - error, - handleLogout, - loading, - profile, - profile: { nickname } - }) => - nickname || loading ? ( - - ) : ( - <> - - - - - - ) - } - - - ); -}; +const ContentContainer = () => ( + + + {({ + contributor, + error, + handleLogout, + loading, + profile, + profile: { nickname } + }) => + nickname || loading ? ( + + ) : ( + <> + + + + + + ) + } + + +); export default ContentContainer; diff --git a/src/components/ContributorArea/ContentForContributor.js b/src/components/ContributorArea/ContentForContributor.js index b2aa9a60..9bde8f6d 100644 --- a/src/components/ContributorArea/ContentForContributor.js +++ b/src/components/ContributorArea/ContentForContributor.js @@ -1,20 +1,17 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import styled, { keyframes } from 'react-emotion'; +import React from 'react'; +import styled from 'react-emotion'; import { MdLock } from 'react-icons/md'; import UserContext from '../../context/UserContext'; -import { Heading, SectionHeading, SubHeading, Text } from './AreaTypography'; +import { Heading, Text } from './AreaTypography'; import { - breakpoints, colors, badgeThemes, fonts, radius, spacing, - dimensions, animations } from '../../utils/styles'; @@ -133,84 +130,82 @@ const LockIcon = styled(MdLock)` padding-top: 0.4rem; `; -const ContentForContributor = props => { - return ( - - {({ contributor }) => { - const { - shopify: { codes }, - github: { contributionCount } - } = contributor; - - const showLevelTwoIncentive = - contributionCount >= 1 && contributionCount < 5; - let contributionsToGo, percentToGo; - if (showLevelTwoIncentive) { - contributionsToGo = 5 - contributionCount; - percentToGo = ((5 - contributionsToGo) / 5) * 100; - } - - const numberOfCodes = codes.filter(code => code.used === false).length; - let text; - if (numberOfCodes > 1) { - text = `Use these discount codes during checkout to claim some free swag!`; - } else if (numberOfCodes == 1) { - text = `Enter this discount code during checkout to claim your free swag!`; - } else { - text = `Looks like you've claimed your swag! Thanks again, and keep being awesome.`; - } - - return ( - - Here you go! - - Thanks for going the extra mile to help build Gatsby! 💪 You have - made {contributionCount}{' '} - {`contribution${contributionCount > 1 ? `s` : ``}`}! - - {text} - {codes.map(code => ( - - - - {`Level ${badgeThemes[code.code].level} Swag Code`} - - {!code.used ? ( - {code.code} - ) : ( - Claimed! 🎉 - )} - - {/* {!code.used && ( +const ContentForContributor = () => ( + + {({ contributor }) => { + const { + shopify: { codes }, + github: { contributionCount } + } = contributor; + + const showLevelTwoIncentive = + contributionCount >= 1 && contributionCount < 5; + let contributionsToGo, percentToGo; + if (showLevelTwoIncentive) { + contributionsToGo = 5 - contributionCount; + percentToGo = ((5 - contributionsToGo) / 5) * 100; + } + + const numberOfCodes = codes.filter(code => code.used === false).length; + let text; + if (numberOfCodes > 1) { + text = `Use these discount codes during checkout to claim some free swag!`; + } else if (numberOfCodes == 1) { + text = `Enter this discount code during checkout to claim your free swag!`; + } else { + text = `Looks like you've claimed your swag! Thanks again, and keep being awesome.`; + } + + return ( + + Here you go! + + Thanks for going the extra mile to help build Gatsby! 💪 You have + made {contributionCount}{' '} + {`contribution${contributionCount > 1 ? `s` : ``}`}! + + {text} + {codes.map(code => ( + + + + {`Level ${badgeThemes[code.code].level} Swag Code`} + + {!code.used ? ( + {code.code} + ) : ( + Claimed! 🎉 + )} + + {/* {!code.used && ( Click the badge to shop only items you can claim for free using this code. )} */} + + ))} + {/* Show progress bar when Level 1 is earned, but Level 2 is not */} + {showLevelTwoIncentive && ( + <> + + + {`Level 2 Swag Code`} + + + + - ))} - {/* Show progress bar when Level 1 is earned, but Level 2 is not */} - {showLevelTwoIncentive && ( - <> - - - {`Level 2 Swag Code`} - - - - - - - {`Make ${contributionsToGo} more contribution${ - contributionsToGo > 1 ? `s` : `` - } to earn level 2 swag!`} - - )} - - ); - }} - - ); -}; + + {`Make ${contributionsToGo} more contribution${ + contributionsToGo > 1 ? `s` : `` + } to earn level 2 swag!`} + + )} + + ); + }} + +); export default ContentForContributor; diff --git a/src/components/ContributorArea/ContentForContributorWithNoAccount.js b/src/components/ContributorArea/ContentForContributorWithNoAccount.js index 3dc5f168..e319ecef 100644 --- a/src/components/ContributorArea/ContentForContributorWithNoAccount.js +++ b/src/components/ContributorArea/ContentForContributorWithNoAccount.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import { Mutation } from 'react-apollo'; import gql from 'graphql-tag'; import styled from 'react-emotion'; @@ -36,58 +36,55 @@ const ContentForContributorWithNoAccountRoot = styled(`div`)` animation: ${animations.simpleEntry}; `; -const ContentForContributorWithNoAccount = props => { - return ( - - {({ contributor, profile, updateContributor }) => ( - - updateContributor(data.createContributor)} - > - {(createContributor, { loading, error, data }) => { - if (error) return ; - if (loading) return ; +const ContentForContributorWithNoAccount = () => ( + + {({ contributor, profile, updateContributor }) => ( + + updateContributor(data.createContributor)} + > + {(createContributor, { loading, error, data }) => { + if (error) return ; + if (loading) return ; - return ( - <> - - You’re the best @{profile.nickname}! - - - You’ve made{' '} - {contributor.github.contributionCount}{' '} - contributions to Gatsby. 💪💜 - - - Thanks for making Gatsby great! As a token of our - appreciation, you are eligible to claim some free Gatsby - swag! - - async e => { - e.preventDefault(); - createContributor({ - variables: { - input: { - githubUsername: userData.username, - email: userData.email, - firstName: userData.first_name, - acceptsMarketing: userData.subscribe - } + return ( + <> + + You’re the best @{profile.nickname}! + + + You’ve made{' '} + {contributor.github.contributionCount}{' '} + contributions to Gatsby. 💪💜 + + + Thanks for making Gatsby great! As a token of our + appreciation, you are eligible to claim some free Gatsby swag! + + async e => { + e.preventDefault(); + createContributor({ + variables: { + input: { + githubUsername: userData.username, + email: userData.email, + firstName: userData.first_name, + acceptsMarketing: userData.subscribe } - }); - }} - /> - - ); - }} - - - )} - - ); -}; + } + }); + }} + /> + + ); + }} + + + )} + +); export default ContentForContributorWithNoAccount; diff --git a/src/components/ContributorArea/ContentForLoggedIn.js b/src/components/ContributorArea/ContentForLoggedIn.js index d5d55cf1..9112ad32 100644 --- a/src/components/ContributorArea/ContentForLoggedIn.js +++ b/src/components/ContributorArea/ContentForLoggedIn.js @@ -1,10 +1,5 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Query, Mutation } from 'react-apollo'; -import styled from 'react-emotion'; -import gql from 'graphql-tag'; - -import { GoMarkGithub } from 'react-icons/go'; import ContentForNotContributor from './ContentForNotContributor'; import ContentForContributorWithNoAccount from './ContentForContributorWithNoAccount'; @@ -12,19 +7,8 @@ import ContentForContributor from './ContentForContributor'; import Loading from './Loading'; import LogoutBar from './LogoutBar'; import Error from './Error'; -import { Button } from '../shared/Buttons'; -import { Heading, SectionHeading, SubHeading, Text } from './AreaTypography'; - -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions -} from '../../utils/styles'; -const ContentFor = ({ contributor, error, handleLogout, loading, profile }) => { +const ContentFor = ({ contributor, error, loading, profile }) => { const { shopify, github } = contributor; if (error) { diff --git a/src/components/ContributorArea/ContentForNotLoggedIn.js b/src/components/ContributorArea/ContentForNotLoggedIn.js index 6551e2d1..ee26b58e 100644 --- a/src/components/ContributorArea/ContentForNotLoggedIn.js +++ b/src/components/ContributorArea/ContentForNotLoggedIn.js @@ -1,22 +1,11 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import styled, { keyframes } from 'react-emotion'; - +import React from 'react'; +import styled from 'react-emotion'; import { GoMarkGithub } from 'react-icons/go'; import { login } from '../../utils/auth'; import { Button as BaseButton } from '../shared/Buttons'; -import { Heading, SectionHeading, SubHeading, Text } from './AreaTypography'; - -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions, - animations -} from '../../utils/styles'; +import { Heading, SectionHeading, Text } from './AreaTypography'; +import { spacing, animations } from '../../utils/styles'; const ContentForGuestRoot = styled(`div`)` animation: ${animations.simpleEntry}; @@ -31,36 +20,34 @@ const Button = styled(BaseButton)` margin: ${spacing.lg}px 0 ${spacing.xl}px 0; `; -const ContentForGuest = props => { - return ( - - For Existing Contributors - - Get Gatsby Swag for FREE! - - - Already contributed to Gatsby? Claim your personal coupon code and get - free swag by logging in with your GitHub account! - - - For Future Contributors - Never contributed to Gatsby? - - Let’s get you started with your first contribution to Gatsby! Once - you’ve had your first pull request merged into Gatsby, you can come back - here to claim free swag. - - - - - ); -}; +const ContentForGuest = () => ( + + For Existing Contributors + + Get Gatsby Swag for FREE! + + + Already contributed to Gatsby? Claim your personal coupon code and get + free swag by logging in with your GitHub account! + + + For Future Contributors + Never contributed to Gatsby? + + Let’s get you started with your first contribution to Gatsby! Once you’ve + had your first pull request merged into Gatsby, you can come back here to + claim free swag. + + + + +); export default ContentForGuest; diff --git a/src/components/ContributorArea/ContributorArea.js b/src/components/ContributorArea/ContributorArea.js index d7130075..2f6b031b 100644 --- a/src/components/ContributorArea/ContributorArea.js +++ b/src/components/ContributorArea/ContributorArea.js @@ -1,29 +1,14 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import styled, { keyframes } from 'react-emotion'; - -import { Button } from '../shared/Buttons'; +import styled from 'react-emotion'; import CloseBar from './CloseBar'; import OpenBar from './OpenBar'; -import { Heading, SectionHeading, SubHeading, Text } from './AreaTypography'; import ContentContainer from './ContentContainer'; - -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions -} from '../../utils/styles'; +import { breakpoints, colors, dimensions } from '../../utils/styles'; const { - contributorAreaWidth: { - openDesktop: desktopMaxWidth, - openHd: hdMaxWidth, - closed: desktopMinWidth - } + contributorAreaWidth: { openDesktop: desktopMaxWidth, openHd: hdMaxWidth } } = dimensions; const ContributorAreaRoot = styled(`aside`)` @@ -186,7 +171,7 @@ class ContributorArea extends Component { isDesktopViewport, productImagesBrowserStatus } = this.props; - const { className, issuesVisible } = this.state; + const { className } = this.state; return ( <> diff --git a/src/components/ContributorArea/Loading.js b/src/components/ContributorArea/Loading.js index 626e9c1c..91a246f3 100644 --- a/src/components/ContributorArea/Loading.js +++ b/src/components/ContributorArea/Loading.js @@ -2,7 +2,7 @@ import React from 'react'; import styled, { keyframes } from 'react-emotion'; import Butler from '../../assets/Butler'; -import { colors, spacing, animations } from '../../utils/styles'; +import { animations } from '../../utils/styles'; const LoadingRoot = styled(`div`)` align-items: center; @@ -47,15 +47,13 @@ const ButlerBox = styled(`span`)` } `; -const Loading = () => { - return ( - - - - - Loading... - - ); -}; +const Loading = () => ( + + + + + Loading... + +); export default Loading; diff --git a/src/components/ContributorArea/LogoutBar.js b/src/components/ContributorArea/LogoutBar.js index cf0183f5..a18298e0 100644 --- a/src/components/ContributorArea/LogoutBar.js +++ b/src/components/ContributorArea/LogoutBar.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; @@ -30,8 +30,8 @@ const Logout = styled(Button)` padding: ${spacing.xs}px ${spacing.sm}px; `; -const LogoutBar = ({ error, loading, profile, handleLogout }) => { - return !loading && !error ? ( +const LogoutBar = ({ error, loading, profile, handleLogout }) => + !loading && !error ? ( Logged in as @{profile.nickname} @@ -41,7 +41,6 @@ const LogoutBar = ({ error, loading, profile, handleLogout }) => { ) : null; -}; LogoutBar.propTypes = { error: PropTypes.any.isRequired, diff --git a/src/components/ContributorArea/OpenBar.js b/src/components/ContributorArea/OpenBar.js index 290ea629..e65740f8 100644 --- a/src/components/ContributorArea/OpenBar.js +++ b/src/components/ContributorArea/OpenBar.js @@ -2,21 +2,10 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styled, { keyframes } from 'react-emotion'; -import { MdArrowBack } from 'react-icons/md'; - import UserContext from '../../context/UserContext'; import Butler from '../../assets/Butler'; import ButlerHand from '../../assets/ButlerHand'; - -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions, - durations -} from '../../utils/styles'; +import { breakpoints, colors, fonts, dimensions } from '../../utils/styles'; const OpenBarRoot = styled(`button`)` align-items: center; diff --git a/src/components/ContributorArea/OpenIssues.js b/src/components/ContributorArea/OpenIssues.js index 0819a5f7..ab47c90f 100644 --- a/src/components/ContributorArea/OpenIssues.js +++ b/src/components/ContributorArea/OpenIssues.js @@ -2,13 +2,11 @@ import React from 'react'; import gql from 'graphql-tag'; import styled from 'react-emotion'; import { Query } from 'react-apollo'; - import { GoMarkGithub } from 'react-icons/go'; import { Subheading, Text } from './AreaTypography'; import OpenIssuesList from './OpenIssuesList'; import { Button as BaseButton } from '../shared/Buttons'; - import { spacing } from '../../utils/styles'; const OpenIssuesRoot = styled(`div`)` diff --git a/src/components/ContributorArea/OpenIssuesList.js b/src/components/ContributorArea/OpenIssuesList.js index 6eab0c49..94b971fa 100644 --- a/src/components/ContributorArea/OpenIssuesList.js +++ b/src/components/ContributorArea/OpenIssuesList.js @@ -1,7 +1,6 @@ import React from 'react'; import styled, { keyframes } from 'react-emotion'; import PropTypes from 'prop-types'; - import { MdArrowForward } from 'react-icons/md'; import { colors, radius, spacing } from '../../utils/styles'; @@ -56,38 +55,7 @@ const Link = styled('a')` } `; -/* -const Label = styled('a')` - border: 1px solid ${colors.brand}; - border-radius: ${radius.default}px; - color: ${colors.brandLight}; - display: inline-block; - font-size: 0.9rem; - line-height: 1; - margin: 0 ${spacing.xs}px ${spacing.xs}px 0; - padding: ${spacing.xs}px; - text-decoration: none; - transition: 0.5s; - - @media (hover: hover) { - :hover { - border: 1px solid ${colors.brandBright}; - color: ${colors.lightest}; - } - } -`; -*/ - -const formatLabelUrl = url => { - const urlParts = url.split('/'); - const organization = urlParts[4]; - const repository = urlParts[5]; - const label = urlParts.slice(-1)[0]; - - return `https://github.com/${organization}/${repository}/issues?q=is%3Aissue+is%3Aopen+label%3A%22${label}%22`; -}; - -const OpenIssuesList = ({ issues, isDesktopViewport }) => ( +const OpenIssuesList = ({ issues }) => ( {issues.map(issue => ( @@ -95,11 +63,6 @@ const OpenIssuesList = ({ issues, isDesktopViewport }) => ( {issue.title} #{issue.url.split('/').pop()} - {/* {issue.labels.map(({ url, name }) => ( - - ))} */} ))} diff --git a/src/components/Layout/Footer.js b/src/components/Layout/Footer.js index 3061a1f4..2b232101 100644 --- a/src/components/Layout/Footer.js +++ b/src/components/Layout/Footer.js @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'react-emotion'; -import { breakpoints, colors, dimensions, spacing } from '../../utils/styles'; +import { breakpoints, colors, spacing } from '../../utils/styles'; const FooterRoot = styled('footer')` align-items: center; diff --git a/src/components/Layout/Header.js b/src/components/Layout/Header.js index d8da3fc9..002f9ffc 100644 --- a/src/components/Layout/Header.js +++ b/src/components/Layout/Header.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import styled from 'react-emotion'; import { Link } from 'gatsby'; import Logo from './Logo'; -import InterfaceContext from '../../context/InterfaceContext'; import { breakpoints, colors, dimensions, spacing } from '../../utils/styles'; diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index 8d6fc5d4..2689aa4e 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -1,7 +1,6 @@ import React from 'react'; import styled, { injectGlobal } from 'react-emotion'; import { push } from 'gatsby'; -import { GitHubIssueFragment } from '../Dashboard/IssueList'; import { client } from '../../context/ApolloContext'; import StoreContext, { defaultStoreContext } from '../../context/StoreContext'; @@ -18,7 +17,7 @@ import Cart from '../Cart'; import SiteMetadata from '../shared/SiteMetadata'; import { logout, getUserInfo } from '../../utils/auth'; -import { breakpoints, dimensions, spacing } from '../../utils/styles'; +import { breakpoints, spacing } from '../../utils/styles'; // Import Futura PT typeface import '../../fonts/futura-pt/Webfonts/futurapt_demi_macroman/stylesheet.css'; @@ -38,14 +37,6 @@ injectGlobal` } `; -const Main = styled('main')` - display: block; - margin: 0 auto; - max-width: 600px; - padding: ${spacing.xl}px ${spacing.sm}px ${spacing['3xl']}px; - position: relative; -`; - const Viewport = styled(`div`)` overflow-x: hidden; width: 100%; @@ -376,7 +367,7 @@ export default class Layout extends React.Component { }; render() { - const { children, location, newDesign = true } = this.props; + const { children, location } = this.props; return ( <> diff --git a/src/components/Layout/Logo.js b/src/components/Layout/Logo.js index dee7d94d..cb9d57b6 100644 --- a/src/components/Layout/Logo.js +++ b/src/components/Layout/Logo.js @@ -1,7 +1,7 @@ import React from 'react'; import { css } from 'react-emotion'; -import { colors, breakpoints } from '../../utils/styles'; +import { colors } from '../../utils/styles'; const svg = css` display: inline-block; diff --git a/src/components/Layout/PageContent.js b/src/components/Layout/PageContent.js index 5491762e..31d0760f 100644 --- a/src/components/Layout/PageContent.js +++ b/src/components/Layout/PageContent.js @@ -2,18 +2,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import ContributorArea from '../ContributorArea'; import Footer from './Footer'; - -import { - breakpoints, - colors, - fonts, - radius, - spacing, - dimensions, - animations -} from '../../utils/styles'; +import { breakpoints, dimensions, animations } from '../../utils/styles'; const { contributorAreaWidth: { @@ -163,7 +153,7 @@ class PageContent extends Component { } render() { - const { children, cartStatus, contributorAreaStatus } = this.props; + const { children, cartStatus } = this.props; const { className } = this.state; return ( diff --git a/src/components/ProductDetails/ProductDetails.js b/src/components/ProductDetails/ProductDetails.js index 7b4ec3a4..e8766c05 100644 --- a/src/components/ProductDetails/ProductDetails.js +++ b/src/components/ProductDetails/ProductDetails.js @@ -3,18 +3,10 @@ import styled from 'react-emotion'; import SizeChartTable from './SizeChartTable'; import { Heading as BaseHeading, - Text, TextContainer, UnorderedList } from '../shared/Typography'; -import { - colors, - fonts, - spacing, - pullHeadline, - breakpoints, - dimensions -} from '../../utils/styles'; +import { colors, spacing, dimensions } from '../../utils/styles'; const Heading = styled(BaseHeading)` margin-bottom: -${spacing.sm}px; diff --git a/src/components/ProductListing/ProductListing.js b/src/components/ProductListing/ProductListing.js index 6b3f66d3..3e822c15 100644 --- a/src/components/ProductListing/ProductListing.js +++ b/src/components/ProductListing/ProductListing.js @@ -1,12 +1,11 @@ -import React, { Component } from 'react'; +import React from 'react'; import { graphql, StaticQuery } from 'gatsby'; -import PropTypes from 'prop-types'; import styled from 'react-emotion'; import ProductListingHeader from './ProductListingHeader'; import ProductListingItem from './ProductListingItem'; -import { breakpoints, colors, fonts, spacing } from '../../utils/styles'; +import { breakpoints, spacing } from '../../utils/styles'; const ProductListingContainer = styled(`div`)` display: flex; @@ -21,7 +20,7 @@ const ProductListingContainer = styled(`div`)` } `; -const ProductListing = props => ( +const ProductListing = () => ( ( /> ); -ProductListing.propTypes = {}; - export default ProductListing; diff --git a/src/components/ProductListing/ProductListingHeader.js b/src/components/ProductListing/ProductListingHeader.js index 4443f74e..38542c6f 100644 --- a/src/components/ProductListing/ProductListingHeader.js +++ b/src/components/ProductListing/ProductListingHeader.js @@ -1,18 +1,7 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React from 'react'; import styled from 'react-emotion'; -import Image from 'gatsby-image'; -import Link from '../shared/Link'; -import { - breakpoints, - colors, - fonts, - radius, - spacing -} from '../../utils/styles'; - -import { CONTRIBUTOR_AREA_WIDTH } from '../ContributorArea'; +import { breakpoints, colors, fonts, spacing } from '../../utils/styles'; const ProductListingHeaderRoot = styled(`header`)` display: flex; @@ -50,22 +39,15 @@ const Intro = styled(`p`)` } `; -const ProductListingHeader = props => { - return ( - - Get Gatsby Swag! - - The money we charge for swag helps to cover production and shipping - costs. In the unlikely event that Gatsby swag ends up turning a profit, - we’ll reinvest that money into the open source community.{' '} - {/* - Read more + - */} - - - ); -}; - -ProductListingHeader.propTypes = {}; +const ProductListingHeader = () => ( + + Get Gatsby Swag! + + The money we charge for swag helps to cover production and shipping costs. + In the unlikely event that Gatsby swag ends up turning a profit, we’ll + reinvest that money into the open source community. + + +); export default ProductListingHeader; diff --git a/src/components/ProductListing/ProductListingItem.js b/src/components/ProductListing/ProductListingItem.js index 217f92db..29bd43ad 100644 --- a/src/components/ProductListing/ProductListingItem.js +++ b/src/components/ProductListing/ProductListingItem.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; import { Link } from 'gatsby'; diff --git a/src/components/ProductPage/BackLink.js b/src/components/ProductPage/BackLink.js index ad052efe..37ffdd32 100644 --- a/src/components/ProductPage/BackLink.js +++ b/src/components/ProductPage/BackLink.js @@ -1,11 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import { Link } from 'gatsby'; - import { MdArrowBack } from 'react-icons/md'; -import InterfaceContext from '../../context/InterfaceContext'; import { Button } from '../shared/Buttons'; import { breakpoints, colors, fonts, spacing } from '../../utils/styles'; @@ -45,17 +42,13 @@ const BackToListing = styled(Button)` } `; -const BackLink = props => { - const { children, className, to, callback } = props; - - return ( - - - {children} - - - ); -}; +const BackLink = ({ children, className }) => ( + + + {children} + + +); BackLink.propTypes = { children: PropTypes.node.isRequired, diff --git a/src/components/ProductPage/ProductForm.js b/src/components/ProductPage/ProductForm.js index f37252ca..18b918ed 100644 --- a/src/components/ProductPage/ProductForm.js +++ b/src/components/ProductPage/ProductForm.js @@ -10,15 +10,8 @@ import { } from 'react-icons/md'; import { Fieldset, Input, Label, Select, Submit } from '../shared/FormElements'; -import { PrimaryButton } from '../shared/Buttons'; -import { - breakpoints, - colors, - fonts, - spacing, - radius -} from '../../utils/styles'; +import { breakpoints, colors, spacing, radius } from '../../utils/styles'; import StoreContext from '../../context/StoreContext'; import Link from '../shared/Link'; @@ -166,10 +159,9 @@ class ProductForm extends Component { }; render() { - const { id: rawId, variants } = this.props; + const { variants } = this.props; const { errors } = this.state; - const id = rawId.substring(58, 64); const hasVariants = variants.length > 1; /* diff --git a/src/components/ProductPage/ProductImage.js b/src/components/ProductPage/ProductImage.js index 80f7d9d4..3486dd7a 100644 --- a/src/components/ProductPage/ProductImage.js +++ b/src/components/ProductPage/ProductImage.js @@ -2,11 +2,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Image from 'gatsby-image'; import styled, { keyframes } from 'react-emotion'; - import { MdZoomIn } from 'react-icons/md'; -import InterfaceContext from '../../context/InterfaceContext'; - import { breakpoints, colors, radius, spacing } from '../../utils/styles'; export const IMAGE_CHANGE_ANIM_DURATION = 250; diff --git a/src/components/ProductPage/ProductImagesBrowser.js b/src/components/ProductPage/ProductImagesBrowser.js index 788b3971..2dad2562 100644 --- a/src/components/ProductPage/ProductImagesBrowser.js +++ b/src/components/ProductPage/ProductImagesBrowser.js @@ -2,17 +2,15 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Image from 'gatsby-image'; import styled, { keyframes } from 'react-emotion'; -import { debounce } from '../../utils/helpers'; - import { MdClose, MdZoomIn, MdZoomOut } from 'react-icons/md'; -import InterfaceContext from '../../context/InterfaceContext'; import CommunityCaption from './CommunityCaption'; import ProductThumbnails, { ProductThumbnailsContent, Thumbnail } from './ProductThumbnails'; import { Button } from '../shared/Buttons'; +import { debounce } from '../../utils/helpers'; import { breakpoints, diff --git a/src/components/ProductPage/ProductImagesDesktop.js b/src/components/ProductPage/ProductImagesDesktop.js index 03d9acf1..8db710de 100644 --- a/src/components/ProductPage/ProductImagesDesktop.js +++ b/src/components/ProductPage/ProductImagesDesktop.js @@ -2,12 +2,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import { MdCameraAlt } from 'react-icons/md'; - -import ProductImage, { StyledImage } from './ProductImage'; +import ProductImage from './ProductImage'; import ProductThumbnails, { Thumbnail } from './ProductThumbnails'; -import { radius, fonts, spacing, colors } from '../../utils/styles'; +import { spacing } from '../../utils/styles'; const THUMBNAIL_SIZE = '54px'; diff --git a/src/components/ProductPage/ProductImagesMobile.js b/src/components/ProductPage/ProductImagesMobile.js index 4303da7a..e1db9ebe 100644 --- a/src/components/ProductPage/ProductImagesMobile.js +++ b/src/components/ProductPage/ProductImagesMobile.js @@ -1,7 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; - import { MdCameraAlt } from 'react-icons/md'; import ProductImage, { StyledImage } from './ProductImage'; diff --git a/src/components/ProductPage/ProductPage.js b/src/components/ProductPage/ProductPage.js index b3e97431..eed26a8c 100644 --- a/src/components/ProductPage/ProductPage.js +++ b/src/components/ProductPage/ProductPage.js @@ -1,5 +1,4 @@ import React, { Component } from 'react'; -import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; @@ -9,7 +8,7 @@ import ProductSpecs from './ProductSpecs'; import ProductForm from './ProductForm'; import BackLink from './BackLink'; -import { breakpoints, colors, fonts, spacing } from '../../utils/styles'; +import { breakpoints, spacing } from '../../utils/styles'; const ProductPageRoot = styled('div')` padding-bottom: ${spacing.md}px; @@ -58,7 +57,6 @@ class ProductPage extends Component { const { isDesktopViewport, - productImagesBrowserStatus, productImageFeatured, toggleProductImagesBrowser } = this.props; diff --git a/src/components/ProductPage/ProductSpecs.js b/src/components/ProductPage/ProductSpecs.js index 85112582..6f6d4b07 100644 --- a/src/components/ProductPage/ProductSpecs.js +++ b/src/components/ProductPage/ProductSpecs.js @@ -45,7 +45,6 @@ const ProductSpecs = props => { product: { title, description, - variants, variants: [variant] } } = props; diff --git a/src/components/ProductPage/ProductThumbnails.js b/src/components/ProductPage/ProductThumbnails.js index fb909e54..c594d99f 100644 --- a/src/components/ProductPage/ProductThumbnails.js +++ b/src/components/ProductPage/ProductThumbnails.js @@ -5,13 +5,7 @@ import Image from 'gatsby-image'; import InterfaceContext from '../../context/InterfaceContext'; -import { - breakpoints, - colors, - fonts, - radius, - spacing -} from '../../utils/styles'; +import { breakpoints, colors, radius, spacing } from '../../utils/styles'; const THUMBNAIL_SIZE = '44px'; diff --git a/src/components/shared/Buttons.js b/src/components/shared/Buttons.js index f011f7e7..28fd3e60 100644 --- a/src/components/shared/Buttons.js +++ b/src/components/shared/Buttons.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import styled from 'react-emotion'; import { Link } from 'gatsby'; -import { colors, fonts, radius, spacing } from '../../utils/styles'; +import { colors, fonts, radius } from '../../utils/styles'; export const ButtonBase = styled(`button`)` align-items: center; diff --git a/src/components/shared/FormElements.js b/src/components/shared/FormElements.js index 8be070d9..5e351c8f 100644 --- a/src/components/shared/FormElements.js +++ b/src/components/shared/FormElements.js @@ -1,10 +1,8 @@ -import React from 'react'; -import PropTypes from 'prop-types'; import styled from 'react-emotion'; import { PrimaryButton } from './Buttons'; -import { colors, fonts, radius, spacing } from '../../utils/styles'; +import { colors, radius, spacing } from '../../utils/styles'; export const Input = styled(`input`)` background-color: ${colors.lightest}; diff --git a/src/components/shared/Link.js b/src/components/shared/Link.js index b4ade07b..c57d08f4 100644 --- a/src/components/shared/Link.js +++ b/src/components/shared/Link.js @@ -3,13 +3,7 @@ import PropTypes from 'prop-types'; import styled from 'react-emotion'; import { Link as GatsbyLink } from 'gatsby'; -import { - breakpoints, - colors, - fonts, - radius, - spacing -} from '../../utils/styles'; +import { colors, radius, spacing } from '../../utils/styles'; const LinkRoot = styled(GatsbyLink)` align-items: center; @@ -51,7 +45,7 @@ const LinkRoot = styled(GatsbyLink)` `; const Link = props => { - const { children, className = '', inline = false } = props; + const { children } = props; return {children}; }; diff --git a/src/components/shared/Typography.js b/src/components/shared/Typography.js index 8ad75360..718c8b2d 100644 --- a/src/components/shared/Typography.js +++ b/src/components/shared/Typography.js @@ -1,6 +1,6 @@ -import styled, { keyframes, css } from 'react-emotion'; +import styled from 'react-emotion'; -import { breakpoints, colors, fonts, spacing } from '../../utils/styles'; +import { breakpoints, colors, spacing } from '../../utils/styles'; export const TextContainer = styled(`div`)` margin: 0; diff --git a/src/pages/404.js b/src/pages/404.js index 1c620318..2f2d1e46 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,16 +1,6 @@ import React from 'react'; -import styled from 'react-emotion'; import { Heading, Text, TextContainer } from '../components/shared/Typography'; -import { - colors, - fonts, - spacing, - pullHeadline, - breakpoints, - dimensions -} from '../utils/styles'; - const NotFoundPage = () => ( Whoops - That Page Doesn’t Exist (404) diff --git a/src/pages/index.js b/src/pages/index.js index d40e8299..e4afa76a 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,7 +1,6 @@ import React from 'react'; -import Layout from '../components/Layout'; import ProductListing from '../components/ProductListing'; -const IndexPage = ({ location }) => ; +const IndexPage = () => ; export default IndexPage; diff --git a/src/pages/login.js b/src/pages/login.js index 6e126248..136dac25 100644 --- a/src/pages/login.js +++ b/src/pages/login.js @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'react-emotion'; -import { isAuthenticated, login } from '../utils/auth'; +import { isAuthenticated } from '../utils/auth'; import { TextContainer, Text as BaseText @@ -13,8 +13,6 @@ const Text = styled(BaseText)` export default () => { if (!isAuthenticated()) { - // login(); - return ( Redirecting you to the login screen... diff --git a/src/utils/styles.js b/src/utils/styles.js index 4e66269b..27b17717 100644 --- a/src/utils/styles.js +++ b/src/utils/styles.js @@ -1,4 +1,4 @@ -import { css, keyframes } from 'react-emotion'; +import { keyframes } from 'react-emotion'; /* * NOTE: use a six-character hex code for all colors to allow alpha channel