mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 12:42:28 +02:00
Upgrade to Gatsby v2
This commit is contained in:
47
src/components/Post/Author/Author.js
Normal file
47
src/components/Post/Author/Author.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import React from 'react';
|
||||
import { graphql, StaticQuery } from 'gatsby';
|
||||
import { getContactHref } from '../../../utils';
|
||||
import styles from './Author.module.scss';
|
||||
|
||||
export const PureAuthor = ({ data }) => {
|
||||
const { author } = data.site.siteMetadata;
|
||||
|
||||
return (
|
||||
<div className={styles['author']}>
|
||||
<p className={styles['author__bio']}>
|
||||
{author.bio}
|
||||
<a
|
||||
className={styles['author__bio-twitter']}
|
||||
href={getContactHref('twitter', author.contacts.twitter)}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
>
|
||||
<strong>{author.name}</strong> on Twitter
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const Author = (props) => (
|
||||
<StaticQuery
|
||||
query={graphql`
|
||||
query AuthorQuery {
|
||||
site {
|
||||
siteMetadata {
|
||||
author {
|
||||
name
|
||||
bio
|
||||
contacts {
|
||||
twitter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`}
|
||||
render={(data) => <PureAuthor {...props} data={data} />}
|
||||
/>
|
||||
);
|
||||
|
||||
export default Author;
|
Reference in New Issue
Block a user