Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

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