Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3309 Rev 3310
Línea 73... Línea 73...
73
  const [showConfirmModal, setShowConfirmModal] = useState(false);
73
  const [showConfirmModal, setShowConfirmModal] = useState(false);
74
  const [displayOption, setDisplayOption] = useState(false)
74
  const [displayOption, setDisplayOption] = useState(false)
75
  const [shareOptions, setShareOptions] = useState(false)
75
  const [shareOptions, setShareOptions] = useState(false)
76
  const [show, setShow] = useState(false);
76
  const [show, setShow] = useState(false);
77
  const deleteButton = useRef();
77
  const deleteButton = useRef();
-
 
78
  const shareContainer = useRef(null);
Línea 78... Línea 79...
78
 
79
 
79
  const handleClose = () => setShow(false);
80
  const handleClose = () => setShow(false);
Línea 80... Línea 81...
80
  const handleShow = () => setShow(true);
81
  const handleShow = () => setShow(true);
Línea 94... Línea 95...
94
    return () => {
95
    return () => {
95
      document.removeEventListener("mousedown", handleClickOutside);
96
      document.removeEventListener("mousedown", handleClickOutside);
96
    };
97
    };
97
  }, [deleteButton]);
98
  }, [deleteButton]);
Línea -... Línea 99...
-
 
99
 
-
 
100
  useEffect(() => {
-
 
101
    const handleClickOutside = (event) => {
-
 
102
      if (shareContainer.current && !shareContainer.current.contains(event.target)) {
-
 
103
        setDisplayOption(false)
-
 
104
      }
-
 
105
    }
-
 
106
    document.addEventListener("mousedown", handleClickOutside);
-
 
107
 
-
 
108
    return () => {
-
 
109
      document.removeEventListener("mousedown", handleClickOutside);
-
 
110
    };
-
 
111
  }, [shareContainer]);
98
 
112
 
99
  const deleteFeedHandler = () => {
113
  const deleteFeedHandler = () => {
100
    axios.post(feed_delete_url)
114
    axios.post(feed_delete_url)
101
      .then((res) => {
115
      .then((res) => {
102
        const { data } = res
116
        const { data } = res
Línea 447... Línea 461...
447
              >
461
              >
448
                <BiShareAlt />
462
                <BiShareAlt />
449
              </button>
463
              </button>
450
              {
464
              {
451
                shareOptions &&
465
                shareOptions &&
452
                <div className="ext_share">
466
                <div className="ext_share" ref={shareContainer}>
453
                  <FacebookShareButton url={`${window.location.hostname}${feed_share_external_url}`}>
467
                  <FacebookShareButton url={`${window.location.hostname}${feed_share_external_url}`}>
454
                    <FacebookIcon size={32} round />
468
                    <FacebookIcon size={32} round />
455
                  </FacebookShareButton>
469
                  </FacebookShareButton>
456
                  <FacebookMessengerShareButton url={`${window.location.hostname}${feed_share_external_url}`}>
470
                  <FacebookMessengerShareButton url={`${window.location.hostname}${feed_share_external_url}`}>
457
                    <FacebookMessengerIcon size={32} round />
471
                    <FacebookMessengerIcon size={32} round />