From fa83492234ba77ae3599ce67217c25122d19f361 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 26 May 2022 17:35:55 -0700 Subject: Revert "Collapse filter on mobile" This reverts commit aab97ae5551995f940abb302d33f882b1a13a3fc. --- modern/src/common/components/PageLayout.js | 1 - modern/src/reports/components/ReportFilter.js | 151 +++++++++++--------------- 2 files changed, 62 insertions(+), 90 deletions(-) diff --git a/modern/src/common/components/PageLayout.js b/modern/src/common/components/PageLayout.js index 10ee8a11..43fd68ea 100644 --- a/modern/src/common/components/PageLayout.js +++ b/modern/src/common/components/PageLayout.js @@ -42,7 +42,6 @@ const useStyles = makeStyles((theme) => ({ alignItems: 'stretch', display: 'flex', flexDirection: 'column', - overflow: 'auto', }, })); diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js index ccaaf1a6..586ccc37 100644 --- a/modern/src/reports/components/ReportFilter.js +++ b/modern/src/reports/components/ReportFilter.js @@ -1,14 +1,12 @@ import React, { useState } from 'react'; import { - FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, useMediaQuery, + FormControl, InputLabel, Select, MenuItem, Button, TextField, Typography, } from '@mui/material'; -import OpenInFullIcon from '@mui/icons-material/OpenInFull'; import makeStyles from '@mui/styles/makeStyles'; import { useSelector } from 'react-redux'; import moment from 'moment'; import { useTranslation } from '../../common/components/LocalizationProvider'; import dimensions from '../../common/theme/dimensions'; -import { useTheme } from '@mui/styles'; export const useFilterStyles = makeStyles((theme) => ({ filter: { @@ -34,12 +32,9 @@ export const useFilterStyles = makeStyles((theme) => ({ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, }) => { - const theme = useTheme(); const classes = useFilterStyles(); const t = useTranslation(); - const phone = useMediaQuery(theme.breakpoints.down('sm')); - const devices = useSelector((state) => state.devices.items); const selectedDeviceId = useSelector((state) => state.devices.selectedId); @@ -48,8 +43,6 @@ const ReportFilter = ({ const [from, setFrom] = useState(moment().subtract(1, 'hour')); const [to, setTo] = useState(moment()); - const [collapsed, setCollapsed] = useState(false); - const handleClick = (mail, json) => { let selectedFrom; let selectedTo; @@ -92,67 +85,59 @@ const ReportFilter = ({ mail, { Accept: accept }, ); - - if (phone) { - setCollapsed(true); - } }; return (
- {!collapsed && ( - <> - {!ignoreDevice && ( -
- - {t('reportDevice')} - - -
- )} -
- - {t('reportPeriod')} - - -
- {period === 'custom' && ( - <> -
- setFrom(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))} - fullWidth - /> -
-
- setTo(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))} - fullWidth - /> -
- - )} - {children} - + {!ignoreDevice && ( +
+ + {t('reportDevice')} + + +
+ )} +
+ + {t('reportPeriod')} + + +
+ {period === 'custom' && ( +
+ setFrom(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))} + fullWidth + /> +
+ )} + {period === 'custom' && ( +
+ setTo(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))} + fullWidth + /> +
)} + {children}
- {collapsed && ( + {!showOnly && ( )} - {!showOnly && !collapsed && ( - <> - - - + {!showOnly && ( + )}
-- cgit v1.2.3