CEC-244 Remote car commands, search, sortable tables (#42)

* Add sortable table header

* Send bulk commands page
Update table page sizes
All tables are sortable

* Update site layout
Add search to update packages

* Reenable Datadog

* remove dev stuff
This commit is contained in:
John Wu
2021-05-26 15:46:46 -07:00
committed by GitHub
parent 64995ef7a6
commit 931e1521e8
29 changed files with 1886 additions and 1541 deletions

View File

@@ -0,0 +1,49 @@
import React, { useState } from "react";
import {
FormControl,
IconButton,
Input,
InputAdornment,
InputLabel,
} from "@material-ui/core";
import SearchIcon from "@material-ui/icons/Search";
import clsx from "clsx";
const SearchField = (props) => {
const { classes, onSearch } = props;
const [searchTerm, setSearchTerm] = useState("");
const handleChange = (e) => {
setSearchTerm(e.target.value);
};
const handleSearch = (e) => {
if (!onSearch) return;
onSearch(searchTerm);
};
const handleEnterPress = (e) => {
if (e.keyCode !== 13) return;
e.preventDefault();
handleSearch(e);
};
return (
<FormControl className={clsx(classes.margin, classes.textField)}>
<InputLabel htmlFor="search">Search</InputLabel>
<Input
id="search"
type="text"
value={searchTerm}
onChange={handleChange}
onKeyDown={handleEnterPress}
endAdornment={
<InputAdornment position="end">
<IconButton aria-label="search" onClick={handleSearch}>
<SearchIcon />
</IconButton>
</InputAdornment>
}
/>
</FormControl>
);
};
export default SearchField;