Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5366 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 5366 Rev 5897
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React, { useEffect, useState } from 'react'
2
import React, { useEffect, useState } from 'react'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import FeedSection from '../../../../../dashboard/templates/linkedin/Feed/FeedSection'
-
 
5
import { addNotification } from '../../../../../redux/notification/notification.actions'
4
import { addNotification } from '../../../../../redux/notification/notification.actions'
6
import { axios } from '../../../../../utils'
5
import { axios } from '../../../../../utils'
-
 
6
 
-
 
7
import FeedSection from '../../../../../dashboard/templates/linkedin/Feed/FeedSection'
7
import AboutGroup from '../components/AboutGroup'
8
import AboutGroup from '../components/AboutGroup'
8
import GroupActions from '../components/GroupActions'
9
import GroupActions from '../components/GroupActions'
9
import GroupInfo from '../components/GroupInfo'
10
import GroupInfo from '../components/GroupInfo'
10
import Members from '../components/Members'
11
import Members from '../components/Members'
Línea 11... Línea 12...
11
 
12
 
12
const View = ({ backendVars }) => {
13
const View = ({ backendVars }) => {
13
  const [actionLinks, setActionLinks] = useState({})
14
  const [actionLinks, setActionLinks] = useState({})
Línea 14... Línea 15...
14
  const dispatch = useDispatch()
15
  const dispatch = useDispatch()
-
 
16
 
15
 
17
  const load = () => {
16
  const load = () => {
18
    axios
17
    axios.get('')
19
      .get('')
18
      .then(({ data }) => {
20
      .then(({ data }) => {
19
        if (!data.success) {
21
        if (!data.success) {
20
          return dispatch(addNotification({ style: 'error', msg: data.data }))
22
          return dispatch(addNotification({ style: 'error', msg: data.data }))
21
        }
23
        }
22
        setActionLinks(data.data)
24
        setActionLinks(data.data)
23
      })
25
      })
Línea 24... Línea 26...
24
      .catch(err => console.log('>>: err > ', err))
26
      .catch((err) => console.log('>>: err > ', err))
25
  }
27
  }
26
 
28
 
Línea 27... Línea 29...
27
  useEffect(() => {
29
  useEffect(() => {
28
    load()
30
    load()
29
  }, [])
31
  }, [])
30
 
32
 
31
  return (
33
  return (
32
        <main className="w-100">
34
    <main className="w-100">
33
            <div className="container p-0 app__body layout__content">
35
      <div className="container p-0 app__body layout__content">
34
                <div className="d-flex flex-column">
36
        <div className="d-flex flex-column">
35
                    <GroupInfo
37
          <GroupInfo
36
                        cover={backendVars.cover}
38
            cover={backendVars.cover}
37
                        image={backendVars.image}
39
            image={backendVars.image}
38
                        name={backendVars.name}
40
            name={backendVars.name}
39
                        overview={backendVars.overview}
41
            overview={backendVars.overview}
40
                        groupId={backendVars.groupId}
42
            groupId={backendVars.groupId}
41
                        totalMembers={backendVars.totalMembers}
43
            totalMembers={backendVars.totalMembers}
42
                        groupType={backendVars.groupType}
44
            groupType={backendVars.groupType}
43
                        accessibility={backendVars.accessibility}
45
            accessibility={backendVars.accessibility}
44
                        type='group'
46
            type="group"
45
                    />
47
          />
46
                </div>
48
        </div>
-
 
49
        <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
47
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
50
          <GroupActions {...backendVars} actionLinks={actionLinks} />
48
                    <GroupActions {...backendVars} actionLinks={actionLinks} />
51
          {backendVars.withoutFeeds ? (
49
                    {backendVars.withoutFeeds
52
            <AboutGroup {...backendVars} />
50
                      ? <AboutGroup {...backendVars} />
53
          ) : (
-
 
54
            <FeedSection
51
                      : <FeedSection
55
              routeTimeline={backendVars.routeTimeline}
52
                            routeTimeline={backendVars.routeTimeline}
56
              backendVars={{
53
                            backendVars={{
57
                ...backendVars,
54
                              ...backendVars,
58
                image: `/storage/type/group/code/${backendVars.groupId}/${
-
 
59
                  backendVars.image ? `filename/${backendVars.image}` : ''
55
                              image: `/storage/type/group/code/${backendVars.groupId}/${backendVars.image ? `filename/${backendVars.image}` : ''}`
60
                }`,
56
                            }}
61
              }}
57
                        />
62
            />
58
                    }
63
          )}
59
                </div>
64
        </div>
60
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
65
        <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
61
                    <Members groupId={backendVars.groupId} />
66
          <Members groupId={backendVars.groupId} />
62
                    {!backendVars.withoutFeeds && <AboutGroup {...backendVars} />}
67
          {!backendVars.withoutFeeds && <AboutGroup {...backendVars} />}
63
                </div>
68
        </div>
Línea 64... Línea 69...
64
            </div>
69
      </div>