Fakultas Ilmu Komputer UI

Commit cc03fa0c authored by Wan Muhammad Rayhan Arwindra's avatar Wan Muhammad Rayhan Arwindra 🤸🏽
Browse files

Revert "Merge branch 'PBI-6-Ray' into 'master'"

This reverts commit 0a5a7921, reversing
changes made to 980c3fbe.
parent dd558d18
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,6 +41,7 @@ const TableComponent = ({
link,
argument,
filter,
sort,
}) => {
const [
results,
......@@ -59,7 +60,26 @@ const TableComponent = ({
handleSubmit: handleSubmitFilter,
reset: resetFilter,
} = useForm();
const getCategory = (c) => {
switch (c){
case "transaksi":
return "total_transactions"
case "donasi-barang":
return "total_program_donations_goods"
case "donasi-uang":
return "total_program_donations_cash"
}
}
const sortResults = (s) => {
const category = getCategory(s);
results.sort((a, b) => b[category] - a[category]);
}
const [filterTab, setFilterTab] = useState(false);
if (sort !== "" && sort !== null){
sortResults(sort);
}
return (
<div
css={css`
......
......@@ -25,10 +25,11 @@ const ListPengguna = () => {
["full_name", "Nama Lengkap"],
["username", "Username"],
["total_transactions", "Jumlah Transaksi"],
["total_program_donations", "Jumlah Donasi"],
["total_program_donations_goods", "Jumlah Donasi Barang"],
["total_program_donations_cash", "Jumlah Donasi Uang"],
],
link: "",
sort: sortBy
sort: sortBy,
};
const handleClickOpen = () => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment