Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4015 Rev 4016
Línea 14... Línea 14...
14
import { addNotification } from "../../../redux/notification/notification.actions";
14
import { addNotification } from "../../../redux/notification/notification.actions";
15
import { useRef } from "react";
15
import { useRef } from "react";
16
import FeedModal from "./FeedModal";
16
import FeedModal from "./FeedModal";
17
import FeedHeader from "./FeedHeader";
17
import FeedHeader from "./FeedHeader";
18
import FeedCommentSection from "./feed-comment/FeedCommentSection";
18
import FeedCommentSection from "./feed-comment/FeedCommentSection";
19
import { async } from "postcss-js";
-
 
Línea 20... Línea 19...
20
 
19
 
Línea 21... Línea 20...
21
const FeedTemplate = ({ feed, owner_shared, image, children }) => {
20
const FeedTemplate = ({ feed, owner_shared, image, children }) => {
22
 
21
 
Línea 70... Línea 69...
70
    return () => {
69
    return () => {
71
      document.removeEventListener("mousedown", handleClickOutside);
70
      document.removeEventListener("mousedown", handleClickOutside);
72
    };
71
    };
73
  }, [shareContainer]);
72
  }, [shareContainer]);
Línea 74... Línea 73...
74
 
73
 
-
 
74
  const getShareUrl = new Promise((resolve, reject) => {
-
 
75
    if (shareOptions) {
75
  const getShareUrl = async () => {
76
      axios
76
    const { data: response } = await axios.get(feed_share_external_url)
77
        .get(feed_share_external_url)
77
    const { data, success } = response
-
 
78
 
78
        .then(({ data }) => {
-
 
79
          if (!data.success) {
-
 
80
            dispatch(addNotification({ style: 'danger', msg: data.data }))
-
 
81
            setShareOptions(false)
-
 
82
            return reject(data.data)
79
    if (success) {
83
          }
80
      setShareUrl(data)
84
          setShareUrl(data.data)
-
 
85
          return resolve(data.data)
-
 
86
        })
81
      return Promise.resolve(setShareUrl(data))
87
        .catch((err) => reject(err))
82
    }
-
 
83
 
-
 
84
    return Promise.reject(data)
88
    }
Línea 85... Línea 89...
85
  }
89
  });
86
 
90
 
87
 
91
 
Línea 173... Línea 177...
173
              >
177
              >
174
                <BiShareAlt />
178
                <BiShareAlt />
175
              </button>
179
              </button>
176
              {shareOptions &&
180
              {shareOptions &&
177
                <div className="ext_share" ref={shareContainer}>
181
                <div className="ext_share" ref={shareContainer}>
178
                  <FacebookShareButton beforeOnClick={getShareUrl} url={shareUrl}>
182
                  <FacebookShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
179
                    <FacebookIcon size={32} round />
183
                    <FacebookIcon size={32} round />
180
                  </FacebookShareButton>
184
                  </FacebookShareButton>
181
                  <TwitterShareButton beforeOnClick={getShareUrl} url={shareUrl}>
185
                  <TwitterShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
182
                    <TwitterIcon size={32} round />
186
                    <TwitterIcon size={32} round />
183
                  </TwitterShareButton>
187
                  </TwitterShareButton>
184
                  <TelegramShareButton beforeOnClick={getShareUrl} url={shareUrl}>
188
                  <TelegramShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
185
                    <TelegramIcon size={32} round />
189
                    <TelegramIcon size={32} round />
186
                  </TelegramShareButton>
190
                  </TelegramShareButton>
187
                  <WhatsappShareButton beforeOnClick={getShareUrl} url={shareUrl}>
191
                  <WhatsappShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
188
                    <WhatsappIcon size={32} round />
192
                    <WhatsappIcon size={32} round />
189
                  </WhatsappShareButton>
193
                  </WhatsappShareButton>
190
                  <RedditShareButton beforeOnClick={getShareUrl} url={shareUrl}>
194
                  <RedditShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
191
                    <RedditIcon size={32} round />
195
                    <RedditIcon size={32} round />
192
                  </RedditShareButton>
196
                  </RedditShareButton>
193
                  <EmailShareButton beforeOnClick={getShareUrl} url={shareUrl}>
197
                  <EmailShareButton beforeOnClick={() => getShareUrl} url={shareUrl}>
194
                    <EmailIcon size={32} round />
198
                    <EmailIcon size={32} round />
195
                  </EmailShareButton>
199
                  </EmailShareButton>
196
                </div>
200
                </div>
197
              }
201
              }
198
            </li>
202
            </li>