Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5438 | Rev 5698 | 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 */
5401 stevensc 2
import React, { Suspense, useEffect } from 'react'
5104 stevensc 3
import { useDispatch } from 'react-redux'
4
import { setTimelineUrl } from '../../../redux/feed/feed.actions'
5
import { feedTypes } from '../../../redux/feed/feed.types'
5407 stevensc 6
import { setIntlLabels } from '../../../redux/intl/intl.action'
5280 stevensc 7
 
5401 stevensc 8
// Components
5104 stevensc 9
import SocialNetworks from './SocialNetworks'
10
import ShareFeed from '../share-feed/ShareFeed'
11
import PeopleYouMayKnow from '../../../shared/helpers/people-you-may-know/PeopleYouMayKnow'
5205 efrain 12
import DailyPulse from '../../../shared/helpers/daily-pulse/DailyPulse'
5104 stevensc 13
import HomeNews from './HomeNews'
14
import Spinner from '../../../shared/loading-spinner/Spinner'
5407 stevensc 15
import SuggestWidget from '../../../shared/helpers/my-groups-helper/SuggestWidget'
2967 stevensc 16
 
4072 stevensc 17
// Lazy Components
5104 stevensc 18
const FeedSection = React.lazy(() => import('../feed-section/FeedSection'))
3299 stevensc 19
 
5401 stevensc 20
const HomeSection = ({ routeTimeline, routeDailyPulse, backendVars, labels }) => {
21
  const { image, feed } = backendVars
2972 stevensc 22
  const dispatch = useDispatch()
1 www 23
 
5401 stevensc 24
  useEffect(() => {
5402 stevensc 25
    dispatch(setIntlLabels(labels))
5401 stevensc 26
    dispatch(setTimelineUrl(routeTimeline))
27
  }, [])
2207 stevensc 28
 
1 www 29
  return (
5441 stevensc 30
    <main className='main-section-data container px-0'>
5412 stevensc 31
      <aside className="main-left-sidebar d-none d-md-flex">
32
        <SuggestWidget url="/helpers/my-groups" title={`${labels.MY_GROUPS}:`} />
33
        <SuggestWidget url="/helpers/groups-suggestion" title={`${labels.GROUPS}:`} />
34
        <SocialNetworks />
35
      </aside>
36
      <section className='feed-section'>
37
        <ShareFeed
38
          image={image}
39
          feedType={feedTypes.DASHBOARD}
40
          postUrl="/feed/add"
41
        />
42
        <Suspense fallback={<Spinner />}>
43
          <FeedSection
44
            routeTimeline={routeTimeline}
45
            feed={feed}
5375 stevensc 46
            image={image}
47
          />
5412 stevensc 48
        </Suspense>
49
      </section>
5280 stevensc 50
 
5412 stevensc 51
      <aside className='right-sidebar'>
52
        {routeDailyPulse && <DailyPulse routeDailyPulse={routeDailyPulse} />}
53
        <PeopleYouMayKnow />
54
        <HomeNews />
55
      </aside>
5280 stevensc 56
 
5412 stevensc 57
    </main>
5104 stevensc 58
  )
59
}
1 www 60
 
5104 stevensc 61
export default HomeSection