diff --git a/web/src/components/PartReactions/PartReactions.js b/web/src/components/PartReactions/PartReactions.js
new file mode 100644
index 0000000..d47e878
--- /dev/null
+++ b/web/src/components/PartReactions/PartReactions.js
@@ -0,0 +1,69 @@
+import { useState } from 'react'
+import Tab from '@material-ui/core/Tab'
+import Tabs from '@material-ui/core/Tabs'
+import { Link, routes } from '@redwoodjs/router'
+import { countEmotes } from 'src/helpers/emote'
+import ImageUploader from 'src/components/ImageUploader'
+
+const PartReactions = ({ reactions }) => {
+ const emotes = countEmotes(reactions)
+ const [tab, setTab] = useState(0)
+ const onTabChange = (_, newValue) => {
+ setTab(newValue)
+ }
+
+ return (
+ <>
+
+
+ {emotes.map((emote, i) => (
+
+ ))}
+
+
+ {reactions
+ .filter((reaction) => reaction.emote === emotes[tab].emoji)
+ .map((reactionPart, i) => (
+ -
+
+
+
+
+
+
+ {reactionPart.user?.userName}
+
+
+
+
+ ))}
+
+
+ >
+ )
+}
+
+export default PartReactions
diff --git a/web/src/components/ReactionList/ReactionList.test.js b/web/src/components/PartReactions/PartReactions.test.js
similarity index 100%
rename from web/src/components/ReactionList/ReactionList.test.js
rename to web/src/components/PartReactions/PartReactions.test.js
diff --git a/web/src/components/PartReactionsCell/PartReactionsCell.js b/web/src/components/PartReactionsCell/PartReactionsCell.js
index 1d311e2..d0f4bc9 100644
--- a/web/src/components/PartReactionsCell/PartReactionsCell.js
+++ b/web/src/components/PartReactionsCell/PartReactionsCell.js
@@ -1,12 +1,16 @@
+import PartReactions from 'src/components/PartReactions'
+
export const QUERY = gql`
- query PartReactionsQuery {
- partReactions {
+ query PartReactionsQuery($partId: String!) {
+ partReactionsByPartId(partId: $partId) {
id
emote
user {
id
- name
+ userName
+ image
}
+ updatedAt
}
}
`
@@ -17,6 +21,6 @@ export const Empty = () => Empty
export const Failure = ({ error }) => Error: {error.message}
-export const Success = ({ partReactions }) => {
- return JSON.stringify(partReactions)
+export const Success = ({ partReactionsByPartId }) => {
+ return //JSON.stringify(partReactions)
}
diff --git a/web/src/components/ReactionList/ReactionList.js b/web/src/components/ReactionList/ReactionList.js
deleted file mode 100644
index 3aeaa8a..0000000
--- a/web/src/components/ReactionList/ReactionList.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import { useState } from 'react'
-import Dialog from '@material-ui/core/Dialog'
-import Tab from '@material-ui/core/Tab'
-import Tabs from '@material-ui/core/Tabs'
-
-export const QUERY = gql`
- query FIND_PART_BY_USERNAME_TITLE(
- $userName: String!
- $partTitle: String
- $currentUserId: String
- ) {
- userPart: userName(userName: $userName) {
- id
- name
- userName
- bio
- image
- Part(partTitle: $partTitle) {
- id
- title
- description
- code
- mainImage
- createdAt
- updatedAt
- userId
- Reaction {
- emote
- user {
- userName
- image
- }
- }
- userReactions: Reaction(userId: $currentUserId) {
- emote
- }
- Comment {
- id
- text
- user {
- userName
- image
- }
- }
- }
- }
- }
-`
-
-const emojiMenu = ['all', '❤️', '👍', '😄', '🙌']
-
-const ReactionList = ({}) => {
- return (
-
- )
-}
-
-export default ReactionList