Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
feat(Donations): add contributor list to SupportPage
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Dec 1, 2018
1 parent ff60c85 commit 25a5fc6
Showing 1 changed file with 77 additions and 3 deletions.
80 changes: 77 additions & 3 deletions src/templates/SupportPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import { graphql } from 'gatsby'
import { graphql, Link } from 'gatsby'
import Img from 'gatsby-image'
import styled from 'react-emotion'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
Expand All @@ -13,6 +13,43 @@ import CheckMark from '@/assets/check.png'
import TitledCopy from '@/components/TitledCopy'
import { colors, fullPageWidth, media, fontFamilies, visible } from '../theme'

const ContributorListTitle = styled.h2`
margin: 2rem 0 0;
`
const ContributorList = styled.div`
margin-top: 1rem;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
`
const ContributorListLink = styled(Link)`
margin-top: 1rem;
display: inline-block;
font-size: 0.85rem;
${media.greaterThan(`small`)} {
font-size: 1rem;
}
`
const Contributor = styled.div`
width: 100%;
flex-shrink: 0;
max-width: 100%;
${media.lessThan(`small`)} {
:nth-child(1n + 5) {
display: none;
}
}
${media.greaterThan(`small`)} {
width: 48%;
}
${media.greaterThan(`medium`)} {
width: 30%;
}
${media.greaterThan(`xxlarge`)} {
width: 24%;
}
`

const StyledA = styled.a`
border: none;
:hover {
Expand All @@ -21,7 +58,10 @@ const StyledA = styled.a`
`

const SupportPage = props => {
const { frontmatter } = props.data.page
const {
page: { frontmatter },
contributors,
} = props.data
const initialStyle = css(visible.maxMd, {
fontFamily: fontFamilies.accent,
fontSize: `2.9rem`,
Expand Down Expand Up @@ -268,7 +308,7 @@ const SupportPage = props => {

<div
css={{
margin: `3rem 0 6rem`,
margin: `3rem 0 3rem`,
display: `flex`,
[media.lessThan(`small`)]: {
flexDirection: `column`,
Expand Down Expand Up @@ -342,8 +382,23 @@ const SupportPage = props => {
))}
</div>

<div>
<ContributorListTitle id="contributors">
{frontmatter.contributors.title}
</ContributorListTitle>
<ContributorList>
{contributors.edges.map(x => (
<Contributor key={x.node.key}>{x.node.name}</Contributor>
))}
</ContributorList>
<ContributorListLink to={frontmatter.contributors.link}>
{frontmatter.contributors.linkLabel}
</ContributorListLink>
</div>

<div
css={{
marginTop: `4rem`,
background: colors.lightBlue,
position: `relative`,
padding: `2rem 1rem`,
Expand Down Expand Up @@ -542,6 +597,11 @@ export const query = graphql`
}
}
}
contributors {
title
link
linkLabel
}
checklists {
left {
title
Expand All @@ -558,5 +618,19 @@ export const query = graphql`
}
}
}
contributors: allPayPalJson(
sort: { fields: [date], order: DESC }
limit: 16
) {
edges {
node {
key
name
date
amount
}
}
}
}
`

0 comments on commit 25a5fc6

Please sign in to comment.