Skip to content

Instantly share code, notes, and snippets.

@tobob
Last active December 30, 2020 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobob/da108275d8c51f1219f6fc7cce952041 to your computer and use it in GitHub Desktop.
Save tobob/da108275d8c51f1219f6fc7cce952041 to your computer and use it in GitHub Desktop.
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