Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 3994 | Rev 4001 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3299 stevensc 1
/* eslint-disable react/prop-types */
2978 stevensc 2
import React, { Suspense } from "react";
3
import styled from "styled-components";
2972 stevensc 4
import { useDispatch } from "react-redux";
1 www 5
import { setTimelineUrl } from "../../../redux/feed/feed.actions";
6
import { feedTypes } from "../../../redux/feed/feed.types";
2966 stevensc 7
import NotificationAlert from "../../../shared/notification/NotificationAlert";
2971 stevensc 8
import ShareFeed from "../share-feed/ShareFeed";
2966 stevensc 9
import ShareModal from "../share-modal/ShareModal";
2967 stevensc 10
import SocialNetworks from "./SocialNetworks";
11
 
4000 stevensc 12
import PeopleYouMayKnow from "../../../shared/helpers/people-you-may-know/PeopleYouMayKnow";
13
 
14
const HomeNews = React.lazy(() => import("./HomeNews"));
15
const WidgetHelper = React.lazy(() => import("../../../shared/helpers/my-groups-helper/MyGroups"));
3299 stevensc 16
const FeedSection = React.lazy(() => import("../feed-section/FeedSection"));
17
 
4000 stevensc 18
import Spinner from "../../../shared/loading-spinner/Spinner";
19
 
2979 stevensc 20
const StyledSpinner = styled.div`
2978 stevensc 21
  width:100%;
22
  height:100%;
23
  display:grid;
24
  place-items:center;
2979 stevensc 25
`;
2978 stevensc 26
 
3503 stevensc 27
const HomeSection = ({ routeTimeline, backendVars }) => {
1 www 28
 
2972 stevensc 29
  const dispatch = useDispatch()
3299 stevensc 30
  const { image, feed } = backendVars;
1 www 31
 
2972 stevensc 32
  dispatch(setTimelineUrl(routeTimeline));
2207 stevensc 33
 
1 www 34
  return (
3993 stevensc 35
    <>
1 www 36
      <div className="main-section">
3993 stevensc 37
        <div className='main-section-data'>
3922 stevensc 38
          <div className="main-left-sidebar d-none d-md-flex">
4000 stevensc 39
            <WidgetHelper
40
              url="/helpers/my-groups"
41
              title="Mis Grupos:"
42
            />
43
            <WidgetHelper
44
              url="/helpers/groups-suggestion"
45
              title="Grupos:"
46
            />
3991 stevensc 47
            <div className="d-block d-xl-none">
48
              <PeopleYouMayKnow />
49
            </div>
3921 stevensc 50
            <SocialNetworks />
1 www 51
          </div>
3994 stevensc 52
          <div className='feed-section'>
2967 stevensc 53
            <ShareFeed image={image} feedType={feedTypes.DASHBOARD} postUrl="/feed/add" />
2978 stevensc 54
            <Suspense
55
              fallback={
2979 stevensc 56
                <StyledSpinner>
2978 stevensc 57
                  <Spinner />
3925 stevensc 58
                </StyledSpinner>
59
              }
2978 stevensc 60
            >
61
              <FeedSection
62
                routeTimeline={routeTimeline}
63
                feed={feed}
64
                image={image}
65
              />
66
            </Suspense>
1 www 67
          </div>
3921 stevensc 68
          <div className='right-sidebar'>
2967 stevensc 69
            <PeopleYouMayKnow />
70
            <HomeNews />
1 www 71
          </div>
72
        </div>
73
      </div>
74
      <ShareModal />
75
      <NotificationAlert />
3991 stevensc 76
    </>
1 www 77
  );
78
};
79
 
2972 stevensc 80
export default HomeSection;