diff options
author | Lucas Leite <lbl.lucasleite@gmail.com> | 2022-02-08 15:35:04 -0300 |
---|---|---|
committer | Lucas Leite <lbl.lucasleite@gmail.com> | 2022-02-08 15:35:04 -0300 |
commit | 784a2e8194c08349293a7bae9a3b96473301dd01 (patch) | |
tree | 9ac0444729f542b2adbdd5f2fdd957e457db9cda /modern/src/MainPage.js | |
parent | 227971b2d28c8005ebf2ea3b8a135687a8ae0a17 (diff) | |
download | trackermap-web-784a2e8194c08349293a7bae9a3b96473301dd01.tar.gz trackermap-web-784a2e8194c08349293a7bae9a3b96473301dd01.tar.bz2 trackermap-web-784a2e8194c08349293a7bae9a3b96473301dd01.zip |
Update devices list search
Diffstat (limited to 'modern/src/MainPage.js')
-rw-r--r-- | modern/src/MainPage.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modern/src/MainPage.js b/modern/src/MainPage.js index 7fd43154..4a266328 100644 --- a/modern/src/MainPage.js +++ b/modern/src/MainPage.js @@ -1,4 +1,5 @@ import React, { useState, useEffect } from 'react'; +import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { makeStyles, Paper, Toolbar, TextField, IconButton, Button, @@ -22,6 +23,7 @@ import BottomMenu from './components/BottomMenu'; import { useTranslation } from './LocalizationProvider'; import PoiMap from './map/PoiMap'; import MapPadding from './map/MapPadding'; +import { devicesActions } from './store'; const useStyles = makeStyles((theme) => ({ root: { @@ -93,6 +95,7 @@ const MainPage = () => { const classes = useStyles(); const history = useHistory(); const theme = useTheme(); + const dispatch = useDispatch(); const t = useTranslation(); const isTablet = useMediaQuery(theme.breakpoints.down('md')); @@ -105,6 +108,8 @@ const MainPage = () => { setCollapsed(!collapsed); }; + useEffect(() => dispatch(devicesActions.filterByName(deviceName.trim())), [deviceName]); + useEffect(() => setCollapsed(isTablet), [isTablet]); return ( |