Skip to content

Instantly share code, notes, and snippets.

View tobob's full-sized avatar
😼
wanna something?

Wojciech Bożek tobob

😼
wanna something?
View GitHub Profile
import React from 'react'
import { graphql } from 'gatsby'
import { Helmet } from 'react-helmet'
import React from "react";
import { graphql } from "gatsby";
import { Helmet } from "react-helmet";
import get from "lodash/get";
import Img from "gatsby-image";
import Layout from "../components/layout";
import QuoteComponent, {
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",
import React from "react"
import { graphql } from "gatsby"
import RichText from '@madebyconnor/rich-text-to-jsx';
const WallOfTextComponent = ({text}) => <RichText richText={text.json} />
export default WallOfTextComponent
export const modelName = 'ContentfulWallOfTextComponent';
import React from "react";
import { graphql } from "gatsby";
import Gist from "super-react-gist";
const CodeComponent = ({ url }) => <Gist url={url} />;
export default CodeComponent;
export const modelName = "ContentfulCodeComponent";
const content = () => {
if(post.contentReferences) {
return(post.contentReferences.map(reference => {
switch(reference.__typename) {
case 'ContentfulCodeComponent': {
return <CodeComponent {...reference} />
}
default:
return null
}
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
contentfulBlogPost(slug: { eq: $slug }) {
title
publishDate(formatString: "MMMM Do, YYYY")
heroImage {
fluid(maxWidth: 1180, background: "rgb:000000") {
...GatsbyContentfulFluid_tracedSVG
}
}
@tobob
tobob / 3rdPageQuery.js
Last active December 30, 2020 11:12
3rdPageQuery.js
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
contentfulBlogPost(slug: { eq: $slug }) {
title
publishDate(formatString: "MMMM Do, YYYY")
heroImage {
fluid(maxWidth: 1180, background: "rgb:000000") {
...GatsbyContentfulFluid_tracedSVG
}
}
import React from "react"
import { graphql } from "gatsby"
const CodeComponent = () => <div><span></span></div>
export default CodeComponent
export const query = graphql`
fragment CodeComponentFragment on ContentfulCodeComponent {
url
query BlogPostBySlug($slug: String!) {
contentfulBlogPost(slug: { eq: $slug }) {
contentReferences {
... on ContentfulCodeComponent {
url
__typename
}
}
}
}
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
contentfulBlogPost(slug: { eq: $slug }) {
title
publishDate(formatString: "MMMM Do, YYYY")
heroImage {
fluid(maxWidth: 1180, background: "rgb:000000") {
...GatsbyContentfulFluid_tracedSVG
}
}