Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5814 Rev 5815
Línea 18... Línea 18...
18
    const reactionsOptions = [
18
    const reactionsOptions = [
19
      {
19
      {
20
        type: 'r',
20
        type: 'r',
21
        icon: RecommendIcon,
21
        icon: RecommendIcon,
22
        color: '#7405f9',
22
        color: '#7405f9',
-
 
23
        label: 'Me gusta',
23
      },
24
      },
24
      {
25
      {
25
        type: 's',
26
        type: 's',
26
        icon: VolunteerActivismIcon,
27
        icon: VolunteerActivismIcon,
27
        color: '#6495ED',
28
        color: '#6495ED',
-
 
29
        label: 'Dar apoyo',
28
      },
30
      },
29
      {
31
      {
30
        type: 'l',
32
        type: 'l',
31
        icon: FavoriteIcon,
33
        icon: FavoriteIcon,
32
        color: '#DF704D',
34
        color: '#DF704D',
-
 
35
        label: 'Me encanta',
33
      },
36
      },
34
      {
37
      {
35
        type: 'i',
38
        type: 'i',
36
        icon: TungstenIcon,
39
        icon: TungstenIcon,
37
        color: '#F5BB5C',
40
        color: '#F5BB5C',
-
 
41
        label: 'Me interesa',
38
      },
42
      },
39
      {
43
      {
40
        type: 'f',
44
        type: 'f',
41
        icon: EmojiEmotionsIcon,
45
        icon: EmojiEmotionsIcon,
42
        color: '#FF7F50',
46
        color: '#FF7F50',
-
 
47
        label: 'Me divierte',
43
      },
48
      },
44
    ]
49
    ]
Línea 45... Línea 50...
45
 
50
 
46
    const selectReactionHandler = (reaction) => {
51
    const selectReactionHandler = (reaction) => {
Línea 68... Línea 73...
68
        onMouseOut={onUnhover}
73
        onMouseOut={onUnhover}
69
        ref={rectionBtn}
74
        ref={rectionBtn}
70
      >
75
      >
71
        <Component
76
        <Component
72
          Icon={settedReaction ? settedReaction.icon : RecommendIcon}
77
          Icon={settedReaction ? settedReaction.icon : RecommendIcon}
-
 
78
          color={settedReaction ? settedReaction.color : '#626d7a'}
-
 
79
          title={settedReaction ? settedReaction.label : 'Reaccionar'}
73
          onClick={() => {
80
          onClick={() => {
74
            settedReaction
81
            settedReaction
75
              ? deleteReactionHandler()
82
              ? deleteReactionHandler()
76
              : selectReactionHandler(reactionsOptions[0].type)
83
              : selectReactionHandler(reactionsOptions[0].type)
77
          }}
84
          }}
78
        />
85
        />
Línea 79... Línea 86...
79
 
86
 
80
        <div className={`reactions ${showReactions ? 'active' : ''}`}>
87
        <div className={`reactions ${showReactions ? 'active' : ''}`}>
81
          {reactionsOptions.map((reaction) => {
88
          {reactionsOptions.map((reaction) => {
82
            const { icon: Icon, color, type } = reaction
89
            const { icon: Icon, color, type, label } = reaction
83
            return (
90
            return (
84
              <button
91
              <button
85
                key={type}
92
                key={type}
86
                onClick={(e) => {
93
                onClick={(e) => {
87
                  e.stopPropagation()
94
                  e.stopPropagation()
88
                  selectReactionHandler(reaction)
95
                  selectReactionHandler(reaction)
-
 
96
                }}
89
                }}
97
                title={label}
90
              >
98
              >
91
                <Icon style={{ color }} />
99
                <Icon style={{ color }} />
92
              </button>
100
              </button>
93
            )
101
            )