bunch of stuff
This commit is contained in:
31
web/src/components/PostsCell/PostsCell.js
Normal file
31
web/src/components/PostsCell/PostsCell.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
import Posts from 'src/components/Posts'
|
||||
|
||||
export const QUERY = gql`
|
||||
query POSTS {
|
||||
posts {
|
||||
id
|
||||
title
|
||||
body
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const Loading = () => <div>Loading...</div>
|
||||
|
||||
export const Empty = () => {
|
||||
return (
|
||||
<div className="rw-text-center">
|
||||
{'No posts yet. '}
|
||||
<Link to={routes.newPost()} className="rw-link">
|
||||
{'Create one?'}
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const Success = ({ posts }) => {
|
||||
return <Posts posts={posts} />
|
||||
}
|
||||
Reference in New Issue
Block a user