Skip to content

Commit

Permalink
chore: buy me a coffee μ„€μ • (#91)
Browse files Browse the repository at this point in the history
buy me a coffee 지원을 μœ„ν•œ μ„€μ •κ³Ό μ»΄ν¬λ„ŒνŠΈλ₯Ό 좔가함.
κ·ΈλŸ¬λ‚˜ λ°˜λ“œμ‹œ ν•„μš”ν•œ κΈ°λŠ₯도 μ•„λ‹ˆκ³  μ–Όλ§ˆλ‚˜ μ΄μš©ν•  지
λͺ¨λ₯΄λŠ” μƒν™©μ—μ„œ 였히렀 UIλ₯Ό ν•΄μΉœλ‹€κ³  νŒλ‹¨λ˜μ–΄
화면에 μΆ”κ°€ν•˜μ§€ μ•ŠμŒ.

Signed-off-by: chayeoi <[email protected]>
  • Loading branch information
chayeoi committed Mar 3, 2020
1 parent 5a62d2f commit cbffac1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
{ name: 'rss', value: 'https://chny.world/rss', href: 'https://feedly.com/i/subscription/feed/https://chny.world/rss.xml' },
// { name: 'codepen', value: 'chayeoi' },
],
buyMeACoffee: 'chayeoi',
facebook: {
author: 'https://www.facebook.com/chayeoi',
},
Expand Down
59 changes: 59 additions & 0 deletions src/components/coffee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/** @jsx jsx */
import { css, jsx } from '@emotion/core'
import React from 'react'

interface Props {
slug: string;
}

const Coffee: React.FC<Props> = ({ slug }) => (
<React.Fragment>
<link href="https://fonts.googleapis.com/css?family=Cookie" rel="stylesheet" />
<a
css={s.root}
target="_blank"
rel="noopener noreferrer"
href={`https://buymeacoff.ee/${slug}`}
>
<img
css={s.image}
src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg"
alt="Buy me a coffee"
/>
<span>
Buy me a coffee
</span>
</a>
</React.Fragment>
)

const s = {
root: css`
display: flex;
justify-content: center;
align-items: center;
padding: 8px 24px;
border-radius: 2px;
color: #ffffff;
background-color: #FF813F;
font-family: 'Cookie', cursive;
font-size: 1.75rem;
font-weight: 700;
text-align: center;
transition: opacity 0.4s, box-shadow 0.4s;
box-shadow: 0 2px 8px 0 rgba(225,129,63,.35);
:hover, :focus {
color: #ffffff;
opacity: 0.87;
box-shadow: 0 4px 16px 0 rgba(255,129,63,.45);
}
`,
image: css`
width: 20px;
height: auto;
margin-right: 1rem;
`,
}

export default Coffee

2 changes: 2 additions & 0 deletions src/templates/blog-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ interface Props {
};
site: {
siteMetadata: {
buyMeACoffee?: string;
facebook: {
author: string;
};
Expand Down Expand Up @@ -196,6 +197,7 @@ export const query = graphql`
}
site {
siteMetadata {
buyMeACoffee
facebook {
author
}
Expand Down

0 comments on commit cbffac1

Please sign in to comment.