From 110012324b5a58a48af1894b66b0068a444263db Mon Sep 17 00:00:00 2001 From: Lucas Leite Date: Tue, 8 Feb 2022 19:06:09 -0300 Subject: Changed device list search --- modern/src/DevicesList.js | 2 +- modern/src/MainPage.js | 12 ++++++------ 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 = () => { )} setDeviceName(event.target.value)} + onChange={(event) => setSearchKeyword(event.target.value)} placeholder="Search Devices" variant="filled" /> @@ -158,7 +158,7 @@ const MainPage = () => {
- +
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) { -- cgit v1.2.3