[d66b8eb] | 1 | import React, { Component } from 'react'
|
---|
| 2 | import './SpecificationsFilterComponent.css'
|
---|
| 3 | import FilterAltIcon from '@mui/icons-material/FilterAlt';
|
---|
| 4 | import Tippy from '@tippyjs/react';
|
---|
| 5 | import Popover from '@mui/material/Popover';
|
---|
| 6 | import Typography from '@mui/material/Typography';
|
---|
| 7 | import Button from '@mui/material/Button';
|
---|
| 8 | import FilterSelectComponent from './FilterSelectComponent';
|
---|
| 9 | import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
---|
| 10 | export class SpecificationsFilterComponent extends Component {
|
---|
| 11 |
|
---|
| 12 | constructor(props) {
|
---|
| 13 | super(props)
|
---|
| 14 |
|
---|
| 15 | this.state = {
|
---|
| 16 | anchorEl: null
|
---|
| 17 | }
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | handleClick = (event) => {
|
---|
| 21 | this.setState({
|
---|
| 22 | anchorEl: event.currentTarget
|
---|
| 23 | })
|
---|
| 24 | };
|
---|
| 25 |
|
---|
| 26 | handleClose = () => {
|
---|
| 27 | this.setState({
|
---|
| 28 | anchorEl: null
|
---|
| 29 | })
|
---|
| 30 | };
|
---|
| 31 |
|
---|
| 32 | render() {
|
---|
| 33 |
|
---|
| 34 | const open = Boolean(this.state.anchorEl);
|
---|
| 35 | const id = open ? 'specifications-popover' : undefined;
|
---|
| 36 |
|
---|
| 37 | return (
|
---|
| 38 | <div className='specifications-filter-main'>
|
---|
| 39 | <h4 aria-describedby={id} className='specifications-filter-header' onClick={this.handleClick}>Спецификации
|
---|
| 40 | <ArrowDropDownIcon style={{marginTop:'-2px'}}/>
|
---|
| 41 | </h4>
|
---|
| 42 | <Popover
|
---|
| 43 | className='specifications-filter-popover'
|
---|
| 44 | id={id}
|
---|
| 45 | open={open}
|
---|
| 46 | anchorEl={this.state.anchorEl}
|
---|
| 47 | onClose={this.handleClose}
|
---|
| 48 | anchorOrigin={{
|
---|
| 49 | vertical: 'center',
|
---|
| 50 | horizontal: 'right',
|
---|
| 51 | }}
|
---|
| 52 | >
|
---|
| 53 | <div className='popover-specification-container'>
|
---|
| 54 | <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>
|
---|
| 64 | </div>
|
---|
| 65 | </Popover>
|
---|
| 66 | </div>
|
---|
| 67 | )
|
---|
| 68 | }
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | export default SpecificationsFilterComponent
|
---|
| 72 |
|
---|