Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 327 | Rev 336 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
306 geraldo 1
import React from "react";
2
import Section from "./section/Section";
3
import Spinner from "../../../shared/loading-spinner/Spinner";
4
 
5
const Test = (props) => {
6
 
7
    // get props
8
    const { backendVars, test, loading, setTest } = props;
9
 
10
    const formSubmit = (event) => {
11
        event.preventDefault()
12
        var data = new FormData(event.target)
13
        console.log(Object.fromEntries(data.entries()))
14
    }
15
 
16
    return (
17
        <div>
18
            {loading ? (
19
                <div className="row">
20
                    <Spinner />
21
                </div>
22
            ) : (
311 geraldo 23
                <div className="row test-section">
306 geraldo 24
                    <form onSubmit={formSubmit}>
307 geraldo 25
                        <div className="col-md-12 col-sm-12 col-xs-12">
312 geraldo 26
                            <div className="company-title">
27
                                <div className="section_admin_title_buttons">
28
                                    <h1 className="title">{test.name}</h1>
307 geraldo 29
                                </div>
30
                            </div>
31
                            <div
32
                                dangerouslySetInnerHTML={{ __html: test.text }}
309 geraldo 33
                                className="description company-title"
307 geraldo 34
                            ></div>
306 geraldo 35
                        </div>
36
                        <div className="col-md-12 col-sm-12 col-xs-12">
312 geraldo 37
                            <div className="company-title">
38
                                {test.content.map((section, key) => {
332 geraldo 39
                                    return <Section
40
                                        section={section}
41
                                        key={key}
42
                                        backendVars={backendVars} />
312 geraldo 43
                                })}
308 geraldo 44
                            </div>
306 geraldo 45
                        </div>
307 geraldo 46
                        <div className="col-md-12 col-sm-12 col-xs-12">
312 geraldo 47
                            <div className="company-title">
327 geraldo 48
                                <button type="button" className="btn btn-danger" onClick={() => setTest(null)}>{backendVars.LBL_CANCEL}</button>
312 geraldo 49
                                <button type="submit" className="btn btn-success">{backendVars.LBL_SAVE}</button>
307 geraldo 50
                            </div>
51
                        </div>
306 geraldo 52
                    </form>
53
                </div>
54
            )}
55
        </div>
56
    )
57
}
58
 
59
export default Test;