Advertisement
Guest User

asd

a guest
Nov 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //NeWITEm
  2.  
  3. import React, { Component } from 'react'
  4. import 'bootstrap/dist/css/bootstrap.min.css';
  5.  
  6. class NewItemInput extends Component {
  7.  
  8.     clicked(){
  9.        
  10.     }
  11.  
  12.     render () {
  13.  
  14.         let content;
  15.        
  16.         if(this.props.showInputs === false){
  17.             content = (<button type="button" className="btn btn-primary btn-block"
  18.                       onClick= {this.props.toggleInputs}>Add new</button>);
  19.         }
  20.         else{
  21.             content = (
  22.                 <div>
  23.                     <div className="col-md-4">
  24.                             <input type="text"/>
  25.                     </div>
  26.                     <div className="col-md-4">
  27.                             <input type="text"/>
  28.                     </div>
  29.                     <div className="col-md-4">
  30.                             <input type="text"/>
  31.                             <button type="button" className="btn btn-success">Save</button>
  32.                             <button type="button" className="btn btn-danger"
  33.                             onClick={this.props.toggleCancels}>Cancel</button>
  34.                     </div>
  35.                 </div>
  36.             );
  37.         }
  38.  
  39.         return (
  40.            
  41.             <div className="row">
  42.                 {content}
  43.             </div>
  44.         )
  45.     }
  46. }
  47.  
  48. export default NewItemInput
  49.  
  50. /APP JS
  51. import React, { Component } from 'react'
  52. import 'bootstrap/dist/css/bootstrap.min.css';
  53.  
  54. class NewItemInput extends Component {
  55.  
  56.     clicked(){
  57.        
  58.     }
  59.  
  60.     render () {
  61.  
  62.         let content;
  63.        
  64.         if(this.props.showInputs === false){
  65.             content = (<button type="button" className="btn btn-primary btn-block"
  66.                       onClick= {this.props.toggleInputs}>Add new</button>);
  67.         }
  68.         else{
  69.             content = (
  70.                 <div>
  71.                     <div className="col-md-4">
  72.                             <input type="text"/>
  73.                     </div>
  74.                     <div className="col-md-4">
  75.                             <input type="text"/>
  76.                     </div>
  77.                     <div className="col-md-4">
  78.                             <input type="text"/>
  79.                             <button type="button" className="btn btn-success">Save</button>
  80.                             <button type="button" className="btn btn-danger"
  81.                             onClick={this.props.toggleCancels}>Cancel</button>
  82.                     </div>
  83.                 </div>
  84.             );
  85.         }
  86.  
  87.         return (
  88.            
  89.             <div className="row">
  90.                 {content}
  91.             </div>
  92.         )
  93.     }
  94. }
  95.  
  96. export default NewItemInput
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement