Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5667 Rev 5668
Línea 2... Línea 2...
2
import RecommendIcon from '@mui/icons-material/Recommend'
2
import RecommendIcon from '@mui/icons-material/Recommend'
3
import FavoriteIcon from '@mui/icons-material/Favorite'
3
import FavoriteIcon from '@mui/icons-material/Favorite'
4
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
4
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
Línea 5... Línea 5...
5
 
5
 
6
export const ReactionButton = () => {
6
export const ReactionButton = () => {
7
  const [settedReaction, setSettedReaction] = useState({
-
 
8
    type: 'r',
-
 
9
    icon: RecommendIcon,
-
 
10
  })
-
 
11
 
-
 
Línea 12... Línea 7...
12
  const { icon: ReactionIcon } = settedReaction
7
  const [settedReaction, setSettedReaction] = useState('r')
13
 
8
 
14
  const reactions = [
9
  const reactions = [
15
    {
10
    {
16
      type: 'r',
11
      type: 'r',
17
      icon: RecommendIcon,
12
      icon: <RecommendIcon />,
18
    },
13
    },
19
    {
14
    {
20
      type: 'f',
15
      type: 'f',
21
      icon: FavoriteIcon,
16
      icon: <FavoriteIcon />,
22
    },
17
    },
23
    {
18
    {
24
      type: 'v',
19
      type: 'v',
25
      icon: VolunteerActivismIcon,
20
      icon: <VolunteerActivismIcon />,
Línea 26... Línea 21...
26
    },
21
    },
27
  ]
22
  ]
Línea 40... Línea 35...
40
              <Icon />
35
              <Icon />
41
            </button>
36
            </button>
42
          )
37
          )
43
        })}
38
        })}
44
      </div>
39
      </div>
45
      <ReactionIcon />
40
      {reactions.map((reaction) =>
-
 
41
        reaction.type === settedReaction ? reaction.icon : null
-
 
42
      )}
46
    </button>
43
    </button>
47
  )
44
  )
48
}
45
}