CEC-2152 Add persistent page size for tables (#175)
* Add persistent page size * Add permissions for sms as well Co-authored-by: jwu-fisker <jwu@fiskerinc.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import TableHeaderSortable from "../../Table/HeaderSortable";
|
||||
import { useVehicleContext } from "../../Contexts/VehicleContext";
|
||||
import { useStatusContext } from "../../Contexts/StatusContext";
|
||||
import { logger } from "../../../services/monitoring";
|
||||
import {useLocalStorage} from "../../useLocalStorage";
|
||||
|
||||
const tableColumns = [
|
||||
{
|
||||
@@ -42,10 +43,12 @@ const tableColumns = [
|
||||
},
|
||||
];
|
||||
|
||||
const PAGE_SIZE = "CAR_ECUS_TABLE_PAGE_SIZE";
|
||||
|
||||
const CarECUsTable = ({ vin, token, classes }) => {
|
||||
const [ecus, setECUs] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [pageSize, setPageSize] = useLocalStorage(PAGE_SIZE, 10);
|
||||
const [pageIndex, setPageIndex] = useState(0);
|
||||
const [orderBy, setOrderBy] = useState("ecu");
|
||||
const [order, setOrder] = useState("desc");
|
||||
|
||||
Reference in New Issue
Block a user