Changeset 48f3030 for phonelux-frontend/src/components/FiltersComponents
- Timestamp:
- 09/23/22 02:03:14 (2 years ago)
- Branches:
- master
- Children:
- 895cd87
- Parents:
- 436e0da
- Location:
- phonelux-frontend/src/components/FiltersComponents
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.