Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. import React, {Component} from 'react';
  2. import WishCreate from './WishCreate';
  3. import TextField from '@material-ui/core/TextField';
  4. import SearchIcon from '@material-ui/icons/Search';
  5. import IconButton from '@material-ui/core/IconButton';
  6. import Table from 'react-bootstrap/Table';
  7. import StarRatings from 'react-star-ratings';
  8. import EditWishIcon from './icons/EditWishIcon';
  9. import DeleteWishIcon from './icons/DeleteWishIcon';
  10. import Cookie from 'js-cookie';
  11. import WishEdit from './WishEdit';
  12. import { PrivateInstance } from './helpers/PrivateInstance';
  13.  
  14. class WishlistList extends Component {
  15. constructor(props){
  16. super(props);
  17. this.state = { };
  18. this.wishDelete = this.wishDelete.bind(this);
  19. }
  20.  
  21. componentWillMound(){
  22. this.wishMap();
  23. }
  24.  
  25. wishDelete(){
  26.  
  27.  
  28. }
  29.  
  30. render(){
  31. return(
  32. <div className = 'flexColumn' style = {{height:'100vh'}}>
  33. <div className = 'flexRow' style = {{justifyContent:'space-between'}}>
  34. <div className = 'lato-font' style = {{fontSize:'40px', color:'rgba(0,0,0,0.35)', marginTop:'30px'}}> My wish list </div>
  35. <div style = {{marginTop:'16px', marginRight:'700px'}}>
  36. <WishCreate style = {{position:'relative', top:'30px'}}/>
  37. </div>
  38. <div>
  39. <TextField
  40. label = 'Search'
  41. onChange = {this.inputHandleChange}
  42. onKeyDown = {this.keyInput}
  43. color = 'primary'
  44. style = {{width:'320px', marginTop:'22px'}}
  45. placeholder = 'Enter your friends nickname'
  46. />
  47. <IconButton
  48. style = {{width:'30px',height:'30px',position:'relative',top:'42px', right:'30px'}}
  49. onClick = {this.findUser}
  50. >
  51. <SearchIcon style = {{width:'23px',height:'23px', position: 'relative', bottom:'9px'}}/>
  52. </IconButton>
  53. </div>
  54. </div>
  55. <div className = 'lato-font' style = {{color:'#D7859B', fontSize:'20px', fontWeight:'bold', marginTop:'20px', marginBottom:'15px'}}>
  56. <div className = 'flexRow' style = {{marginLeft:'20px'}}>
  57. <div style = {{width:'250px'}}> Wish </div>
  58. <div style = {{width:'650px'}}> Description </div>
  59. <div style = {{width:'250px'}}> Priority </div>
  60. <div style = {{width:'250px'}}> Category </div>
  61. <div style = {{width:'125px'}}/>
  62. </div>
  63. </div>
  64. {
  65. this.props.wishList.map(wish_id => (
  66. <div key = {wish_id.id} className = 'flexRow' style = {{background: 'rgba(255, 255, 255, 0.4)', borderRadius:'5px', marginBottom:'8px', height:'60px', alignItems:'center', marginRight:'20px',justifyContent:'space-between'}}>
  67. <div style = {{width:'230px', paddingLeft:'20px'}}>{wish_id.name}</div>
  68. <div style = {{width:'620px'}}>{wish_id.comment}</div>
  69. <div style = {{width:'225px'}}>
  70. <StarRatings
  71. rating = {wish_id.priority}
  72. numberOfStars={wish_id.priority}
  73. starRatedColor='E25781'
  74. starDimension = '15px'
  75. />
  76. </div>
  77. <div style = {{width:'255px'}}>{wish_id.category}</div>
  78. <div className = 'flexRow' style = {{width:'80px'}}>
  79. <WishEdit wishId = {wish_id.id}/>
  80. <button className = 'wishList-button' style = {{marginTop:'5px'}} onClick = {() =>{
  81. PrivateInstance().delete(`/gifts/${wish_id.id}`)
  82. .then((response) => {
  83. });
  84. }}><DeleteWishIcon style = {{width:'20px', height:'20px'}}/></button>
  85. </div>
  86. </div>
  87. ))
  88. }
  89. </div>
  90. );
  91. }
  92. }
  93.  
  94. export default WishlistList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement