diff options
author | Anton Tananaev <anton@traccar.org> | 2023-01-30 09:22:18 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-01-30 09:22:18 -0800 |
commit | ea34943121cab989e5ced540139c4fd39527cbde (patch) | |
tree | ec583de0c793784efde358c76b907ce15d068b1a /modern/src/reports | |
parent | a8b6bf4f917ed1a453585eb51445e28bdc107d11 (diff) | |
download | trackermap-web-ea34943121cab989e5ced540139c4fd39527cbde.tar.gz trackermap-web-ea34943121cab989e5ced540139c4fd39527cbde.tar.bz2 trackermap-web-ea34943121cab989e5ced540139c4fd39527cbde.zip |
Reports split button
Diffstat (limited to 'modern/src/reports')
-rw-r--r-- | modern/src/reports/components/ReportFilter.js | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js index 804d0d4b..67ea3d2f 100644 --- a/modern/src/reports/components/ReportFilter.js +++ b/modern/src/reports/components/ReportFilter.js @@ -7,6 +7,7 @@ import moment from 'moment'; import { useTranslation } from '../../common/components/LocalizationProvider'; import useReportStyles from '../common/useReportStyles'; import { reportsActions } from '../../store'; +import SplitButton from '../../common/components/SplitButton'; const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDevice, includeGroups }) => { const classes = useReportStyles(); @@ -148,37 +149,30 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev </div> )} {children} - <div className={classes.filterButtons}> - <Button - onClick={() => handleClick('json')} - variant="outlined" - color="secondary" - className={classes.filterButton} - disabled={disabled} - > - {t('reportShow')} - </Button> - {!showOnly && ( + <div className={classes.filterItem}> + {showOnly ? ( <Button - onClick={() => handleClick('export')} + fullWidth variant="outlined" color="secondary" - className={classes.filterButton} disabled={disabled} + onClick={() => handleClick('json')} > - {t('reportExport')} + <Typography variant="button" noWrap>{t('reportShow')}</Typography> </Button> - )} - {!showOnly && ( - <Button - onClick={() => handleClick('mail')} + ) : ( + <SplitButton + fullWidth variant="outlined" color="secondary" - className={classes.filterButton} disabled={disabled} - > - <Typography variant="button" noWrap>{t('reportEmail')}</Typography> - </Button> + onClick={handleClick} + options={{ + json: t('reportShow'), + export: t('reportExport'), + mail: t('reportEmail'), + }} + /> )} </div> </div> |