client/src/components/CreateSession.js
changeset 171 03334a31130a
parent 168 ea92f4fe783d
child 172 4b780ebbedc6
--- a/client/src/components/CreateSession.js	Tue Nov 06 16:19:26 2018 +0100
+++ b/client/src/components/CreateSession.js	Thu Nov 08 16:03:28 2018 +0100
@@ -2,10 +2,11 @@
 import Modal from 'react-modal';
 import PropTypes from 'prop-types';
 import uuidV1 from 'uuid/v1';
+import { withNamespaces } from 'react-i18next';
 import '../App.css';
 import './CreateSession.css';
 
-export default class CreateSession extends Component {
+class CreateSession extends Component {
 
   static propTypes = {
     history: PropTypes.object.isRequired,
@@ -69,9 +70,10 @@
 
   render() {
 
+    const t = this.props.t;
     return (
       <div className="container-fluid">
-      <a className="nav-link" onClick={this.openSessionModal}>Nouvelle session</a>
+      <a className="nav-link" onClick={this.openSessionModal}>{t('create_session.new_session')}</a>
       <Modal
       className="Modal__Bootstrap modal-dialog ml-5 mt-5 fixed-top w-100"
       isOpen={this.state.modalIsOpen}
@@ -81,7 +83,7 @@
           <div className="modal-body mt-3">
             <form onSubmit={ e => { e.preventDefault() } }>
               <div className="form-group">
-                <label className="col-form-label text-secondary font-weight-bold pt-3">Titre</label>
+                <label className="col-form-label text-secondary font-weight-bold pt-3 text-capitalize">{t('common.title')}</label>
                 <input className="form-control text-primary w-100"
                   name="title"
                   onChange={ this.onChange }
@@ -90,7 +92,7 @@
                 />
               </div>
               <div className="form-group">
-                <label className="col-form-label text-secondary font-weight-bold pt-3 mt-3">Description</label>
+                <label className="col-form-label text-secondary font-weight-bold pt-3 mt-3 text-capitalize">{t('common.description')}</label>
                 <textarea className="form-control text-primary w-100"
                   type="textarea"
                   name="description"
@@ -99,14 +101,14 @@
                   ></textarea>
               </div>
               <div className="form-group">
-                <label className="col-form-label text-secondary font-weight-bold mt-5 ml-5" onClick={this.toggleProtocol}>Protocole de la prise de note {this.state.protocolOpen?<span className="material-icons protocol-toggle">&#xE313;</span>:<span className="material-icons protocol-toggle">&#xE315;</span>}</label>
+                <label className="col-form-label text-secondary font-weight-bold mt-5 ml-5" onClick={this.toggleProtocol}>{t('create_session.protocol')} {this.state.protocolOpen?<span className="material-icons protocol-toggle">&#xE313;</span>:<span className="material-icons protocol-toggle">&#xE315;</span>}</label>
                 <div className={ "collapse" + (this.state.protocolOpen?'in':'')} >
                   {/* <pre>{JSON.stringify(this.props.currentSession.protocol, null, 2)}</pre> */}
                   <pre className=" protocol text-secondary">{JSON.stringify(this.getGroupProtocol(), null, 2)}</pre>
                 </div>
               </div>
               <div className="text-center">
-              <button id="create-button" type="submit" className="btn btn-secondary btn-lg text-primary font-weight-bold m-3" onClick={this.createSession}>Commencer</button>
+              <button id="create-button" type="submit" className="btn btn-secondary btn-lg text-primary font-weight-bold m-3 text-capitalize" onClick={this.createSession}>{t('common.begin')}</button>
               </div>
             </form>
           </div>
@@ -116,3 +118,5 @@
     );
   }
 }
+
+export default withNamespaces()(CreateSession);