- Timestamp:
- 09/21/22 18:47:39 (2 years ago)
- Branches:
- master
- Children:
- 34950c6
- Parents:
- 5201690
- Location:
- phonelux-frontend/src/components/PhoneOfferDetailsComponent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/PhoneOfferDetailsComponent/PhoneOfferDetailsComponent.css
r5201690 rd66b8eb 56 56 .phone-offer-details-last-updated-header{ 57 57 width: 25%; 58 margin-left: 20px;58 margin-left: 5%; 59 59 padding: 10px; 60 60 border: 1px solid rgb(199, 193, 193); 61 background-color: # B6E2C8;61 background-color: #dadedc; 62 62 border-radius: 50px; 63 63 text-align: center; … … 73 73 .phone-offer-details-edit-header{ 74 74 width: 100%; 75 margin-left: 20px;75 margin-left: 5%; 76 76 padding-top: 10px; 77 77 border: 1px solid black; … … 96 96 } 97 97 98 .validate-offer-button{ 99 font-size: 17px; 100 padding: 10px; 101 background-color: rgb(170, 211, 240); 102 border-radius: 30px; 103 border: 1px solid black; 104 margin-left: auto; 105 margin-right: 10%; 106 width: 15%; 107 font-weight: bold; 108 font-size: 18px; 109 text-align: center; 110 } 98 111 112 .validate-offer-button:hover{ 113 cursor: pointer; 114 background-color: rgb(149, 187, 215); 115 box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19); 116 transition: box-shadow 0.5s, background-color 0.5s ; 117 } 118 119 .offer-valid-header{ 120 font-size: 17px; 121 padding: 10px; 122 background-color: #96d5b0; 123 border-radius: 20px; 124 border: 1px solid black; 125 margin-left: auto; 126 margin-right: 10%; 127 text-align: center; 128 width: 15%; 129 font-weight: bold; 130 font-size: 19px; 131 } 132 133 -
phonelux-frontend/src/components/PhoneOfferDetailsComponent/PhoneOfferDetailsComponent.js
r5201690 rd66b8eb 4 4 import HeaderComponent from '../HeaderComponent/HeaderComponent' 5 5 import UserContext from '../../context/UserContext' 6 import CheckIcon from '@mui/icons-material/Check'; 6 7 import { Link } from 'react-router-dom' 8 import Tippy from '@tippyjs/react' 7 9 8 10 … … 19 21 20 22 componentDidMount(){ 21 axios.get('/phoneoffer/'+this.state.offerId) 23 this.getPhoneOffer() 24 } 25 26 getPhoneOffer = () => { 27 axios.get('/phoneoffer/'+this.state.offerId) 22 28 .then(response => { 23 29 this.setState({ … … 27 33 } 28 34 35 validateOffer = () => { 36 var config = { 37 method: 'put', 38 url: '/admin/validateoffer/'+this.state.offerId, 39 headers: { 40 'Authorization': 'Bearer '+localStorage.getItem('token') 41 } 42 }; 43 44 axios(config) 45 .then(response => { 46 this.getPhoneOffer(); 47 }) 48 .catch(error => { 49 console.log(error); 50 }); 51 } 52 29 53 render() { 54 console.log(this.state) 30 55 return ( 31 56 <div className='phone-offer-details-main'> … … 40 65 </Link> : <></> 41 66 } 67 68 69 {(() => { 70 if(this.state.offer != null && this.state.offer.is_validated) 71 { 72 return <Tippy placement='bottom' content='Понудата е валидна'> 73 <CheckIcon className='offer-valid-check-icon' style={{'fontSize': '60px'}}></CheckIcon> 74 </Tippy> 75 } 76 77 if(this.state.offer != null && !this.state.offer.is_validated && 78 (this.context.role == 'ADMIN' || this.context.role == 'SUPERADMIN')) 79 { 80 return <button onClick={this.validateOffer} className='validate-offer-button'>Валидирај понуда</button> 81 } 82 83 })()} 42 84 </div> 85 <div className='phone-offer-details-last-updated-wrapper'></div> 43 86 <div className='phone-offer-details-table-wrapper'> 44 87 <div className='phone-offer-details-table-section'>
Note:
See TracChangeset
for help on using the changeset viewer.