2020-05-22 14:38:19 +02:00
|
|
|
import React, { ReactElement } from 'react'
|
2023-01-26 19:36:45 +01:00
|
|
|
import { useSiteMetadata } from '../../../hooks/useSiteMetadata'
|
2019-12-14 15:46:43 +01:00
|
|
|
import Icon from '../../atoms/Icon'
|
2023-01-29 22:58:19 +01:00
|
|
|
import * as styles from './Actions.module.css'
|
2019-10-02 13:35:50 +02:00
|
|
|
|
2019-10-28 23:47:29 +01:00
|
|
|
interface ActionProps {
|
|
|
|
title: string
|
|
|
|
text: string
|
2021-03-14 01:34:04 +01:00
|
|
|
icon: string
|
2019-10-28 23:47:29 +01:00
|
|
|
url?: string
|
|
|
|
onClick?(): void
|
|
|
|
}
|
2019-10-02 13:35:50 +02:00
|
|
|
|
2021-03-14 01:34:04 +01:00
|
|
|
const Action = ({ title, text, url, icon, onClick }: ActionProps) => {
|
2019-10-02 15:32:01 +02:00
|
|
|
return (
|
2022-11-11 03:31:54 +01:00
|
|
|
<a className={styles.action} href={url} onClick={onClick}>
|
2021-03-14 01:34:04 +01:00
|
|
|
<Icon name={icon} />
|
2022-11-11 03:31:54 +01:00
|
|
|
<h1 className={styles.actionTitle}>{title}</h1>
|
|
|
|
<p className={styles.actionText}>{text}</p>
|
2019-10-02 15:32:01 +02:00
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}
|
2019-10-02 13:35:50 +02:00
|
|
|
|
|
|
|
export default function PostActions({
|
|
|
|
githubLink
|
|
|
|
}: {
|
|
|
|
githubLink: string
|
2020-05-22 14:38:19 +02:00
|
|
|
}): ReactElement {
|
2023-01-26 19:36:45 +01:00
|
|
|
const { author } = useSiteMetadata()
|
2019-10-02 13:35:50 +02:00
|
|
|
|
|
|
|
return (
|
2022-11-19 17:31:07 +01:00
|
|
|
<section className={styles.actions}>
|
2019-10-28 23:47:29 +01:00
|
|
|
<Action
|
|
|
|
title="Have a comment?"
|
2023-01-26 19:36:45 +01:00
|
|
|
text="Hit me up @krema@mas.to"
|
|
|
|
url={author.mastodon}
|
|
|
|
icon="Mastodon"
|
2019-10-28 23:47:29 +01:00
|
|
|
/>
|
|
|
|
<Action
|
|
|
|
title="Found something useful?"
|
2021-03-07 02:48:05 +01:00
|
|
|
text="Say thanks with BTC or ETH"
|
2019-11-17 23:56:29 +01:00
|
|
|
url="/thanks"
|
2021-03-14 01:34:04 +01:00
|
|
|
icon="Bitcoin"
|
2019-10-28 23:47:29 +01:00
|
|
|
/>
|
|
|
|
<Action
|
|
|
|
title="Edit on GitHub"
|
2021-03-07 02:48:05 +01:00
|
|
|
text="Contribute to this post"
|
2019-10-28 23:47:29 +01:00
|
|
|
url={githubLink}
|
2021-03-14 01:34:04 +01:00
|
|
|
icon="GitHub"
|
2019-10-28 23:47:29 +01:00
|
|
|
/>
|
2022-11-19 17:31:07 +01:00
|
|
|
</section>
|
2019-10-02 13:35:50 +02:00
|
|
|
)
|
|
|
|
}
|