Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. {this.state.telephone && this.state.telephone.map((el, index) =>
  2. <div className="left contactto-100">
  3. <Telephone onChange={this.handlePhone} value={el} counter={index} />
  4. {index > 0 ?
  5. <div className="left" data-pos={index} onClick={this.removePhone}>
  6. <Delete className="list-table-body-action-icons" width="28" height="28"/>
  7. </div>
  8. : null}
  9. </div>
  10. )}
  11.  
  12. 'use strict'
  13.  
  14. import React from 'react'
  15.  
  16. class Delete extends React.Component{
  17. constructor(props) {
  18. super(props)
  19. }
  20.  
  21. render() {
  22. return (
  23. <svg className={this.props.className} fill="#666" width={this.props.width} height={this.props.height} viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
  24. <path d="M12,14H50v2H12V14Zm28,1H38V12a2,2,0,0,0-2-2H26a2,2,0,0,0-2,2v3H22V12a4,4,0,0,1,4-4H36a4,4,0,0,1,4,4v3ZM25,20l1,32L24,52,23,20Zm12,0L39,20,38,52,36,52Zm-7,0h2V52H30V20ZM41,58H21a4.06,4.06,0,0,1-4-3.88l-3-39,2-.15,3,39A2.1,2.1,0,0,0,21,56H41a2.18,2.18,0,0,0,2-2.12l3-39,2,0.15-3,39A4.16,4.16,0,0,1,41,58Z"/>
  25. </svg>
  26. );
  27. }
  28. }
  29.  
  30. Delete.defaultProps = { width: '24', height: '24', className:''}
  31.  
  32. Delete.PropTypes = {
  33. width: React.PropTypes.string,
  34. height: React.PropTypes.string,
  35. className: React.PropTypes.string
  36. }
  37.  
  38. export default Delete
  39.  
  40. removePhone(event){
  41. console.log(event.target)
  42.  
  43. ...
  44.  
  45. event.stopPropagation()
  46. event.nativeEvent.stopImmediatePropagation()
  47. }
  48.  
  49. this.removePhone = this.removePhone.bind(this)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement