Add basic version of post show page

This commit is contained in:
riggraz
2019-09-12 15:51:45 +02:00
parent 5ca113b545
commit f599471af1
18 changed files with 330 additions and 11 deletions

View File

@@ -16,6 +16,7 @@ const PostList = ({ posts, boards }: Props) => (
posts.length > 0 ?
posts.map((post, i) => (
<PostListItem
id={post.id}
title={post.title}
boardName={boards.find(board => board.id === post.board_id).name}

View File

@@ -1,12 +1,13 @@
import * as React from 'react';
interface Props {
id: number;
title: string;
boardName: string;
}
const PostListItem = ({title, boardName}: Props) => (
<a href="#" className="postLink">
const PostListItem = ({id, title, boardName}: Props) => (
<a href={`/posts/${id}`} className="postLink">
<div className="postListItem">
<div className="postTitle">{title}</div>
<div className="postBoard">{boardName}</div>