|
|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useEffect, useState, useCallback } from "react";
|
|
|
+import React, { useEffect, useState, useCallback, useMemo } from "react";
|
|
|
import {
|
|
|
Layout,
|
|
|
Col,
|
|
|
@@ -48,6 +48,23 @@ const EventoYager = () => {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+ const imagenRedMemo = useMemo(() => {
|
|
|
+ let url = "";
|
|
|
+
|
|
|
+ if (evento) {
|
|
|
+ url = "/assets/";
|
|
|
+ if (evento) {
|
|
|
+ url = url + "Tiktok";
|
|
|
+ } else {
|
|
|
+ url = url + evento?.redSocial;
|
|
|
+ }
|
|
|
+
|
|
|
+ url += ".png";
|
|
|
+ }
|
|
|
+
|
|
|
+ return url;
|
|
|
+ }, [evento])
|
|
|
+
|
|
|
const abrirEnlace = async () => {
|
|
|
registarEvento("click");
|
|
|
window.open(evento?.url, "_blank", "noopener,noreferrer");
|
|
|
@@ -226,12 +243,10 @@ const EventoYager = () => {
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</Col>
|
|
|
-
|
|
|
+ {console.log('evento?.redSocial: ', evento?.redSocial)}
|
|
|
<Col span={4}>
|
|
|
<img
|
|
|
- src={
|
|
|
- evento ? "/assets/" + evento?.redSocial + ".png" : ""
|
|
|
- }
|
|
|
+ src={imagenRedMemo}
|
|
|
width="100%"
|
|
|
alt="Red social"
|
|
|
/>
|