Skip to content

Instantly share code, notes, and snippets.

@kenakingkong
Last active November 25, 2020 23:03
Show Gist options
  • Save kenakingkong/dadfb181c0f4f8fcef0493aa7d73e218 to your computer and use it in GitHub Desktop.
Save kenakingkong/dadfb181c0f4f8fcef0493aa7d73e218 to your computer and use it in GitHub Desktop.
@src/components/stack.js
//@src/components/stack.js
import React from 'react';
import { StaticQuery, graphql } from "gatsby"
import { CardWrapper } from 'react-swipeable-cards';
import {MyCard, MyEndCard} from './mycard'
const Stack = () => (
<StaticQuery
query={graphql`
query MediumFeedQuery {
allMediumFeed {
nodes {
title
link
date(formatString: "MM-DD-YYYY")
content
}
totalCount
}
}
`}
render={poems => (
<CardWrapper addEndCard={() => <MyEndCard />}>
{poems.allMediumFeed.nodes.map(poem => (
<MyCard poem={poem} />
))}
</CardWrapper>
)}
/>
)
export default Stack;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment