- Timestamp:
- 10/01/22 22:56:40 (2 years ago)
- Branches:
- master
- Children:
- ffd50db
- Parents:
- 895cd87
- Location:
- phonelux-frontend/src/components/PhoneOfferDetailsComponent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/PhoneOfferDetailsComponent/PhoneOfferDetailsComponent.css
r895cd87 rfd5b100 131 131 } 132 132 133 .offerdetails-show-all-specs-icon:hover{ 134 cursor: pointer; 135 } 133 136 137 .offerdetails-show-all-specs-icon{ 138 margin-left: 10px; 139 margin-right: 10px; 140 } 141 142 143 -
phonelux-frontend/src/components/PhoneOfferDetailsComponent/PhoneOfferDetailsComponent.js
r895cd87 rfd5b100 7 7 import { Link } from 'react-router-dom' 8 8 import Tippy from '@tippyjs/react' 9 import VisibilityIcon from '@mui/icons-material/Visibility'; 10 import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; 9 11 10 12 … … 16 18 this.state = { 17 19 offerId: window.location.href.split('/')[4], 18 offer: null 20 offer: null, 21 showAllSpecs: false 19 22 } 20 23 } … … 51 54 } 52 55 56 57 changeShownSpecs = () => { 58 this.setState({ 59 showAllSpecs: !this.state.showAllSpecs 60 }) 61 } 62 53 63 render() { 54 64 console.log(this.state) … … 59 69 <h3 className='phone-offer-details-last-updated-header'>Последно ажурирана: {this.state.offer == null || 60 70 this.state.offer.last_updated == null ? '#' : this.state.offer.last_updated.split('T')[0]}</h3> 71 { 72 localStorage.getItem('token') ? 73 this.state.showAllSpecs ? 74 <Tippy placement='bottom' content='Прикажи ги избраните спецификации'> 75 <VisibilityOffIcon className='offerdetails-show-all-specs-icon' onClick={this.changeShownSpecs} style={{fontSize: '45px'}}/> 76 </Tippy> : 77 <Tippy placement='bottom' content='Прикажи ги сите спецификации'> 78 <VisibilityIcon className='offerdetails-show-all-specs-icon' onClick={this.changeShownSpecs} style={{fontSize: '45px'}}/> 79 </Tippy> : <></> 80 } 81 61 82 { 62 83 localStorage.getItem('token') && (this.context.role == 'ADMIN' || this.context.role == 'SUPERADMIN') ? … … 106 127 this.state.offer.price == null ? '/' : this.state.offer.price+' ден.'}</td> 107 128 </tr> 108 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 129 { this.state.showAllSpecs || 130 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 109 131 <tr className='phone-offer-details-table-row'> 110 132 <td>Предна камера</td><td>{this.state.offer == null || … … 113 135 } 114 136 115 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Задна камера") ? 137 { this.state.showAllSpecs || 138 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Задна камера") ? 116 139 <tr className='phone-offer-details-table-row'> 117 140 <td>Задна камера</td><td>{this.state.offer == null || … … 120 143 } 121 144 122 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 145 { this.state.showAllSpecs || 146 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 123 147 <tr className='phone-offer-details-table-row'> 124 148 <td>РОМ меморија</td><td>{this.state.offer == null || … … 127 151 } 128 152 129 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 153 { this.state.showAllSpecs || 154 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 130 155 <tr className='phone-offer-details-table-row'> 131 156 <td>РАМ меморија</td><td>{this.state.offer == null || … … 134 159 } 135 160 136 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 161 { this.state.showAllSpecs || 162 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 137 163 <tr className='phone-offer-details-table-row'> 138 164 <td>Оперативен систем</td><td>{this.state.offer == null || … … 141 167 } 142 168 143 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 169 { this.state.showAllSpecs || 170 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 144 171 <tr className='phone-offer-details-table-row'> 145 172 <td>Чипсет</td><td>{this.state.offer == null || … … 148 175 } 149 176 150 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 177 { this.state.showAllSpecs || 178 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 151 179 <tr className='phone-offer-details-table-row'> 152 180 <td>Процесор</td><td>{this.state.offer == null || … … 155 183 } 156 184 157 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 185 { this.state.showAllSpecs || 186 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 158 187 <tr className='phone-offer-details-table-row'> 159 188 <td>Батерија</td><td>{this.state.offer == null || … … 162 191 } 163 192 164 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 193 { this.state.showAllSpecs || 194 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 165 195 <tr className='phone-offer-details-table-row'> 166 196 <td>Боја</td><td>{this.state.offer == null ||
Note:
See TracChangeset
for help on using the changeset viewer.