Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4533 Rev 4534
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React from 'react'
2
import React, { useEffect, useState } from 'react'
-
 
3
import FeedSection from '../../../../../dashboard/templates/linkedin/Feed/FeedSection';
-
 
4
import AboutGroup from '../../../../../group/view/templates/linkedin/components/AboutGroup';
3
import GroupInfo from '../../../../../group/view/templates/linkedin/components/GroupInfo'
5
import GroupInfo from '../../../../../group/view/templates/linkedin/components/GroupInfo'
-
 
6
import { setTimelineUrl } from '../../../../../redux/feed/feed.actions';
-
 
7
import { axios } from '../../../../../utils';
-
 
8
 
-
 
9
 
Línea 4... Línea 10...
4
 
10
 
-
 
11
const View = ({ backendVars }) => {
-
 
12
 
-
 
13
    const [authorizedLinks, setAuthorizedLinks] = useState(null);
-
 
14
    const [followers, setFollowers] = useState(totalFollowers);
-
 
15
    const [isFollower, setIsFollower] = useState(false);
-
 
16
 
-
 
17
    useEffect(() => {
-
 
18
        setTimelineUrl(backendVars.timeline);
-
 
19
        fetchAuthorizedLinks();
-
 
20
    }, []);
-
 
21
 
-
 
22
    const fetchAuthorizedLinks = async () => {
-
 
23
        const response = await axios.get(`/company/view/${backendVars.companyId}`);
-
 
24
        const resData = response.data;
-
 
25
        if (resData.success) {
-
 
26
            setAuthorizedLinks(resData.data);
-
 
27
            setFollowers(resData.data.total_followers);
-
 
28
            if (resData.data.link_unfollow) {
-
 
29
                setIsFollower(true);
-
 
30
            } else {
-
 
31
                setIsFollower(false);
-
 
32
            }
-
 
33
        }
-
 
34
    };
5
const View = ({ backendVars }) => {
35
 
6
    return (
36
    return (
7
        <main className="w-100">
37
        <main className="w-100">
8
            <div className="container p-0 app__body layout__content">
38
            <div className="container p-0 app__body layout__content">
9
                <div className="d-flex flex-column">
39
                <div className="d-flex flex-column">
Línea 18... Línea 48...
18
                        accessibility={backendVars.industry}
48
                        accessibility={backendVars.industry}
19
                        type='company'
49
                        type='company'
20
                    />
50
                    />
21
                </div>
51
                </div>
22
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
52
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
-
 
53
                    {isFollower
-
 
54
                        ? <AboutGroup {...backendVars} />
-
 
55
                        : <FeedSection
-
 
56
                            routeTimeline={backendVars.timeline}
-
 
57
                            backendVars={{
-
 
58
                                ...backendVars,
23
 
-
 
-
 
59
                                image: `/storage/type/company/code/${backendVars.groupId}/${backendVars.image ? `filename/${backendVars.image}` : ""}`
-
 
60
                            }}
-
 
61
                        />
-
 
62
                    }
24
                </div>
63
                </div>
25
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
64
                <div className="d-flex flex-column" style={{ gap: '.5rem' }}>
Línea 26... Línea 65...
26
 
65
 
27
                </div>
66
                </div>