From f20cb5b44c7119b1d1783c5f5de68d4ce1373d3a Mon Sep 17 00:00:00 2001 From: Muhammad Fajar Date: Wed, 7 Dec 2022 03:10:02 +0700 Subject: [PATCH] fix table dashboard --- .../src/sections/dashboard/TableList.tsx | 131 ++++++++---------- 1 file changed, 57 insertions(+), 74 deletions(-) diff --git a/frontend/client-portal/src/sections/dashboard/TableList.tsx b/frontend/client-portal/src/sections/dashboard/TableList.tsx index 6364a6b1..4073d089 100755 --- a/frontend/client-portal/src/sections/dashboard/TableList.tsx +++ b/frontend/client-portal/src/sections/dashboard/TableList.tsx @@ -30,7 +30,6 @@ import palette from '../../theme/palette'; import { useSearchParams } from 'react-router-dom'; /* ---------------------------------- types --------------------------------- */ - type PaginationTableProps = { current_page: number; from: number; @@ -64,11 +63,9 @@ interface EnhancedTableProps { order: Order; orderBy: string; } - /* -------------------------------------------------------------------------- */ /* -------------------------- enchanced table head -------------------------- */ - const headCells: readonly HeadCell[] = [ { id: 'member_id', @@ -141,7 +138,6 @@ function EnhancedTableHead({ order, orderBy, onRequestSort }: EnhancedTableProps ); } - /* -------------------------------------------------------------------------- */ export default function TableList() { @@ -180,7 +176,6 @@ export default function TableList() { /* -------------------------------------------------------------------------- */ /* ----------------------------- Field Container ---------------------------- */ - /* ----------------------------- division field ----------------------------- */ const optionDivisions = ['All']; @@ -190,10 +185,6 @@ export default function TableList() { /* ------------------------------ Search field ------------------------------ */ const [searchText, setSearchText] = useState(''); - const handleSearch = (event: React.ChangeEvent) => { - setSearchText(event.target.value); - }; - const handleSearchSubmit = async (event: React.FormEvent) => { event.preventDefault(); setIsLoading(true); @@ -223,72 +214,9 @@ export default function TableList() { setAnchorEl(event.currentTarget); }; /* -------------------------------------------------------------------------- */ - - const FieldContainer = () => ( - - - { - console.log(newValue); - setValue(newValue); - }} - renderInput={(params) => } - /> - - -
- - -
- - - - - - -
- ); - /* -------------------------------------------------------------------------- */ /* ---------------------------- table pagination ---------------------------- */ - /* ------------------------ button change pagination ------------------------ */ const onPageChangeHandle = async ( event: React.MouseEvent | null, @@ -318,7 +246,6 @@ export default function TableList() { setIsLoading(false); }; /* -------------------------------------------------------------------------- */ - /* -------------------------------------------------------------------------- */ useEffect(() => { @@ -354,7 +281,63 @@ export default function TableList() { {/* Field 1 */} - + + + { + setValue(newValue); + }} + renderInput={(params) => } + /> + + +
+ setSearchText(event.target.value)} + value={searchText} + fullWidth + /> + +
+ + + + + + +
{/* End Field 1 */} {/* Field 2 */}