Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tarea-cv-react
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nahuel Mereles Rodriguez
tarea-cv-react
Commits
295188a8
Commit
295188a8
authored
May 09, 2022
by
Nahuel Mereles Rodriguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form completo
parent
213f7a50
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
7 deletions
+42
-7
src/App.css
+12
-0
src/App.js
+30
-7
No files found.
src/App.css
View file @
295188a8
...
...
@@ -163,3 +163,14 @@ p {
.negrita
{
font-weight
:
bold
;
}
.textForm-container
{
width
:
90%
;
}
.button-container
{
width
:
100%
;
display
:
flex
;
justify-content
:
space-around
;
border-top
:
1px
solid
#ced4da
;
}
\ No newline at end of file
src/App.js
View file @
295188a8
import
'./App.css'
;
import
{
jsPDF
}
from
"jspdf"
;
import
React
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
'./App.css'
;
import
Telefono
from
'./assets/images/telefono.png'
;
import
Mail
from
'./assets/images/email.png'
;
...
...
@@ -8,13 +8,14 @@ import Map from './assets/images/map.png';
// import $ from "jquery";
function
App
()
{
const
[
renderAlert
,
setRenderAlert
]
=
useState
(
false
);
const
previsualizacionPdf
=
()
=>
{
// Objeto jsPDF para utilizar los metodos de la libreria inicializado con los sig. args
// p : Hoja vertical
// pt: medicion en puntos de la hoja
// letter: Tipo de papel a utilizar carta
var
pdf
=
new
jsPDF
(
'p'
,
'pt'
,
'
letter'
);
var
pdf
=
new
jsPDF
(
'p'
,
'pt'
,
'
a4'
);
//'l', 'mm', [1200, 1210] 'p', 'pt', 'a4'
// --------- Configuracion del PDF -----------
var
margin
=
10
;
// Margin que se le dara en todos los lados del pdf
...
...
@@ -40,7 +41,7 @@ function App () {
const
generarPdf
=
()
=>
{
// Utilizamos la misma configuracion PDF que en la funcion "PrevisualizacionPdf"
var
pdf
=
new
jsPDF
(
'p'
,
'pt'
,
'
letter
'
);
var
pdf
=
new
jsPDF
(
'p'
,
'pt'
,
'
a4
'
);
var
margin
=
5
;
var
scale
=
(
pdf
.
internal
.
pageSize
.
width
-
margin
*
2
)
/
document
.
body
.
scrollWidth
;
...
...
@@ -57,6 +58,10 @@ function App () {
});
}
const
mensajeEnviado
=
()
=>
{
setRenderAlert
(
true
);
}
return
(
<
div
className
=
'father-container'
>
...
...
@@ -271,18 +276,36 @@ function App () {
<
/div
>
{
/* Secciones Principales */
}
<
/div
>
<
button
onClick
=
{
previsualizacionPdf
}
>
<
div
className
=
"button-container mt-4"
>
<
button
type
=
"button"
className
=
"btn btn-outline-primary mt-3"
onClick
=
{
previsualizacionPdf
}
>
Previsualizacion
del
Pdf
<
/button
>
<
button
onClick
=
{
generarPdf
}
>
<
button
type
=
"button"
className
=
"btn btn-outline-primary mt-3"
onClick
=
{
generarPdf
}
>
Generar
Pdf
<
/button
>
<
/div
>
<
div
className
=
"d-flex justify-content-center align-items-center mt-4"
>
<
div
className
=
"textForm-container mb-3"
>
<
label
for
=
"form-contact"
className
=
"form-label negrita"
>
Formulario
de
Contacto
<
/label
>
<
textarea
className
=
"form-control"
id
=
"form-contact"
rows
=
"3"
><
/textarea
>
<
div
id
=
"liveAlertPlaceholder"
><
/div
>
<
div
className
=
'd-flex justify-content-end'
>
<
button
type
=
"button"
class
=
"btn btn-success mt-2"
id
=
"liveAlertBtn"
onClick
=
{
mensajeEnviado
}
>
Enviar
<
/button
>
<
/div
>
{
renderAlert
&&
<
div
class
=
"alert alert-success mt-3"
role
=
"alert"
>
Mensaje
Enviado
<
/div
>
}
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment