Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5574 Rev 5577
Línea 1... Línea 1...
1
import React from 'react'
1
import React, { useState } from 'react'
-
 
2
import RecommendIcon from '@mui/icons-material/Recommend'
-
 
3
import FavoriteIcon from '@mui/icons-material/Favorite'
-
 
4
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
Línea 2... Línea 5...
2
 
5
 
-
 
6
const withReaction = (Component, currentReaction) => {
-
 
7
  const [reaction, setReaction] = useState(currentReaction)
-
 
8
  return (
-
 
9
    <>
-
 
10
      <div className="reactions-list">
-
 
11
        <RecommendIcon />
-
 
12
        <FavoriteIcon />
-
 
13
        <VolunteerActivismIcon />
3
const withReaction = () => {
14
      </div>
-
 
15
      <Component reaction />
-
 
16
    </>
-
 
17
  )
-
 
18
}
-
 
19
const LikeButton = ({ currentReactions, isLiked }) => {
-
 
20
  return (
-
 
21
    <button
-
 
22
      type="button"
-
 
23
      id={feedIsLiked ? `btn-unlike-${feed_unique}` : `btn-like-${feed_unique}`}
-
 
24
      className={feedIsLiked ? 'btn-unlike' : 'btn-like'}
-
 
25
      onClick={() => likeHandler(feedIsLiked ? feed_unlike_url : feed_like_url)}
-
 
26
    >
-
 
27
      {isLiked ? (
-
 
28
        <i className="mr-1 fa fa-heart" />
-
 
29
      ) : (
-
 
30
        <i className="mr-1 fa fa-heart-o" />
-
 
31
      )}
-
 
32
      {currentReactions}
-
 
33
    </button>
4
  return <div>withReaction</div>
34
  )
Línea 5... Línea 35...
5
}
35
}