Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7069 Rev 7070
Línea 10... Línea 10...
10
import LoveItIcon from '../icons/LoveIt'
10
import LoveItIcon from '../icons/LoveIt'
11
import SupportIcon from '../icons/Support'
11
import SupportIcon from '../icons/Support'
12
import InterestIcon from '../icons/Interest'
12
import InterestIcon from '../icons/Interest'
13
import RecommendIcon from '../icons/Recommned'
13
import RecommendIcon from '../icons/Recommned'
Línea 14... Línea -...
14
 
-
 
15
const reactionsOptions = [
-
 
16
  {
-
 
17
    type: 'r',
-
 
18
    icon: RecommendIcon,
-
 
19
    label: 'Me gusta',
-
 
20
  },
-
 
21
  {
-
 
22
    type: 's',
-
 
23
    icon: SupportIcon,
-
 
24
    label: 'Dar apoyo',
-
 
25
  },
-
 
26
  {
-
 
27
    type: 'l',
-
 
28
    icon: LoveItIcon,
-
 
29
    label: 'Me encanta',
-
 
30
  },
-
 
31
  {
-
 
32
    type: 'i',
-
 
33
    icon: InterestIcon,
-
 
34
    label: 'Me interesa',
-
 
35
  },
-
 
36
  {
-
 
37
    type: 'f',
-
 
38
    icon: FunIcon,
-
 
39
    label: 'Me divierte',
-
 
40
  },
-
 
41
]
-
 
42
 
14
 
43
const defaultReaction = {
15
const defaultReaction = {
44
  label: 'Reaccionar',
16
  label: 'Reaccionar',
45
  icon: ReactionIcon,
17
  icon: ReactionIcon,
46
  type: 'default',
18
  type: 'default',
Línea 56... Línea 28...
56
  const [settedReaction, setSettedReaction] = useState(defaultReaction)
28
  const [settedReaction, setSettedReaction] = useState(defaultReaction)
57
  const [showReactions, setShowReactions] = useState(false)
29
  const [showReactions, setShowReactions] = useState(false)
58
  const rectionBtn = useRef(null)
30
  const rectionBtn = useRef(null)
59
  const dispatch = useDispatch()
31
  const dispatch = useDispatch()
Línea -... Línea 32...
-
 
32
 
-
 
33
  const reactionsOptions = [
-
 
34
    {
-
 
35
      type: 'r',
-
 
36
      icon: RecommendIcon,
-
 
37
      label: 'Me gusta',
-
 
38
    },
-
 
39
    {
-
 
40
      type: 's',
-
 
41
      icon: SupportIcon,
-
 
42
      label: 'Dar apoyo',
-
 
43
    },
-
 
44
    {
-
 
45
      type: 'l',
-
 
46
      icon: LoveItIcon,
-
 
47
      label: 'Me encanta',
-
 
48
    },
-
 
49
    {
-
 
50
      type: 'i',
-
 
51
      icon: InterestIcon,
-
 
52
      label: 'Me interesa',
-
 
53
    },
-
 
54
    {
-
 
55
      type: 'f',
-
 
56
      icon: FunIcon,
-
 
57
      label: 'Me divierte',
-
 
58
    },
-
 
59
  ]
60
 
60
 
Línea 61... Línea 61...
61
  const { icon: Icon } = settedReaction
61
  const { icon: Icon } = settedReaction
Línea 62... Línea 62...
62
 
62
 
Línea 69... Línea 69...
69
      if (!success) {
69
      if (!success) {
70
        dispatch(addNotification({ style: 'danger', msg: data }))
70
        dispatch(addNotification({ style: 'danger', msg: data }))
71
      }
71
      }
Línea 72... Línea 72...
72
 
72
 
-
 
73
      console.log(type)
73
      console.log(type)
74
      console.log(reactionsOptions)
Línea 74... Línea 75...
74
      console.log(reactionsOptions[type])
75
      console.log(reactionsOptions[type])
75
 
76
 
76
      onChange(data.reactions)
77
      onChange(data.reactions)