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

Commit

Permalink
feat: add <DonateButton/>
Browse files Browse the repository at this point in the history
  • Loading branch information
CanRau committed Dec 12, 2019
1 parent ad19c62 commit 0d2b8f1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/components/DonateButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @jsx jsx */
import { jsx } from 'theme-ui'
import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faPaypal } from '@fortawesome/free-brands-svg-icons/faPaypal'
import { faCcVisa } from '@fortawesome/free-brands-svg-icons/faCcVisa'
import { faCcMastercard } from '@fortawesome/free-brands-svg-icons/faCcMastercard'
import { faCcAmex } from '@fortawesome/free-brands-svg-icons/faCcAmex'
import Link from '@components/Link'

export const DonateButton = ({ paymentOptions = false, ...props }) => (
<div>
<Link {...props} />

{!!paymentOptions && (
<div sx={{ display: `flex` }}>
<FontAwesomeIcon icon={faPaypal} />
<FontAwesomeIcon icon={faCcVisa} />
<FontAwesomeIcon icon={faCcMastercard} />
<FontAwesomeIcon icon={faCcAmex} />
</div>
)}
</div>
)

DonateButton.propTypes = {
paymentOptions: PropTypes.bool,
}
11 changes: 10 additions & 1 deletion src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
import React from 'react'
import { MDXProvider } from '@mdx-js/react'
import Link from '@components/Link'
import DonateButton from '@components/DonateButton'
// import { VideoPlayer } from '@gaiama/react-video-player'
// import { TableOfContents } from "@gaiama/react-mdx-table-of-contents"

Expand All @@ -13,6 +15,13 @@ import { MDXProvider } from '@mdx-js/react'
// }

/* components={{ VideoPlayer }} */
const Layout = ({ children }) => <MDXProvider>{children}</MDXProvider>
const components = {
Link,
DonateButton,
}

const Layout = ({ children }) => (
<MDXProvider components={components}>{children}</MDXProvider>
)

export default Layout

0 comments on commit 0d2b8f1

Please sign in to comment.