diff --git a/web/src/components/EmojiReaction/EmojiReaction.js b/web/src/components/EmojiReaction/EmojiReaction.js index dbc931a..9a4d217 100644 --- a/web/src/components/EmojiReaction/EmojiReaction.js +++ b/web/src/components/EmojiReaction/EmojiReaction.js @@ -121,7 +121,9 @@ const EmojiReaction = ({ ))} - + diff --git a/web/src/components/PartCell/PartCell.js b/web/src/components/PartCell/PartCell.js index 05d736d..52a5e8b 100644 --- a/web/src/components/PartCell/PartCell.js +++ b/web/src/components/PartCell/PartCell.js @@ -3,6 +3,7 @@ import { navigate, routes } from '@redwoodjs/router' import { useAuth } from '@redwoodjs/auth' import PartProfile from 'src/components/PartProfile' +import { QUERY as PART_REACTION_QUERY } from 'src/components/PartReactionsCell/PartReactionsCell' export const QUERY = gql` query FIND_PART_BY_USERNAME_TITLE( @@ -156,6 +157,12 @@ export const Success = ({ userPart, variables: { isEditable }, refetch }) => { const [toggleReaction] = useMutation(TOGGLE_REACTION_MUTATION, { onCompleted: () => refetch(), + refetchQueries: [ + { + query: PART_REACTION_QUERY, + variables: { partId: userPart?.Part?.id }, + }, + ], }) const onReaction = (emote) => toggleReaction({ diff --git a/web/src/components/PartReactionsCell/PartReactionsCell.js b/web/src/components/PartReactionsCell/PartReactionsCell.js index 2cf4c0c..84f8429 100644 --- a/web/src/components/PartReactionsCell/PartReactionsCell.js +++ b/web/src/components/PartReactionsCell/PartReactionsCell.js @@ -17,7 +17,11 @@ export const QUERY = gql` export const Loading = () =>
Loading...
-export const Empty = () =>
Empty
+export const Empty = () => ( +
+ No reactions to this part yet 😕 +
+) export const Failure = ({ error }) =>
Error: {error.message}