Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 6, 2018 13:28
Show Gist options
  • Save amandeepmittal/7e048de1e1406ce68cf972db57476560 to your computer and use it in GitHub Desktop.
Save amandeepmittal/7e048de1e1406ce68cf972db57476560 to your computer and use it in GitHub Desktop.
import Link from 'next/link';
const StoryList = ({ stories }) => (
<div className="story-list">
{stories.map(story => (
<div key={story.id} className="story">
<h2 className="story-title">
<a href={story.url}>{story.title}</a>
</h2>
<div className="story-detail">
<span>{story.points || 0} points</span>
<Link href={`/story?id=${story.id}`}>
<a>{story.comments_count || 0} comments</a>
</Link>
</div>
</div>
))}
</div>
);
export default StoryList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment