Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 199 Rev 631
Línea 17... Línea 17...
17
import { addNotification } from "../../../redux/notification/notification.actions";
17
import { addNotification } from "../../../redux/notification/notification.actions";
18
import { axios } from "../../../utils";
18
import { axios } from "../../../utils";
Línea 19... Línea 19...
19
 
19
 
20
export default function withExternalShare(Component, url) {
20
export default function withExternalShare(Component, url) {
21
  return function (props) {
-
 
22
    const dispatch = useDispatch();
21
  return function (props) {
23
    const [shareOptions, setShareOptions] = useState(false);
22
    const [shareOptions, setShareOptions] = useState(false);
-
 
23
    const [shareUrl, setShareUrl] = useState("");
Línea -... Línea 24...
-
 
24
    const dispatch = useDispatch();
24
    const [shareUrl, setShareUrl] = useState("");
25
 
-
 
26
    const toggleShareOptions = () => {
Línea 25... Línea 27...
25
 
27
      setShareOptions(!shareOptions);
26
    const handleDisplayReactionList = () => setShareOptions(!shareOptions);
28
    };
27
 
29
 
28
    const getShareUrl = async () => {
30
    const getShareUrl = async () => {
Línea 58... Línea 60...
58
    useEffect(() => {
60
    useEffect(() => {
59
      if (shareOptions && !shareUrl) getShareUrl();
61
      if (shareOptions && !shareUrl) getShareUrl();
60
    }, [shareOptions]);
62
    }, [shareOptions]);
Línea 61... Línea 63...
61
 
63
 
62
    return (
64
    return (
63
      <Component onClick={handleDisplayReactionList} {...props}>
65
      <Component onClick={toggleShareOptions} {...props}>
64
        {shareOptions && (
66
        {shareOptions && (
65
          <div className="external__share">
67
          <div className="external__share">
66
            <FacebookShareButton
68
            <FacebookShareButton
67
              url={shareUrl}
69
              url={shareUrl}