source: phonelux-frontend/src/components/FiltersComponents/SearchFieldComponent.js@ 7e88e46

Last change on this file since 7e88e46 was 7e88e46, checked in by Marko <Marko@…>, 22 months ago

Added more components

  • Property mode set to 100644
File size: 2.6 KB
Line 
1import React, { Component } from 'react'
2import { styled, alpha } from '@mui/material/styles';
3import "./SearchFieldComponent.css"
4import AppBar from '@mui/material/AppBar';
5import Box from '@mui/material/Box';
6import Toolbar from '@mui/material/Toolbar';
7import IconButton from '@mui/material/IconButton';
8import Typography from '@mui/material/Typography';
9import Badge from '@mui/material/Badge';
10import MenuItem from '@mui/material/MenuItem';
11import Menu from '@mui/material/Menu';
12import MenuIcon from '@mui/icons-material/Menu';
13import InputBase from '@mui/material/InputBase';
14import SearchIcon from '@mui/icons-material/Search';
15import AccountCircle from '@mui/icons-material/AccountCircle';
16import MailIcon from '@mui/icons-material/Mail';
17import NotificationsIcon from '@mui/icons-material/Notifications';
18import MoreIcon from '@mui/icons-material/MoreVert';
19
20const Search = styled('div')(({ theme }) => ({
21 position: 'relative',
22 borderRadius: theme.shape.borderRadius,
23 backgroundColor: alpha(theme.palette.common.white, 0.15),
24 '&:hover': {
25 backgroundColor: alpha(theme.palette.common.white, 0.25),
26 },
27 marginRight: theme.spacing(2),
28 marginLeft: 0,
29 width: '100%',
30 [theme.breakpoints.up('sm')]: {
31 marginLeft: theme.spacing(3),
32 width: 'auto',
33 },
34 }));
35
36 const SearchIconWrapper = styled('div')(({ theme }) => ({
37 padding: theme.spacing(0, 2),
38 height: '100%',
39 position: 'absolute',
40 pointerEvents: 'none',
41 display: 'flex',
42 alignItems: 'center',
43 justifyContent: 'center',
44 }));
45
46 const StyledInputBase = styled(InputBase)(({ theme }) => ({
47 color: 'inherit',
48 '& .MuiInputBase-input': {
49 padding: theme.spacing(1, 1, 1, 0),
50 // vertical padding + font size from searchIcon
51 paddingLeft: `calc(1em + ${theme.spacing(4)})`,
52 transition: theme.transitions.create('width'),
53 width: '100%',
54 [theme.breakpoints.up('md')]: {
55 width: '20ch',
56 },
57 },
58 }));
59
60export default class SearchFieldComponent extends Component {
61 constructor(props) {
62 super(props)
63
64 this.state = {
65
66 }
67 }
68
69 handleChange = (event) => {
70 this.props.changeHandler({searchValue: event.target.value})
71 }
72
73 render() {
74 return (
75 <Search onChange={this.handleChange} className="search-phone-field">
76 <SearchIconWrapper id="iconwrapper">
77 <SearchIcon />
78 </SearchIconWrapper>
79 <StyledInputBase
80 className="search-phone-input"
81 placeholder="Пребарувај…"
82 inputProps={{ 'aria-label': 'search' }}
83 />
84 </Search>
85 )
86 }
87}
Note: See TracBrowser for help on using the repository browser.