Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4537 stevensc 1
/* eslint-disable react/prop-types */
2
import React, { useState } from 'react'
3
import EastIcon from '@mui/icons-material/East';
4
import parse from "html-react-parser";
5
import { Modal } from 'react-bootstrap';
6
 
7
const AboutCompany = (companyInfo) => {
8
    const [showModal, setShowModal] = useState(false)
9
 
10
    const openModal = (e) => {
11
        e.preventDefault();
12
        setShowModal(true)
13
    }
14
 
15
    return (
16
        <>
17
            <div className='suggest__widget'>
18
                <div className="linked__widget-header">
19
                    <h3>Acerca de esta empresa</h3>
20
                </div>
21
                {companyInfo.overview
22
                    ? parse(companyInfo.overview)
23
                    : <p>Sin descripción</p>
24
                }
25
                <a className="load__suggest" onClick={(e) => openModal(e)}>
26
                    <span>Ver más</span>
27
                    <EastIcon />
28
                </a>
29
            </div >
30
            <AboutCompany.Modal show={showModal} closeModal={() => setShowModal(false)} companyInfo={companyInfo} />
31
        </>
32
    )
33
}
34
 
35
const AboutModal = ({ show, closeModal, companyInfo }) => {
36
    const {
37
        companyName,
38
        companySize,
39
        facebook,
40
        foundationYear,
41
        industry,
42
        instagram,
43
        locations,
44
        overview,
45
        twitter,
46
        website,
47
    } = companyInfo
48
    return (
49
        <Modal
50
            show={show}
51
            onHide={closeModal}
52
        >
53
            <Modal.Header closeButton>
54
                <h2>Acerca de esta empresa</h2>
55
            </Modal.Header>
56
            <Modal.Body>
57
                <div className="description__label">
58
                    <label htmlFor="name">Nombre</label>
59
                    <p>{companyName}</p>
60
                </div>
61
                <div className="description__label">
62
                    <label htmlFor="name">Descripción</label>
63
                    {overview && parse(overview)}
64
                </div>
65
                <div className="description__label">
66
                    <label htmlFor="name">Industria</label>
67
                    <p>{industry}</p>
68
                </div>
69
                <div className="description__label">
70
                    <label htmlFor="name">Año de fundación</label>
71
                    <p>{foundationYear}</p>
72
                </div>
73
                <div className="description__label">
74
                    <label htmlFor="name">Tamaño de la compañia</label>
75
                    <p>{companySize}</p>
76
                </div>
77
                <div className="description__label">
78
                    <label htmlFor="name">Facebook</label>
79
                    <a href={facebook} target="_blank" rel="noreferrer">
80
                        <p>{facebook}</p>
81
                    </a>
82
                </div>
83
                <div className="description__label">
84
                    <label htmlFor="name">Instagram</label>
85
                    <a href={instagram} target="_blank" rel="noreferrer">
86
                        <p>{instagram}</p>
87
                    </a>
88
                </div>
89
                <div className="description__label">
90
                    <label htmlFor="name">Twitter</label>
91
                    <a href={twitter} target="_blank" rel="noreferrer">
92
                        <p>{twitter}</p>
93
                    </a>
94
                </div>
95
                <div className="description__label">
96
                    <label htmlFor="name">Sitio web</label>
97
                    <a href={website} target="_blank" rel="noreferrer">
98
                        <p>{website}</p>
99
                    </a>
100
                </div>
101
            </Modal.Body>
102
        </Modal>
103
    )
104
}
105
 
106
AboutCompany.Modal = AboutModal
107
 
108
export default AboutCompany