aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/CalendarsPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-08-28 15:14:33 -0700
committerAnton Tananaev <anton@traccar.org>2022-08-28 15:14:33 -0700
commit4e61ae214d7c9c54851261734837521f2f77b4e5 (patch)
tree403a25bed46b2645a17fef4d09a139bf6426068b /modern/src/settings/CalendarsPage.js
parentcd7c15987c08a875386e860a11f6533423709bc2 (diff)
downloadtrackermap-web-4e61ae214d7c9c54851261734837521f2f77b4e5.tar.gz
trackermap-web-4e61ae214d7c9c54851261734837521f2f77b4e5.tar.bz2
trackermap-web-4e61ae214d7c9c54851261734837521f2f77b4e5.zip
Mobile setting search
Diffstat (limited to 'modern/src/settings/CalendarsPage.js')
-rw-r--r--modern/src/settings/CalendarsPage.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/settings/CalendarsPage.js b/modern/src/settings/CalendarsPage.js
index 2602f702..c418cff2 100644
--- a/modern/src/settings/CalendarsPage.js
+++ b/modern/src/settings/CalendarsPage.js
@@ -10,6 +10,7 @@ import SettingsMenu from './components/SettingsMenu';
import CollectionFab from './components/CollectionFab';
import CollectionActions from './components/CollectionActions';
import TableShimmer from '../common/components/TableShimmer';
+import SearchHeader, { filterByKeyword } from './components/SearchHeader';
const useStyles = makeStyles((theme) => ({
columnAction: {
@@ -24,6 +25,7 @@ const CalendarsPage = () => {
const [timestamp, setTimestamp] = useState(Date.now());
const [items, setItems] = useState([]);
+ const [searchKeyword, setSearchKeyword] = useState('');
const [loading, setLoading] = useState(false);
useEffectAsync(async () => {
@@ -42,6 +44,7 @@ const CalendarsPage = () => {
return (
<PageLayout menu={<SettingsMenu />} breadcrumbs={['settingsTitle', 'sharedCalendars']}>
+ <SearchHeader keyword={searchKeyword} setKeyword={setSearchKeyword} />
<Table>
<TableHead>
<TableRow>
@@ -50,7 +53,7 @@ const CalendarsPage = () => {
</TableRow>
</TableHead>
<TableBody>
- {!loading ? items.map((item) => (
+ {!loading ? items.filter(filterByKeyword(searchKeyword)).map((item) => (
<TableRow key={item.id}>
<TableCell>{item.name}</TableCell>
<TableCell className={classes.columnAction} padding="none">