Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6626 | Rev 6628 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6626 Rev 6627
Línea 61... Línea 61...
61
  const [settedReaction, setSettedReaction] = useState(defaultReaction)
61
  const [settedReaction, setSettedReaction] = useState(defaultReaction)
62
  const [showReactions, setShowReactions] = useState(false)
62
  const [showReactions, setShowReactions] = useState(false)
63
  const rectionBtn = useRef(null)
63
  const rectionBtn = useRef(null)
64
  const dispatch = useDispatch()
64
  const dispatch = useDispatch()
Línea -... Línea 65...
-
 
65
 
-
 
66
  const { icon: Icon } = settedReaction
65
 
67
 
Línea 66... Línea 68...
66
  useOutsideClick(rectionBtn, () => setShowReactions(false))
68
  useOutsideClick(rectionBtn, () => setShowReactions(false))
67
 
69
 
68
  const saveReaction = async (type) => {
70
  const saveReaction = async (type) => {
Línea 109... Línea 111...
109
  }, [currentReaction])
111
  }, [currentReaction])
Línea 110... Línea 112...
110
 
112
 
111
  return (
113
  return (
112
    <>
114
    <>
113
      <button
115
      <button
114
        className="feed__share-option position-relative"
116
        className="btn feed__share-option position-relative"
115
        onMouseOver={onHover}
117
        onMouseOver={onHover}
116
        onMouseOut={onUnhover}
118
        onMouseOut={onUnhover}
117
        ref={rectionBtn}
119
        ref={rectionBtn}
118
        onClick={() =>
120
        onClick={() =>
119
          settedReaction.type !== 'default'
121
          settedReaction.type !== 'default'
120
            ? deleteReaction()
122
            ? deleteReaction()
121
            : saveReaction(reactionsOptions[0].type)
123
            : saveReaction(reactionsOptions[0].type)
122
        }
124
        }
-
 
125
      >
123
      >
126
        <Icon />
124
        {withLabel && settedReaction.label}
127
        {withLabel && settedReaction.label}
125
        <div className={`reactions ${showReactions ? 'active' : ''}`}>
128
        <div className={`reactions ${showReactions ? 'active' : ''}`}>
126
          {reactionsOptions.map((reaction) => {
129
          {reactionsOptions.map((reaction) => {