Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5791 Rev 5851
Línea 31... Línea 31...
31
import RecommendIcon from '@mui/icons-material/Recommend'
31
import RecommendIcon from '@mui/icons-material/Recommend'
32
import FavoriteIcon from '@mui/icons-material/FavoriteTwoTone'
32
import FavoriteIcon from '@mui/icons-material/FavoriteTwoTone'
33
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
33
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
34
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
34
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
35
import TungstenIcon from '@mui/icons-material/Tungsten'
35
import TungstenIcon from '@mui/icons-material/Tungsten'
36
import { ReactionButton } from './withReaction'
36
import withReactions from './withReaction'
-
 
37
import InputOption from '../../templates/linkedin/Feed/InputOption'
Línea 37... Línea 38...
37
 
38
 
38
const Feed = ({ feed, owner_shared, image }) => {
39
const Feed = ({ feed, owner_shared, image }) => {
39
  const {
40
  const {
40
    feed_unique,
41
    feed_unique,
Línea 53... Línea 54...
53
    comment_add_url,
54
    comment_add_url,
54
    feed_share_external_url,
55
    feed_share_external_url,
55
  } = feed
56
  } = feed
56
  const [totalComments, setTotalComments] = useState(comments.length)
57
  const [totalComments, setTotalComments] = useState(comments.length)
57
  const [ownerReactions, setOwnerReaction] = useState(feed.feed_reactions)
58
  const [ownerReactions, setOwnerReaction] = useState(feed.feed_reactions)
-
 
59
  const [currentReaction, setCurrentReaction] = useState(feed.feed_my_reaction)
58
  const [totalReactions, setTotalReactions] = useState(0)
60
  const [totalReactions, setTotalReactions] = useState(0)
59
  const [sharedState, setSharedState] = useState(owner_shared)
61
  const [sharedState, setSharedState] = useState(owner_shared)
60
  const [shareUrl, setShareUrl] = useState('')
62
  const [shareUrl, setShareUrl] = useState('')
Línea 61... Línea 63...
61
 
63
 
Línea 126... Línea 128...
126
      if (!success) {
128
      if (!success) {
127
        dispatch(addNotification({ style: 'danger', msg: data }))
129
        dispatch(addNotification({ style: 'danger', msg: data }))
128
      }
130
      }
Línea 129... Línea 131...
129
 
131
 
130
      setOwnerReaction(data.reactions)
132
      setOwnerReaction(data.reactions)
131
      return true
133
      setCurrentReaction(type)
132
    })
134
    })
Línea 133... Línea 135...
133
  }
135
  }
134
 
136
 
Línea 140... Línea 142...
140
        dispatch(addNotification({ style: 'danger', msg: data }))
142
        dispatch(addNotification({ style: 'danger', msg: data }))
141
        return
143
        return
142
      }
144
      }
Línea 143... Línea 145...
143
 
145
 
144
      setOwnerReaction(data.reactions)
146
      setOwnerReaction(data.reactions)
145
      return true
147
      setCurrentReaction('')
146
    })
148
    })
Línea 147... Línea 149...
147
  }
149
  }
Línea 157... Línea 159...
157
        feed_unique
159
        feed_unique
158
      )
160
      )
159
    )
161
    )
160
  }
162
  }
Línea -... Línea 163...
-
 
163
 
-
 
164
  const WithReactionIcon = withReactions(InputOption, {
-
 
165
    onSelect: saveReaction,
-
 
166
    onDelete: deleteReaction,
-
 
167
    myReaction: currentReaction,
-
 
168
  })
161
 
169
 
Línea 162... Línea 170...
162
  useEffect(() => setSharedState(owner_shared), [owner_shared])
170
  useEffect(() => setSharedState(owner_shared), [owner_shared])
Línea 163... Línea 171...
163
 
171
 
Línea 219... Línea 227...
219
            .map((reaction) => reaction.icon)}
227
            .map((reaction) => reaction.icon)}
220
          <span>{totalReactions} reacciones</span>
228
          <span>{totalReactions} reacciones</span>
221
        </div>
229
        </div>
222
        <ul className="reactions-list">
230
        <ul className="reactions-list">
223
          <li>
231
          <li>
224
            <ReactionButton
232
            <WithReactionIcon />
225
              onSelect={saveReaction}
-
 
226
              onDelete={deleteReaction}
-
 
227
              myReaction={feed.feed_my_reaction}
-
 
228
            />
-
 
229
          </li>
233
          </li>
230
          <li>
234
          <li>
231
            <button
235
            <button
232
              type="button"
236
              type="button"
233
              id={`btn-comments-${feed_unique}`}
237
              id={`btn-comments-${feed_unique}`}