Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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