Changeset 48f3030 for phonelux-frontend
- Timestamp:
- 09/23/22 02:03:14 (2 years ago)
- Branches:
- master
- Children:
- 895cd87
- Parents:
- 436e0da
- Location:
- phonelux-frontend/src
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/CheaperOffersComponent/CheaperOffersComponent.js
r436e0da r48f3030 19 19 20 20 return ( 21 <div >21 <div className='cheaperoffers-modal-main'> 22 22 <Modal 23 23 open={this.props.openModal} -
phonelux-frontend/src/components/CompareOffersComponent/CompareOffersComponent.js
r436e0da r48f3030 90 90 <th className='compare-offer-table-headers'>Цена</th> 91 91 { 92 this.state.offersToCompare.map((offer,idx) => <td key={idx}>{offer.price} </td>)92 this.state.offersToCompare.map((offer,idx) => <td key={idx}>{offer.price} ден.</td>) 93 93 } 94 94 </tr> 95 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 95 96 <tr className='compare-offers-table-row'> 96 97 <th className='compare-offer-table-headers'>РАМ меморија</th> … … 99 100 offer.ram_memory == '' ? '/' : offer.ram_memory}</td>) 100 101 } 101 </tr> 102 </tr> : <></> 103 } 104 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 102 105 <tr className='compare-offers-table-row'> 103 106 <th className='compare-offer-table-headers'>РОМ меморија</th> … … 106 109 offer.rom_memory == '' ? '/' : offer.rom_memory}</td>) 107 110 } 108 </tr> 111 </tr> : <></> 112 } 113 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 109 114 <tr className='compare-offers-table-row'> 110 115 <th className='compare-offer-table-headers'>Предна камера</th> … … 113 118 offer.front_camera == '' ? '/' : offer.front_camera}</td>) 114 119 } 115 </tr> 120 </tr> : <></> 121 } 122 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Задна камера") ? 116 123 <tr className='compare-offers-table-row'> 117 124 <th className='compare-offer-table-headers'>Задна камера</th> … … 120 127 offer.back_camera == '' ? '/' : offer.back_camera}</td>) 121 128 } 122 </tr> 129 </tr> : <></> 130 } 131 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 123 132 <tr className='compare-offers-table-row'> 124 133 <th className='compare-offer-table-headers'>Процесор</th> … … 127 136 offer.cpu == '' ? '/' : offer.cpu}</td>) 128 137 } 129 </tr> 138 </tr> : <></> 139 } 140 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 130 141 <tr className='compare-offers-table-row'> 131 142 <th className='compare-offer-table-headers'>Чипсет</th> … … 134 145 offer.chipset == '' ? '/' : offer.chipset}</td>) 135 146 } 136 </tr> 147 </tr> : <></> 148 } 149 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 137 150 <tr className='compare-offers-table-row'> 138 151 <th className='compare-offer-table-headers'>Оперативен систем</th> … … 141 154 offer.operating_system == '' ? '/' : offer.operating_system}</td>) 142 155 } 143 </tr> 156 </tr> : <></> 157 } 158 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 144 159 <tr className='compare-offers-table-row'> 145 160 <th className='compare-offer-table-headers'>Батерија</th> … … 148 163 offer.battery == '' ? '/' : offer.battery}</td>) 149 164 } 150 </tr> 165 </tr> : <></> 166 } 167 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 151 168 <tr className='compare-offers-table-row'> 152 169 <th className='compare-offer-table-headers'>Боја</th> … … 155 172 offer.color == '' ? '/' : offer.color}</td>) 156 173 } 157 </tr> 174 </tr> : <></> 175 } 158 176 </tbody> 159 177 </table> -
phonelux-frontend/src/components/FiltersComponents/FilterSelectComponent.js
r436e0da r48f3030 16 16 super(props) 17 17 const {type} = this.props 18 console.log(type)19 18 this.state = { 20 19 pickedItems: localStorage.getItem(type) ? localStorage.getItem(type).split(',') : [], -
phonelux-frontend/src/components/FiltersComponents/SortByComponent.css
r436e0da r48f3030 20 20 overflow-y: scroll; 21 21 } 22 23 .pick-specifications-icon{ 24 margin-left: 10px; 25 } 26 27 .pick-specifications-icon:hover{ 28 cursor: pointer; 29 } 30 31 .specifications-filter-main{ 32 display: flex; 33 } 34 .tippy-pick-specifications-icon{ 35 width: fit-content; 36 text-align: center; 37 } -
phonelux-frontend/src/components/FiltersComponents/SortByComponent.js
r436e0da r48f3030 3 3 import './SortByComponent.css' 4 4 import SpecificationsFilterComponent from './SpecificationsFilterComponent' 5 import FilterAltIcon from '@mui/icons-material/FilterAlt'; 6 import PickSpecificationComponent from '../PickSpecificationComponent/PickSpecificationComponent'; 5 7 6 8 export class SortByComponent extends Component { … … 10 12 11 13 this.state = { 12 sortBy: localStorage.getItem('sortBy') ? localStorage.getItem('sortBy') : 'mostPopular' 14 sortBy: localStorage.getItem('sortBy') ? localStorage.getItem('sortBy') : 'mostPopular', 15 openModal: false 13 16 } 14 17 } -
phonelux-frontend/src/components/FiltersComponents/SpecificationsFilterComponent.css
r436e0da r48f3030 18 18 .popover-specification-container{ 19 19 overflow-y: scroll; 20 height: 400px; 20 height: fit-content; 21 padding-bottom: 30px; 22 max-height: 400px; 23 21 24 } 22 25 -
phonelux-frontend/src/components/FiltersComponents/SpecificationsFilterComponent.js
r436e0da r48f3030 8 8 import FilterSelectComponent from './FilterSelectComponent'; 9 9 import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; 10 import PickSpecificationComponent from '../PickSpecificationComponent/PickSpecificationComponent'; 11 import axios from 'axios'; 12 import UserContext from '../../context/UserContext'; 10 13 export class SpecificationsFilterComponent extends Component { 11 14 … … 14 17 15 18 this.state = { 16 anchorEl: null 19 anchorEl: null, 20 openModal: false, 17 21 } 18 22 } … … 29 33 }) 30 34 }; 35 36 handleModalClose = () =>{ 37 this.setState({ 38 openModal: false 39 }) 40 } 41 42 handleModalOpen = () =>{ 43 this.setState({ 44 openModal: true 45 }) 46 } 31 47 32 48 render() { … … 53 69 <div className='popover-specification-container'> 54 70 <h2 className='popover-specification-container-header'>Филтер за спецификации</h2> 55 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='ram'></FilterSelectComponent> 56 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='rom'></FilterSelectComponent> 57 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='frontcamera'></FilterSelectComponent> 58 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='backcamera'></FilterSelectComponent> 59 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='chipset'></FilterSelectComponent> 60 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='cpu'></FilterSelectComponent> 61 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='operatingsystem'></FilterSelectComponent> 62 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='color'></FilterSelectComponent> 63 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='battery'></FilterSelectComponent> 71 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 72 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='ram'></FilterSelectComponent> : <></> 73 } 74 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 75 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='rom'></FilterSelectComponent> : <></> 76 } 77 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 78 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='frontcamera'></FilterSelectComponent> : <></> 79 } 80 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Задна камера") ? 81 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='backcamera'></FilterSelectComponent> : <></> 82 } 83 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 84 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='chipset'></FilterSelectComponent> : <></> 85 } 86 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 87 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='cpu'></FilterSelectComponent> : <></> 88 } 89 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 90 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='operatingsystem'></FilterSelectComponent> : <></> 91 } 92 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 93 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='color'></FilterSelectComponent> : <></> 94 } 95 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 96 <FilterSelectComponent changeHandler={this.props.changeHandler} width={400} type='battery'></FilterSelectComponent> : <></> 97 } 64 98 </div> 65 99 </Popover> 100 <Tippy className='tippy-pick-specifications-icon' placement='bottom' content='Изберете спецификации за приказ'> 101 <FilterAltIcon onClick={this.handleModalOpen} style={{fontSize: '35px'}} className='pick-specifications-icon'></FilterAltIcon> 102 </Tippy> 103 { this.context.userId != '' && <PickSpecificationComponent 104 openModal={this.state.openModal} 105 handleClose={this.handleModalClose}/> } 66 106 </div> 67 107 ) … … 69 109 } 70 110 111 SpecificationsFilterComponent.contextType = UserContext 112 71 113 export default SpecificationsFilterComponent 72 114 -
phonelux-frontend/src/components/HomepageComponent.js
r436e0da r48f3030 220 220 render() { 221 221 // console.log(this.context) 222 //console.log(localStorage.getItem('token'))222 console.log(localStorage.getItem('token')) 223 223 // console.log(this.state) 224 224 return ( -
phonelux-frontend/src/components/PhoneOfferComponent/PhoneOfferComponent.js
r436e0da r48f3030 121 121 } 122 122 })()} 123 {/* {124 localStorage.getItem('token') && !localStorage.getItem('offersToCompare').includes(this.props.id)?125 <Tippy placement='bottom' content='Додади понуда за споредба'>126 <CompareIcon onClick={this.handleOfferCompare} className='phone-offer-compare-icon' style={{fontSize: '40px', marginRight: '10px' }}/>127 </Tippy> : <></>128 } */}129 123 { 130 124 window.location.href.split('/')[5] == 'favouriteoffers' ? -
phonelux-frontend/src/components/PhoneOfferDetailsComponent/PhoneOfferDetailsComponent.js
r436e0da r48f3030 106 106 this.state.offer.price == null ? '/' : this.state.offer.price+' ден.'}</td> 107 107 </tr> 108 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Предна камера") ? 108 109 <tr className='phone-offer-details-table-row'> 109 110 <td>Предна камера</td><td>{this.state.offer == null || 110 111 this.state.offer.front_camera == null ? '/' : this.state.offer.front_camera}</td> 111 </tr> 112 </tr> : <></> 113 } 112 114 115 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Задна камера") ? 113 116 <tr className='phone-offer-details-table-row'> 114 117 <td>Задна камера</td><td>{this.state.offer == null || 115 118 this.state.offer.back_camera == null ? '/' : this.state.offer.back_camera}</td> 116 </tr> 119 </tr> : <></> 120 } 117 121 122 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РОМ меморија") ? 118 123 <tr className='phone-offer-details-table-row'> 119 124 <td>РОМ меморија</td><td>{this.state.offer == null || 120 125 this.state.offer.rom_memory == null ? '/' : this.state.offer.rom_memory}</td> 121 </tr> 126 </tr> : <></> 127 } 122 128 129 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("РАМ меморија") ? 123 130 <tr className='phone-offer-details-table-row'> 124 131 <td>РАМ меморија</td><td>{this.state.offer == null || 125 132 this.state.offer.ram_memory == null ? '/' : this.state.offer.ram_memory}</td> 126 </tr> 133 </tr> : <></> 134 } 127 135 136 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Оперативен систем") ? 128 137 <tr className='phone-offer-details-table-row'> 129 138 <td>Оперативен систем</td><td>{this.state.offer == null || 130 139 this.state.offer.operating_system == null ? '/' : this.state.offer.operating_system}</td> 131 </tr> 140 </tr> : <></> 141 } 132 142 143 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Чипсет") ? 133 144 <tr className='phone-offer-details-table-row'> 134 145 <td>Чипсет</td><td>{this.state.offer == null || 135 146 this.state.offer.chipset == null ? '/' : this.state.offer.chipset}</td> 136 </tr> 147 </tr> : <></> 148 } 137 149 150 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Процесор") ? 138 151 <tr className='phone-offer-details-table-row'> 139 152 <td>Процесор</td><td>{this.state.offer == null || 140 153 this.state.offer.cpu == null ? '/' : this.state.offer.cpu}</td> 141 </tr> 154 </tr> : <></> 155 } 142 156 157 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Батерија") ? 143 158 <tr className='phone-offer-details-table-row'> 144 159 <td>Батерија</td><td>{this.state.offer == null || 145 160 this.state.offer.battery == null ? '/' : this.state.offer.battery}</td> 146 </tr> 161 </tr> : <></> 162 } 147 163 164 { !localStorage.getItem('pickedSpecifications') || localStorage.getItem('pickedSpecifications').includes("Боја") ? 148 165 <tr className='phone-offer-details-table-row'> 149 166 <td>Боја</td><td>{this.state.offer == null || 150 167 this.state.offer.color == null ? '/' : this.state.offer.color}</td> 151 </tr> 168 </tr> : <></> 169 } 152 170 153 171 <tr className='phone-offer-details-table-row'> -
phonelux-frontend/src/components/PhonePageComponent.js
r436e0da r48f3030 1 1 import axios from 'axios' 2 2 import React, { Component } from 'react' 3 import UserContext from '../context/UserContext' 3 4 import HeaderComponent from './HeaderComponent/HeaderComponent' 4 5 import PhoneWithOffersComponent from './PhoneWithOffersComponent/PhoneWithOffersComponent' … … 34 35 } 35 36 } 36 37 37 export default PhonePageComponent -
phonelux-frontend/src/context/UserContext.js
r436e0da r48f3030 26 26 userId: id, 27 27 name: firstName, 28 role: userRole 28 role: userRole, 29 29 }) 30 30 }).catch(error => console.log(error)) 31 31 } 32 32 } 33 34 33 35 34 render() { … … 39 38 userId, 40 39 name, 41 role 40 role, 42 41 }}> 43 42 {this.props.children}
Note:
See TracChangeset
for help on using the changeset viewer.