Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4522 | Rev 4624 | 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}
44
                    />
4494 stevensc 45
                </div>
46
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
4522 stevensc 47
                    <GroupActions {...backendVars} actionLinks={actionLinks} />
4529 stevensc 48
                    {backendVars.withoutFeeds
49
                        ? <AboutGroup {...backendVars} />
50
                        : <FeedSection
51
                            routeTimeline={backendVars.routeTimeline}
52
                            backendVars={{
53
                                ...backendVars,
54
                                image: `/storage/type/group/code/${backendVars.groupId}/${backendVars.image ? `filename/${backendVars.image}` : ""}`
55
                            }}
56
                        />
57
                    }
4494 stevensc 58
                </div>
59
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
4513 stevensc 60
                    <Members groupId={backendVars.groupId} />
4529 stevensc 61
                    {!backendVars.withoutFeeds && <AboutGroup {...backendVars} />}
4494 stevensc 62
                </div>
63
            </div>
64
        </main>
65
    )
66
}
67
 
68
export default View