Skip to content

Instantly share code, notes, and snippets.

@imparvez
Created May 12, 2018 14:31
Show Gist options
  • Save imparvez/06cb33bf349b958ea933aa3ab93858d3 to your computer and use it in GitHub Desktop.
Save imparvez/06cb33bf349b958ea933aa3ab93858d3 to your computer and use it in GitHub Desktop.
Food List App
import React, { Component } from 'react';
import styled from 'styled-components';
import Title from './Title';
import Image from './Image';
export default class RecipeCard extends Component {
render(){
console.log("PROPS=>", this.props);
return(
<div>
{this.props.meals.map((item, index) => {
return (
<Card
key={index}
href={item.strSource}>
<Image source={item.strMealThumb} text={item.strMeal} />
<Title title={item.strMeal} />
</Card>
)
})}
</div>
)
}
}
const Card = styled.a`
max-width: 350px;
width: 100%;
display: inline-block;
border-radius: 3px;
text-decoration: none;
color: #000;
margin: 0 10px 15px;
box-shadow: 7px 7px 50px -10px rgba(0, 0, 0, .5);
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment