Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import './index.scss';
  3.  
  4. class Buttons extends Component {
  5. render() {
  6. console.log(this.props.item.title0)
  7. return (
  8. <div>
  9.  
  10. <div className="row">
  11. <div className="col-sm-6">
  12. <label>-{this.props.index + 1}{'.1'} - Title</label>
  13. </div>
  14. <div className="col-sm-6">
  15. <input
  16. type="text"
  17. name={this.props.origin !== 'gallery' ? 'title' : 'title' + this.props.index}
  18. value={this.props.item[`title${this.props.index}`]}
  19. onChange={this.props.onChange.bind(this, this.props.index)}
  20. />
  21. </div>
  22. </div>
  23. <div className="row">
  24. <div className="col-sm-6">
  25. <label>-{this.props.index + 1}{'.2'} - Value</label>
  26. </div>
  27. <div className="col-sm-6">
  28. <input
  29. type="text"
  30. name={this.props.origin !== 'gallery' ? 'value' : 'value' + this.props.index}
  31. value={this.props.item[`value${this.props.index}`]}
  32. onChange={this.props.onChange.bind(this, this.props.index)}
  33. />
  34. </div>
  35. </div>
  36. <div className="row">
  37. <div className="col-sm-6">
  38. <label>-{this.props.index + 1}{'.3'} - Pointer</label>
  39. </div>
  40. <div className="col-sm-6">
  41. <input
  42. type="number"
  43. name={this.props.origin !== 'gallery' ? 'pointer' : 'pointer' + this.props.index}
  44. value={this.props.item[`pointer${this.props.index}`]}
  45. onChange={this.props.onChange.bind(this, this.props.index)}
  46. />
  47. </div>
  48. </div>
  49. <div className="row">
  50. <div className="col-sm-6">
  51. <label>-{this.props.index + 1}{'.4'} - Target URL</label>
  52. </div>
  53. <div className="col-sm-6">
  54. <input
  55. type="text"
  56. name={this.props.origin !== 'gallery' ? 'targetUrl' : 'targetUrl' + this.props.index}
  57. value={this.props.item[`targetUrl${this.props.index}`]}
  58. onChange={this.props.onChange.bind(this, this.props.index)}
  59. />
  60. </div>
  61. </div>
  62. {this.props.origin !== 'gallery' &&
  63. <div className="row">
  64. <div>
  65. <button type="button" onClick={() => this.props.onClickRemove(this.props.index)} className="btn btn-secondary btn-sm btn-danger">Remove Button</button>
  66. </div>
  67. </div>
  68. }
  69. <div>
  70. &nbsp;
  71. </div>
  72. </div>
  73. );
  74. }
  75. }
  76.  
  77. export default Buttons;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement