more
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
useRef,
|
||||
useFocusEffect,
|
||||
useCallback,
|
||||
} from "react";
|
||||
import { useContext, useEffect, useState, useRef, useCallback } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { AppContext } from "../../Hooks/useContext/appContext";
|
||||
import SelectDropdown from "../../pageElements/SelectDropdown";
|
||||
@@ -23,7 +16,6 @@ import {
|
||||
} from "firebase/firestore";
|
||||
import ListPagination from "../../pageElements/ListPagination";
|
||||
import ConfirmModal from "../Modals/ConfirmModal";
|
||||
import Toggle from "../../pageElements/Toggle";
|
||||
import "../../styles/doclist-page.scss";
|
||||
|
||||
const DocumentListPage = ({ perPage }) => {
|
||||
@@ -40,7 +32,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
const { group } = appState;
|
||||
const [page, setPage] = useState(1);
|
||||
const [order, setOrder] = useState("parentCaseName");
|
||||
// const [order, setOrder] = useState("parentCaseName");
|
||||
const [lowerOrder, setLowerOrder] = useState("parentCaseName");
|
||||
const [upperOrder, setUpperOrder] = useState("parentCaseName");
|
||||
const appUserId = group ? group.appUserId : null;
|
||||
@@ -48,6 +40,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
const [selectedDocumentType, setSelectedDocumentType] = useState();
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
const [verbValue, setVerbValue] = useState(1);
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "development"
|
||||
? process.env.REACT_APP_API_DEV
|
||||
@@ -99,7 +92,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
return unsub;
|
||||
}
|
||||
|
||||
useEffect(getDocuments, [appUserId, order, respDocs, reqDocs]);
|
||||
useEffect(getDocuments, [appUserId, respDocs, reqDocs]);
|
||||
|
||||
async function deleteFromDb(documentId) {
|
||||
if (isBusy) {
|
||||
@@ -138,13 +131,18 @@ const DocumentListPage = ({ perPage }) => {
|
||||
}
|
||||
}
|
||||
|
||||
const dropDownOptions = [
|
||||
const upperDropDownOptions = [
|
||||
{ label: "Associated case name a - z", value: "parentCaseName" },
|
||||
{ label: "Associated case name z - a", value: "parentCaseName2" },
|
||||
];
|
||||
|
||||
const handleNovos = (e) => {
|
||||
navigate("/how-to");
|
||||
const lowerDropDownOptions = [
|
||||
{ label: "Associated case name a - z", value: "parentCaseName" },
|
||||
{ label: "Associated case name z - a", value: "parentCaseName2" },
|
||||
];
|
||||
|
||||
const handleUpperSort = () => {
|
||||
console.log("handleUpperSort");
|
||||
};
|
||||
|
||||
function handleNavigate(
|
||||
@@ -203,7 +201,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
<div className="list-upper-right">
|
||||
<div className="d-flex justify-content-end mb-3">
|
||||
<SelectDropdown
|
||||
dropDownOptions={dropDownOptions}
|
||||
dropDownOptions={upperDropDownOptions}
|
||||
titleText="Sort documents"
|
||||
handleSelect={setUpperOrder}
|
||||
/>
|
||||
@@ -244,7 +242,7 @@ const DocumentListPage = ({ perPage }) => {
|
||||
<div className="list-upper-right">
|
||||
<div className="d-flex justify-content-end mb-3">
|
||||
<SelectDropdown
|
||||
dropDownOptions={dropDownOptions}
|
||||
dropDownOptions={lowerDropDownOptions}
|
||||
titleText="Sort documents"
|
||||
handleSelect={setLowerOrder}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user