Last active
December 30, 2020 11:10
-
-
Save tobob/da108275d8c51f1219f6fc7cce952041 to your computer and use it in GitHub Desktop.
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
import React from "react"; | |
import { graphql } from "gatsby"; | |
const QuoteComponent = ({ quote, author, theme }) => ( | |
<div | |
style={{ | |
backgroundColor: theme, | |
padding: "30px", | |
width: "80%", | |
margin: "0 0 auto", | |
}} | |
> | |
<div | |
style={{ fontSize: "40px" }} | |
dangerouslySetInnerHTML={{ | |
__html: quote.childMarkdownRemark.html, | |
}} | |
/> | |
<h4 style={{ width: "100%", textAlign: "right", fontStyle: "italic" }}> | |
---- {author} | |
</h4> | |
</div> | |
); | |
export default QuoteComponent; | |
export const modelName = "ContentfulQuoteComponent"; | |
export const query = graphql` | |
fragment QuoteComponentFragment on ContentfulQuoteComponent { | |
quote { | |
childMarkdownRemark { | |
html | |
} | |
} | |
author | |
theme | |
__typename | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment