Skip to content

Instantly share code, notes, and snippets.

@3ndrius
Created January 1, 2019 22:08
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 3ndrius/72ee66866406fba6b4b60b6dddc2241d to your computer and use it in GitHub Desktop.
Save 3ndrius/72ee66866406fba6b4b60b6dddc2241d to your computer and use it in GitHub Desktop.
import React from 'react'
import CategoryCard from './../parts/CategoryCard';
import CaptionWrap from '../parts/Caption';
import Button from './../buttons/Button';
import H1 from '../headers/H1';
import ContainerCategory from './../parts/Contain';
import Position from './../parts/PositionContainer';
import { Link } from 'react-router-dom'
import Par from './../parts/Paragraph';
export default function Category(props) {
console.log("Props category", props);
return (
<ContainerCategory>
{props.category && props.category.map((item, index) => {
return(
<CategoryCard key={index} index={index + 1}>
<img src={item.metadata.img.url} alt="img" index={index + 1} />
<CaptionWrap index={index + 1}>
<Position index={index + 1}>
<H1 isBig>{item.title}</H1>
<Par dangerouslySetInnerHTML={{__html:item.content}}></Par>
<Link to={'/' + item.slug}><Button >See more</Button> </Link>
</Position>
</CaptionWrap>
</CategoryCard>
)
})}
</ContainerCategory>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment