Refactor feed into a component.

This commit is contained in:
Vishnu KS
2020-08-23 00:28:09 +05:30
parent b4cde4c777
commit defa5cb196
6 changed files with 92 additions and 30 deletions

View File

@@ -1,14 +1,30 @@
import React from "react";
import { Link } from "gatsby";
import React, { useState, useEffect } from "react"
import { graphql } from 'gatsby'
import Layout from "../components/layout"
import SEO from "../components/seo"
import SideBar from "../components/sidebar";
import {Container, Row, Col} from 'react-bootstrap';
import BookFeed from "../components/feed";
const basicTemplate = props => {
const { pageContext } = props
const { categoryName } = pageContext
const { categoryName, books } = pageContext
return (
<div>
{categoryName}
</div>
<Layout>
<SEO title="Home" />
<Container fluid>
<Row>
<Col xs={2}>
<SideBar />
</Col>
<Col>
<BookFeed books={books} categoryName={categoryName} />
</Col>
</Row>
</Container>
</Layout>
)
}
export default basicTemplate