issue-152 wasn't quiet solved correctly it showed all parts

on the user's profile instead of only their own parts
This commit is contained in:
Kurt Hutten
2020-12-13 13:41:46 +11:00
parent 6ce4031cae
commit 5dc14a6e5a
8 changed files with 118 additions and 8 deletions

View File

@@ -0,0 +1,47 @@
import { Link, routes } from '@redwoodjs/router'
import Parts from 'src/components/Parts'
export const QUERY = gql`
query PARTS_OF_USER($userName: String!) {
parts(userName: $userName) {
id
title
mainImage
createdAt
updatedAt
user {
image
userName
}
Reaction {
emote
}
}
}
`
export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No parts yet. '}
<Link to={routes.newPart()} className="rw-link">
{'Create one?'}
</Link>
</div>
)
}
export const Success = ({
parts,
variables: { shouldFilterPartsWithoutImage },
}) => {
return (
<Parts
parts={parts}
shouldFilterPartsWithoutImage={shouldFilterPartsWithoutImage}
/>
)
}