瀏覽代碼

Update Equipment Page

master
B.E.N.S.O.N 3 週之前
父節點
當前提交
1dd0586776
共有 3 個文件被更改,包括 1 次插入9 次删除
  1. +0
    -1
      src/components/EquipmentSearch/EquipmentSearchLoading.tsx
  2. +1
    -7
      src/components/EquipmentSearch/EquipmentSearchResults.tsx
  3. +0
    -1
      src/components/EquipmentTypeSearch/EquipmentTypeSearchLoading.tsx

+ 0
- 1
src/components/EquipmentSearch/EquipmentSearchLoading.tsx 查看文件

@@ -6,7 +6,6 @@ import Skeleton from "@mui/material/Skeleton";
import Stack from "@mui/material/Stack";
import React from "react";

// Can make this nicer
export const EquipmentTypeSearchLoading: React.FC = () => {
return (
<>


+ 1
- 7
src/components/EquipmentSearch/EquipmentSearchResults.tsx 查看文件

@@ -139,7 +139,6 @@ function isCheckboxColumn<T extends ResultWithId>(
return column.type === "checkbox";
}

// Icon Component Functions
function convertObjectKeysToLowercase<T extends object>(
obj: T,
): object | undefined {
@@ -207,7 +206,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
/// this
const handleChangePage: TablePaginationProps["onPageChange"] = (
_event,
newPage,
@@ -238,7 +236,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
}
};

// checkbox
const currItems = useMemo(() => {
return items.length > 10 ? items
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
@@ -254,7 +251,6 @@ function EquipmentSearchResults<T extends ResultWithId>({

const handleRowClick = useCallback(
(event: MouseEvent<unknown>, item: T, columns: Column<T>[]) => {
// check is disabled or not
let disabled = false;
columns.forEach((col) => {
if (isCheckboxColumn(col) && col.disabled) {
@@ -269,7 +265,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
return;
}

// set id
const id = item.id;
if (setCheckboxIds) {
const selectedIndex = checkboxIds.indexOf(id);
@@ -335,7 +330,7 @@ function EquipmentSearchResults<T extends ResultWithId>({
column.renderHeader()
) : (
column.label.split('\n').map((line, index) => (
<div key={index}>{line}</div> // Render each line in a div
<div key={index}>{line}</div>
))
)}
</TableCell>
@@ -442,7 +437,6 @@ function EquipmentSearchResults<T extends ResultWithId>({
return noWrapper ? table : <Paper sx={{ overflow: "hidden" }}>{table}</Paper>;
}

// Table cells
interface TableCellsProps<T extends ResultWithId> {
column: Column<T>;
columnName: keyof T;


+ 0
- 1
src/components/EquipmentTypeSearch/EquipmentTypeSearchLoading.tsx 查看文件

@@ -4,7 +4,6 @@ import Skeleton from "@mui/material/Skeleton";
import Stack from "@mui/material/Stack";
import React from "react";

// Can make this nicer
export const EquipmentTypeSearchLoading: React.FC = () => {
return (
<>


Loading…
取消
儲存