- Timestamp:
- 10/01/22 22:56:40 (2 years ago)
- Branches:
- master
- Children:
- ffd50db
- Parents:
- 895cd87
- Location:
- phonelux-frontend/src/components/CompareOffersComponent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/CompareOffersComponent/CompareOffersComponent.css
r895cd87 rfd5b100 71 71 } 72 72 73 .show-all-specs-icon:hover{ 74 cursor: pointer; 75 } 76 -
phonelux-frontend/src/components/CompareOffersComponent/CompareOffersComponent.js
r895cd87 rfd5b100 6 6 import axios from 'axios'; 7 7 import Tippy from '@tippyjs/react'; 8 import VisibilityIcon from '@mui/icons-material/Visibility'; 9 import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; 8 10 9 11 export class CompareOffersComponent extends Component { … … 13 15 14 16 this.state = { 15 offersToCompare: [] 17 offersToCompare: [], 18 showAllSpecs : false 16 19 } 17 20 } … … 48 51 } 49 52 53 changeShownSpecs = () => { 54 this.setState({ 55 showAllSpecs: !this.state.showAllSpecs 56 }) 57 } 58 50 59 51 60 render() { 52 console.log(this.state)53 61 return ( 54 62 <div className='compare-offers-main'> … … 65 73 <tbody> 66 74 <tr className='compare-offers-table-row'> 67 <th className='compare-offer-table-headers'></th> 75 <th className='compare-offer-table-headers'> 76 { 77 this.state.showAllSpecs ? 78 <Tippy placement='bottom' content='Прикажи ги избраните спецификации'> 79 <VisibilityOffIcon className='show-all-specs-icon' onClick={this.changeShownSpecs} style={{fontSize: '45px'}}/> 80 </Tippy> : 81 <Tippy placement='bottom' content='Прикажи ги сите спецификации'> 82 <VisibilityIcon className='show-all-specs-icon' onClick={this.changeShownSpecs} style={{fontSize: '45px'}}/> 83 </Tippy> 84 } 85 </th> 68 86 { 69 87 this.state.offersToCompare.map((offer,idx) => … … 93 111 } 94 112 </tr> 95 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 113 { this.state.showAllSpecs || 114 !localStorage.getItem('pickedSpecifications') || 115 localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 96 116 <tr className='compare-offers-table-row'> 97 117 <th className='compare-offer-table-headers'>РАМ меморија</th> … … 102 122 </tr> : <></> 103 123 } 104 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 124 { this.state.showAllSpecs || 125 !localStorage.getItem('pickedSpecifications') || 126 localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 105 127 <tr className='compare-offers-table-row'> 106 128 <th className='compare-offer-table-headers'>РОМ меморија</th> … … 111 133 </tr> : <></> 112 134 } 113 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 135 { this.state.showAllSpecs || 136 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 114 137 <tr className='compare-offers-table-row'> 115 138 <th className='compare-offer-table-headers'>Предна камера</th> … … 120 143 </tr> : <></> 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='compare-offers-table-row'> 124 148 <th className='compare-offer-table-headers'>Задна камера</th> … … 129 153 </tr> : <></> 130 154 } 131 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 155 { this.state.showAllSpecs || 156 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 132 157 <tr className='compare-offers-table-row'> 133 158 <th className='compare-offer-table-headers'>Процесор</th> … … 138 163 </tr> : <></> 139 164 } 140 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 165 { this.state.showAllSpecs || 166 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 141 167 <tr className='compare-offers-table-row'> 142 168 <th className='compare-offer-table-headers'>Чипсет</th> … … 147 173 </tr> : <></> 148 174 } 149 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 175 { this.state.showAllSpecs || 176 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 150 177 <tr className='compare-offers-table-row'> 151 178 <th className='compare-offer-table-headers'>Оперативен систем</th> … … 156 183 </tr> : <></> 157 184 } 158 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 185 { this.state.showAllSpecs || 186 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 159 187 <tr className='compare-offers-table-row'> 160 188 <th className='compare-offer-table-headers'>Батерија</th> … … 165 193 </tr> : <></> 166 194 } 167 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 195 { this.state.showAllSpecs || 196 !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 168 197 <tr className='compare-offers-table-row'> 169 198 <th className='compare-offer-table-headers'>Боја</th>
Note:
See TracChangeset
for help on using the changeset viewer.