exposing who likes a part
This commit is contained in:
@@ -20,6 +20,7 @@ const EmojiReaction = ({
|
|||||||
emotes,
|
emotes,
|
||||||
userEmotes,
|
userEmotes,
|
||||||
onEmote = () => {},
|
onEmote = () => {},
|
||||||
|
onShowPartReactions,
|
||||||
className,
|
className,
|
||||||
}) => {
|
}) => {
|
||||||
const { currentUser } = useAuth()
|
const { currentUser } = useAuth()
|
||||||
@@ -107,17 +108,20 @@ const EmojiReaction = ({
|
|||||||
horizontal: 'left',
|
horizontal: 'left',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="p-2 pr-3 flex">
|
<div className="p-2 pr-3 flex flex-col">
|
||||||
{emojiMenu.map((emoji, i) => (
|
<div className="inline-flex">
|
||||||
<button
|
{emojiMenu.map((emoji, i) => (
|
||||||
className="p-2"
|
<button
|
||||||
style={textShadow}
|
className="p-2"
|
||||||
key={`${emoji}-${i}}`}
|
style={textShadow}
|
||||||
onClick={() => handleEmojiClick(emoji)}
|
key={`${emoji}-${i}}`}
|
||||||
>
|
onClick={() => handleEmojiClick(emoji)}
|
||||||
{emoji}
|
>
|
||||||
</button>
|
{emoji}
|
||||||
))}
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<button onClick={onShowPartReactions}>View Reactions</button>
|
||||||
</div>
|
</div>
|
||||||
</Popover>
|
</Popover>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ import { useState, useEffect, useRef } from 'react'
|
|||||||
import { useAuth } from '@redwoodjs/auth'
|
import { useAuth } from '@redwoodjs/auth'
|
||||||
import { Link, navigate, routes } from '@redwoodjs/router'
|
import { Link, navigate, routes } from '@redwoodjs/router'
|
||||||
import Editor from 'rich-markdown-editor'
|
import Editor from 'rich-markdown-editor'
|
||||||
|
import Dialog from '@material-ui/core/Dialog'
|
||||||
|
|
||||||
import ImageUploader from 'src/components/ImageUploader'
|
import ImageUploader from 'src/components/ImageUploader'
|
||||||
import ConfirmDialog from 'src/components/ConfirmDialog'
|
import ConfirmDialog from 'src/components/ConfirmDialog'
|
||||||
import Breadcrumb from 'src/components/Breadcrumb'
|
import Breadcrumb from 'src/components/Breadcrumb'
|
||||||
import EmojiReaction from 'src/components/EmojiReaction'
|
import EmojiReaction from 'src/components/EmojiReaction'
|
||||||
import Button from 'src/components/Button'
|
import Button from 'src/components/Button'
|
||||||
|
import PartReactionsCell from '../PartReactionsCell'
|
||||||
import { countEmotes } from 'src/helpers/emote'
|
import { countEmotes } from 'src/helpers/emote'
|
||||||
import { getActiveClasses } from 'get-active-classes'
|
import { getActiveClasses } from 'get-active-classes'
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ const PartProfile = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const [comment, setComment] = useState('')
|
const [comment, setComment] = useState('')
|
||||||
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false)
|
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false)
|
||||||
|
const [isReactionsModalOpen, setIsReactionsModalOpen] = useState(false)
|
||||||
const [isInvalid, setIsInvalid] = useState(false)
|
const [isInvalid, setIsInvalid] = useState(false)
|
||||||
const { currentUser } = useAuth()
|
const { currentUser } = useAuth()
|
||||||
const editorRef = useRef(null)
|
const editorRef = useRef(null)
|
||||||
@@ -94,6 +97,7 @@ const PartProfile = ({
|
|||||||
emotes={emotes}
|
emotes={emotes}
|
||||||
userEmotes={userEmotes}
|
userEmotes={userEmotes}
|
||||||
onEmote={onReaction}
|
onEmote={onReaction}
|
||||||
|
onShowPartReactions={() => setIsReactionsModalOpen(true)}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
className="mt-6 ml-auto hover:shadow-lg bg-gradient-to-r from-transparent to-indigo-100"
|
className="mt-6 ml-auto hover:shadow-lg bg-gradient-to-r from-transparent to-indigo-100"
|
||||||
@@ -272,6 +276,14 @@ const PartProfile = ({
|
|||||||
onConfirm={onDelete}
|
onConfirm={onDelete}
|
||||||
message="Are you sure you want to delete? This action cannot be undone."
|
message="Are you sure you want to delete? This action cannot be undone."
|
||||||
/>
|
/>
|
||||||
|
<Dialog
|
||||||
|
open={isReactionsModalOpen}
|
||||||
|
onClose={() => setIsReactionsModalOpen(false)}
|
||||||
|
fullWidth={true}
|
||||||
|
maxWidth={'sm'}
|
||||||
|
>
|
||||||
|
<PartReactionsCell partId={userPart?.Part?.id} />
|
||||||
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user