Adds styling

This commit is contained in:
Rob Cameron
2020-10-07 16:12:09 -07:00
parent b00bd8bba6
commit 1e1166978b
7 changed files with 89 additions and 54 deletions

View File

@@ -1,14 +1,14 @@
import { Link,routes } from '@redwoodjs/router'
import { Link, routes } from '@redwoodjs/router'
const BlogPost = ({ post }) => {
return (
<article>
<article className="mt-10">
<header>
<h2>
<h2 className="text-xl text-blue-700 font-semibold">
<Link to={routes.blogPost({ id: post.id })}>{post.title}</Link>
</h2>
</header>
<div>{post.body}</div>
<div className="mt-2 text-gray-900 font-light">{post.body}</div>
</article>
)
}

View File

@@ -1,4 +1,4 @@
import { Link,routes } from '@redwoodjs/router'
import { Link, routes } from '@redwoodjs/router'
import BlogPost from 'src/components/BlogPost'
export const QUERY = gql`
@@ -19,5 +19,11 @@ export const Empty = () => <div>Empty</div>
export const Failure = ({ error }) => <div>Error: {error.message}</div>
export const Success = ({ posts }) => {
return posts.map((post) => <BlogPost key={post.id} post={post} />)
return (
<div className="-mt-12">
{posts.map((post) => (
<BlogPost key={post.id} post={post} />
))}
</div>
)
}