-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added post-hero-caption component and relevant mdx properties, with e…
…xample usage (#95)
- Loading branch information
Showing
6 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/gatsby-theme-blog/src/components/post-hero-caption.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react" | ||
import { Styled, css, Flex } from "theme-ui" | ||
|
||
const PostHeroCaption = ({ text, url }) => { | ||
console.log(__filename, `text`, { text, url }) | ||
return ( | ||
<> | ||
{text && ( | ||
<Flex> | ||
{url ? ( | ||
<Styled.a | ||
css={css({ margin: `auto`, fontStyle: `italic` })} | ||
href={url} | ||
target="_blank" | ||
> | ||
{text} | ||
</Styled.a> | ||
) : ( | ||
<Styled.i css={css({ margin: `auto` })}>{text}</Styled.i> | ||
)} | ||
</Flex> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default PostHeroCaption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters