doing some more mobile views to load more
This commit is contained in:
parent
3368a9112f
commit
fde0eb731c
8 changed files with 68 additions and 37 deletions
|
|
@ -12,6 +12,7 @@ import AddGateFab from "./AddGateFab";
|
|||
import GateSettings from "./GateSettings";
|
||||
import { useGateAPI, useGlobalState } from "providers";
|
||||
import { Settings } from "@mui/icons-material";
|
||||
import { cloneDeep } from "lodash";
|
||||
|
||||
interface Props {
|
||||
//gates: Gate[];
|
||||
|
|
@ -219,6 +220,19 @@ export default function GateList(props: Props) {
|
|||
onRowClick={(gate) => {goToGate(gate)}}
|
||||
hideKeys={isMobile || props.useMobile}
|
||||
setSearchText={(search) => setSearch(search)}
|
||||
loadMore={()=>{
|
||||
let current = cloneDeep(gates)
|
||||
let keys = undefined
|
||||
let types = undefined
|
||||
if(currentTerminal) {
|
||||
keys = [currentTerminal]
|
||||
types = ["terminal"]
|
||||
}
|
||||
gateAPI.listGates(pageSize, current.length , "asc", "name", search, undefined, keys, types, undefined, undefined, as).then(resp => {
|
||||
let newGates = resp.data.gates.map(gate => Gate.create(gate))
|
||||
setGates(current.concat(newGates))
|
||||
})
|
||||
}}
|
||||
/>
|
||||
)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue