| Línea 6... |
Línea 6... |
| 6 |
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
|
6 |
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
|
| 7 |
import TungstenIcon from '@mui/icons-material/Tungsten'
|
7 |
import TungstenIcon from '@mui/icons-material/Tungsten'
|
| 8 |
import { debounce } from '../../../utils'
|
8 |
import { debounce } from '../../../utils'
|
| 9 |
import useOutsideClick from '../../../hooks/useOutsideClick'
|
9 |
import useOutsideClick from '../../../hooks/useOutsideClick'
|
| Línea -... |
Línea 10... |
| - |
|
10 |
|
| - |
|
11 |
const withReactions = (
|
| 10 |
|
12 |
Component,
|
| - |
|
13 |
{ onSelect, onDelete, myReaction, withTitle = false }
|
| 11 |
const withReactions = (Component, { onSelect, onDelete, myReaction }) => {
|
14 |
) => {
|
| 12 |
return () => {
|
15 |
return () => {
|
| 13 |
const [settedReaction, setSettedReaction] = useState(null)
|
16 |
const [settedReaction, setSettedReaction] = useState(null)
|
| 14 |
const [showReactions, setShowReactions] = useState(false)
|
17 |
const [showReactions, setShowReactions] = useState(false)
|
| 15 |
const rectionBtn = useRef(null)
|
18 |
const rectionBtn = useRef(null)
|
| Línea 72... |
Línea 75... |
| 72 |
color={settedReaction ? settedReaction.color : '#626d7a'}
|
75 |
color={settedReaction ? settedReaction.color : '#626d7a'}
|
| 73 |
title={settedReaction ? settedReaction.label : 'Reaccionar'}
|
76 |
title={settedReaction ? settedReaction.label : 'Reaccionar'}
|
| 74 |
onClick={() => {
|
77 |
onClick={() => {
|
| 75 |
settedReaction ? onDelete() : onSelect(reactionsOptions[0].type)
|
78 |
settedReaction ? onDelete() : onSelect(reactionsOptions[0].type)
|
| 76 |
}}
|
79 |
}}
|
| - |
|
80 |
withTitle={withTitle}
|
| 77 |
>
|
81 |
>
|
| 78 |
<div className={`reactions ${showReactions ? 'active' : ''}`}>
|
82 |
<div className={`reactions ${showReactions ? 'active' : ''}`}>
|
| 79 |
{reactionsOptions.map((reaction) => {
|
83 |
{reactionsOptions.map((reaction) => {
|
| 80 |
const { icon: Icon, color, type, label } = reaction
|
84 |
const { icon: Icon, color, type, label } = reaction
|
| 81 |
return (
|
85 |
return (
|