1 import React, { Component } from 'react'; |
1 import React, { Component } from 'react'; |
2 import { connect } from 'react-redux'; |
2 import { connect } from 'react-redux'; |
3 import { bindActionCreators } from 'redux'; |
3 import { bindActionCreators } from 'redux'; |
|
4 import { Trans } from 'react-i18next'; |
4 import '../App.css'; |
5 import '../App.css'; |
5 import Navbar from './Navbar'; |
6 import Navbar from './Navbar'; |
6 import * as authActions from '../actions/authActions'; |
7 import * as authActions from '../actions/authActions'; |
7 import { getOnline, getCreateGroup } from '../selectors/authSelectors'; |
8 import { getOnline, getCreateGroup } from '../selectors/authSelectors'; |
8 import './CreateGroup.css'; |
9 import './CreateGroup.css'; |
77 <div className="container-fluid"> |
78 <div className="container-fluid"> |
78 <div className="row"> |
79 <div className="row"> |
79 <div className="col-lg-6 offset-md-5"> |
80 <div className="col-lg-6 offset-md-5"> |
80 <div className="panel-login panel panel-default d-flex justify-content-end"> |
81 <div className="panel-login panel panel-default d-flex justify-content-end"> |
81 <div className="card-header bg-primary w-50"> |
82 <div className="card-header bg-primary w-50"> |
82 <h5 className="text-center text-secondary font-weight-bold">Nouveau groupe</h5> |
83 <h5 className="text-center text-secondary font-weight-bold text-capitalize"><Trans i18nKey="create_group.new_group">nouveau groupe</Trans></h5> |
83 <form className="mt-3" onSubmit={this.submit.bind(this)}> |
84 <form className="mt-3" onSubmit={this.submit.bind(this)}> |
84 <div className="form-group mb-2" /*validationState={ errorMessages && ('name' in errorMessages) ? 'error' : null }*/> |
85 <div className="form-group mb-2" /*validationState={ errorMessages && ('name' in errorMessages) ? 'error' : null }*/> |
85 <label className="col-from-label text-secondary font-weight-bold mt-2">Nom</label> |
86 <label className="col-from-label text-secondary font-weight-bold mt-2 text-capitalize"><Trans i18nKey="common.name">nom</Trans></label> |
86 <input className="form-control bg-secondary text-primary border-0 w-100" type="text" onChange={this.handleInputChange} name="name" placeholder="Entrez un nom de groupe"/> |
87 <input className="form-control bg-secondary text-primary border-0 w-100" type="text" onChange={this.handleInputChange} name="name" placeholder="Entrez un nom de groupe"/> |
87 {/* { this.renderErrorMessage(errorMessages, 'name') } */} |
88 {/* { this.renderErrorMessage(errorMessages, 'name') } */} |
88 </div> |
89 </div> |
89 <div className="form-group mb-2" /*validationState={ errorMessages && ('description' in errorMessages) ? 'error' : null }*/> |
90 <div className="form-group mb-2" /*validationState={ errorMessages && ('description' in errorMessages) ? 'error' : null }*/> |
90 <label className="col-form-label text-secondary font-weight-bold mt-2">Description</label> |
91 <label className="col-form-label text-secondary font-weight-bold mt-2 text-capitalize"><Trans i18nKey="common.description">description</Trans></label> |
91 <textarea className="form-control bg-secondary text-primary border-0 w-100" type="textarea" onChange={this.handleInputChange} name="description" placeholder="Entrez une description de groupe"></textarea> |
92 <textarea className="form-control bg-secondary text-primary border-0 w-100" type="textarea" onChange={this.handleInputChange} name="description" placeholder="Entrez une description de groupe"></textarea> |
92 {/* { this.renderErrorMessage(errorMessages, 'description') } */} |
93 {/* { this.renderErrorMessage(errorMessages, 'description') } */} |
93 </div> |
94 </div> |
94 {/* { this.renderNonFieldErrors(errorMessages) } */} |
95 {/* { this.renderNonFieldErrors(errorMessages) } */} |
95 <div className="text-center"> |
96 <div className="text-center"> |
96 <button type="submit" value="Submit" className="btn btn-secondary btn-lg text-primary font-weight-bold m-3" disabled={okDisabled} onClick={this.submit}>Créer</button> |
97 <button type="submit" value="Submit" className="btn btn-secondary btn-lg text-primary font-weight-bold m-3 text-capitalize" disabled={okDisabled} onClick={this.submit}><Trans i18nKey="common.create">Créer</Trans></button> |
97 <button type="button" className="btn btn-irinotes-form text-muted btn-lg font-weight-bold" onClick={this.cancel}>Annuler</button> |
98 <button type="button" className="btn btn-irinotes-form text-muted btn-lg font-weight-bold text-capitalize" onClick={this.cancel}><Trans i18nKey="common.cancel">annuler</Trans></button> |
98 </div> |
99 </div> |
99 </form> |
100 </form> |
100 </div> |
101 </div> |
101 </div> |
102 </div> |
102 </div> |
103 </div> |