Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
7110 stevensc 1
import React, { useEffect, useState } from 'react'
2
import { Container } from 'react-bootstrap'
3
import { feedTypes } from '../../redux/feed/feed.types'
4
import { useDispatch } from 'react-redux'
5
import { setTimelineUrl } from '../../redux/feed/feed.actions'
6
import { getBackendVars } from '../../services/backendVars'
7
 
8
import FeedShare from '../../components/feed/linkedin/FeedShare'
9
import FeedList from '../../components/feed/linkedin/FeedList'
10
import DailyPulse from '../../components/widgets/default/DailyPulse'
11
import PeopleYouMayKnow from '../../components/widgets/default/PeopleYouMayKnow'
12
import HomeNews from '../../components/widgets/default/HomeNews'
13
import Aside from '../../components/dashboard/linkedin/Aside'
14
import Sidebar from '../../components/dashboard/linkedin/Sidebar'
15
import Groups from '../../components/dashboard/linkedin/Groups'
16
import SocialNetworks from '../../components/widgets/default/SocialNetworks'
17
import UserInfo from '../../components/dashboard/linkedin/UserInfo'
18
 
19
const LinkedInDashboard = () => {
20
  const [userInfo, setUserInfo] = useState({})
21
  const dispatch = useDispatch()
22
 
23
  useEffect(() => {
24
    getBackendVars('/dashboard')
25
      .then(({ routeTimeline, ...results }) => {
26
        setUserInfo(results)
27
        dispatch(setTimelineUrl(routeTimeline))
28
      })
29
      .catch((err) => {
30
        console.log(err)
31
        throw new Error(err)
32
      })
33
  }, [])
34
 
35
  return (
36
    <>
37
      <Container className="px-0">
38
        <div className="app__body layout__content">
39
          <Sidebar>
40
            <UserInfo {...userInfo} />
41
            <Groups />
42
            <SocialNetworks
43
              moodle={{
44
                image: userInfo?.moodle_image,
45
                name: userInfo?.moodle_name,
46
              }}
47
              microlearning={{
48
                playStore: userInfo?.microlearning_playstore,
49
                appStore: userInfo?.microlearning_appstore,
50
              }}
51
              className="sidebar-apps__widget"
52
            />
53
          </Sidebar>
54
          <div className="feed__section">
55
            <FeedShare
56
              image={userInfo?.image}
57
              feedType={feedTypes.DASHBOARD}
58
              postUrl="/feed/add"
59
            />
60
            <FeedList feed={userInfo?.feed} image={userInfo?.image} />
61
          </div>
62
          <Aside>
63
            {userInfo?.routeDailyPulse && (
64
              <DailyPulse routeDailyPulse={userInfo?.routeDailyPulse} />
65
            )}
66
            <PeopleYouMayKnow />
67
            <HomeNews classname="sidebar-apps__widget d-flex flex-column" />
68
          </Aside>
69
        </div>
70
      </Container>
71
    </>
72
  )
73
}
74
 
75
export default LinkedInDashboard