Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6306 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6267 stevensc 1
import React, { useState } from 'react'
6266 stevensc 2
import HeaderModal from './HeaderModal'
6055 stevensc 3
 
15062 stevensc 4
const Header = ({ companyId, header, headerUploadUrl, title }) => {
6266 stevensc 5
 
15062 stevensc 6
	const [isShowModal, setIsShowModal] = useState(false)
7
	const [headerImg, setHeaderImg] = useState(`/storage/type/company/code/${companyId}/filename/${header}`)
6266 stevensc 8
 
15062 stevensc 9
	const closeModal = () => setIsShowModal(false)
10
	const showModal = () => setIsShowModal(true)
6266 stevensc 11
 
15062 stevensc 12
	return (
13
		<>
14
			<div className="user-profile-ov">
15
				<h3>
16
					{title} (2480 x 268px)
17
				</h3>
18
				<p>Actualice la cabecera de sus documentos pdf aquí:</p>
19
				<img
20
					id="user-header-img"
21
					style={{ width: '100%' }}
22
					src={headerImg}
23
					alt=""
24
				/>
25
				<div className="add-dp">
26
					<div className="add-pic-box change-header-image">
27
						<div className="container">
28
							<div className="row no-gutters">
29
								<div className="col-lg-12 col-sm-12">
30
									<button
31
										className="btn btn-header-open"
32
										onClick={showModal}
33
									>
34
										<i className="fa fa-camera"></i>
35
									</button>
36
								</div>
37
							</div>
38
						</div>
39
					</div>
40
				</div>
41
			</div>
42
			<HeaderModal
43
				isOpen={isShowModal}
44
				headerUploadUrl={headerUploadUrl}
45
				closeModal={closeModal}
46
				action={setHeaderImg}
47
			/>
48
		</>
49
	)
6055 stevensc 50
}
51
 
52
export default Header