Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1688 Rev 1800
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { useParams } from 'react-router-dom'
-
 
3
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
-
 
3
import { useParams } from 'react-router-dom'
-
 
4
import { Container } from '@mui/material'
Línea 4... Línea 5...
4
 
5
 
5
import {
6
import {
6
  fetchFeeds,
7
  fetchFeeds,
7
  setCurrentPage,
8
  setCurrentPage,
8
  setTimelineUrl
9
  setTimelineUrl
9
} from '../../redux/feed/feed.actions'
10
} from '../../redux/feed/feed.actions'
Línea 10... Línea 11...
10
import { getBackendVars } from '../../services/backendVars'
11
import { getBackendVars } from '../../services/backendVars'
-
 
12
 
11
 
13
import PaginationComponent from '@app/components/UI/PaginationComponent'
12
import PaginationComponent from '@app/components/UI/PaginationComponent'
14
import AppGrid from '@app/components/UI/layout/AppGrid'
13
import AboutCompany from '../../components/company/AboutCompany'
15
import AboutCompany from '@app/components/company/AboutCompany'
14
import CompanyActions from '../../components/company/CompanyActions'
16
import CompanyActions from '@app/components/company/CompanyActions'
15
import CompanyFollowers from '../../components/company/CompanyFollowers'
17
import CompanyFollowers from '@app/components/company/CompanyFollowers'
Línea 16... Línea 18...
16
import FeedList from '../../components/dashboard/linkedin/feed-list/FeedList'
18
import FeedList from '@app/components/dashboard/linkedin/feed-list/FeedList'
Línea 17... Línea 19...
17
import GroupInfo from '../../components/widgets/linkedin/InfoWidget'
19
import GroupInfo from '@app/components/widgets/linkedin/InfoWidget'
18
 
20
 
Línea 52... Línea 54...
52
 
54
 
53
  useEffect(() => {
55
  useEffect(() => {
54
    dispatch(fetchFeeds(timelineUrl, currentPage))
56
    dispatch(fetchFeeds(timelineUrl, currentPage))
Línea 55... Línea -...
55
  }, [timelineUrl, currentPage])
-
 
56
 
-
 
57
  useEffect(() => {
-
 
58
    getCompanyVars()
-
 
59
  }, [])
57
  }, [timelineUrl, currentPage])
60
 
58
 
61
  return (
59
  return (
62
    <main className='w-100'>
60
    <Container>
63
      <div className='container p-0 app__body layout__content'>
61
      <AppGrid
64
        <div className='d-flex flex-column'>
62
        renderSidebar={() => (
65
          <GroupInfo
63
          <GroupInfo
66
            cover={backendVars?.cover}
64
            cover={backendVars?.cover}
67
            image={backendVars?.image}
65
            image={backendVars?.image}
68
            name={backendVars?.company_name}
66
            name={backendVars?.company_name}
69
            overview={backendVars?.overview}
67
            overview={backendVars?.overview}
70
            id={backendVars?.company_uuid}
68
            id={backendVars?.company_uuid}
71
            totalMembers={backendVars?.total_followers}
69
            totalMembers={backendVars?.total_followers}
72
            groupType={backendVars?.company_size}
70
            groupType={backendVars?.company_size}
73
            accessibility={backendVars?.industry}
71
            accessibility={backendVars?.industry}
74
          />
-
 
75
        </div>
72
          />
-
 
73
        )}
76
 
74
        renderMain={() => (
77
        <div className='d-flex flex-column' style={{ gap: '.5rem' }}>
75
          <>
78
          <CompanyActions
76
            <CompanyActions
79
            name={backendVars?.company_name}
77
              name={backendVars?.company_name}
80
            image={backendVars?.image}
78
              image={backendVars?.image}
81
            companyId={backendVars?.company_uuid}
79
              companyId={backendVars?.company_uuid}
82
            cover={backendVars?.cover}
80
              cover={backendVars?.cover}
83
            overview={backendVars?.overview}
81
              overview={backendVars?.overview}
-
 
82
              refetch={getCompanyVars}
-
 
83
              actionLinks={actionsUrls}
-
 
84
            />
-
 
85
            {!isFollower ? <AboutCompany {...backendVars} /> : null}
-
 
86
            {isFollower && !loading ? <FeedList feeds={allFeeds} /> : null}
-
 
87
            <PaginationComponent
-
 
88
              pages={pages}
-
 
89
              currentActivePage={currentPage}
84
            refetch={getCompanyVars}
90
              onChangePage={onChangePageHandler}
-
 
91
            />
85
            actionLinks={actionsUrls}
92
          </>
-
 
93
        )}
-
 
94
        renderAside={() => (
86
          />
95
          <>
87
          {!isFollower ? (
-
 
88
            <AboutCompany {...backendVars} />
-
 
89
          ) : (
-
 
90
            <>
-
 
91
              <FeedList
-
 
92
                feeds={allFeeds}
-
 
93
                loading={loading}
-
 
94
                image={`/storage/type/company/code/${backendVars?.companyId}/${
-
 
95
                  backendVars?.image ? `filename/${backendVars?.image}` : ''
-
 
96
                }`}
-
 
97
              />
-
 
98
              <PaginationComponent
-
 
99
                pages={pages}
-
 
100
                currentActivePage={currentPage}
-
 
101
                onChangePage={onChangePageHandler}
-
 
102
                isRow
96
            <CompanyFollowers companyId={uuid} />
103
              />
97
            <AboutCompany {...backendVars} />
104
            </>
-
 
105
          )}
-
 
106
        </div>
-
 
107
 
-
 
108
        <div className='d-flex flex-column' style={{ gap: '.5rem' }}>
-
 
109
          <CompanyFollowers companyId={uuid} />
-
 
110
          <AboutCompany {...backendVars} />
98
          </>
111
        </div>
99
        )}
112
      </div>
100
      />
113
    </main>
101
    </Container>
Línea 114... Línea 102...
114
  )
102
  )