diff options
author | Lucas Leite <lbl.lucasleite@gmail.com> | 2022-02-08 19:06:09 -0300 |
---|---|---|
committer | Lucas Leite <lbl.lucasleite@gmail.com> | 2022-02-08 19:06:09 -0300 |
commit | 110012324b5a58a48af1894b66b0068a444263db (patch) | |
tree | 261e25a5edc102fa31c19af1fe365ebb89cd8d34 /modern | |
parent | f35692eef0763fe853f3d88a18d6aefbbf5d0d2b (diff) | |
download | trackermap-web-110012324b5a58a48af1894b66b0068a444263db.tar.gz trackermap-web-110012324b5a58a48af1894b66b0068a444263db.tar.bz2 trackermap-web-110012324b5a58a48af1894b66b0068a444263db.zip |
Changed device list search
Diffstat (limited to 'modern')
-rw-r--r-- | modern/src/DevicesList.js | 2 | ||||
-rw-r--r-- | modern/src/MainPage.js | 12 | ||||
-rw-r--r-- | modern/src/store/devices.js | 1 |
3 files changed, 7 insertions, 8 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js index fdbdfcdf..10ac4fc7 100644 --- a/modern/src/DevicesList.js +++ b/modern/src/DevicesList.js @@ -137,7 +137,7 @@ const DeviceView = ({ updateTimestamp, onMenuClick, filter }) => { useEffect(() => { setFilteredItems( filter.trim().length > 0 - ? items.filter((item) => `${item.name} ${item.uniqueId} ${item.groupId}`.toLowerCase().includes(filter?.toLowerCase())) + ? items.filter((item) => `${item.name} ${item.uniqueId}`.toLowerCase().includes(filter?.toLowerCase())) : items, ); }, [filter, items]); diff --git a/modern/src/MainPage.js b/modern/src/MainPage.js index b20c1264..0176c7f0 100644 --- a/modern/src/MainPage.js +++ b/modern/src/MainPage.js @@ -98,7 +98,7 @@ const MainPage = () => { const isTablet = useMediaQuery(theme.breakpoints.down('md')); const isPhone = useMediaQuery(theme.breakpoints.down('xs')); - const [deviceName, setDeviceName] = useState(''); + const [searchKeyword, setSearchKeyword] = useState(''); const [collapsed, setCollapsed] = useState(false); const handleClose = () => { @@ -139,11 +139,11 @@ const MainPage = () => { )} <TextField fullWidth - name="deviceName" - value={deviceName} - autoComplete="deviceName" + name="searchKeyword" + value={searchKeyword} + autoComplete="searchKeyword" autoFocus - onChange={(event) => setDeviceName(event.target.value)} + onChange={(event) => setSearchKeyword(event.target.value)} placeholder="Search Devices" variant="filled" /> @@ -158,7 +158,7 @@ const MainPage = () => { </Toolbar> </Paper> <div className={classes.deviceList}> - <DevicesList filter={deviceName} /> + <DevicesList filter={searchKeyword} /> </div> </Paper> <BottomMenu /> diff --git a/modern/src/store/devices.js b/modern/src/store/devices.js index 52a002dc..cca23cb9 100644 --- a/modern/src/store/devices.js +++ b/modern/src/store/devices.js @@ -5,7 +5,6 @@ const { reducer, actions } = createSlice({ initialState: { items: {}, selectedId: null, - filteredItems: {}, }, reducers: { refresh(state, action) { |