From 64eab17924e39a8dc01270aa3ab47c546d9da060 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Fri, 12 Jan 2024 17:24:13 -0600 Subject: [PATCH] more --- src/Components/Document/DocumentListPage.js | 199 ++++++++++---------- 1 file changed, 103 insertions(+), 96 deletions(-) diff --git a/src/Components/Document/DocumentListPage.js b/src/Components/Document/DocumentListPage.js index c050b88..4797e29 100644 --- a/src/Components/Document/DocumentListPage.js +++ b/src/Components/Document/DocumentListPage.js @@ -4,6 +4,7 @@ import { AppContext } from "../../Hooks/useContext/appContext"; import SelectDropdown from "../../pageElements/SelectDropdown"; import { DocCard } from "../../pageElements/Cards"; import { db } from "../../firebase"; +import MobileContent from "../MobileContent"; import { collection, deleteDoc, @@ -18,6 +19,8 @@ import ConfirmModal from "../Modals/ConfirmModal"; import "../../styles/doclist-page.scss"; const DocumentListPage = ({ perPage }) => { + const size = window.innerWidth < 440; + const [isMobile, setIsMobile] = useState(size); const navigate = useNavigate(); const [showDeleteModal, setShowDeleteModal] = useState(false); const [selectedDocumentId, setSelectedDocumentId] = useState(null); @@ -164,103 +167,107 @@ const DocumentListPage = ({ perPage }) => { if (!group) { return null; } - console.log("allDocs", allDocs); - return ( - <> -
-

Documents

-
{group.firm}
-
- {allDocs === null ?
Loading...
: null} - {allDocs !== null ? ( -
- {allDocs.length > 0 ? ( -
- -
- ) : ( - <> - )} -
- {allDocs.length > 0 ? ( - allDocs - .slice((page - 1) * perPage, page * perPage) - .map((doc, i) => ( - - )) - ) : ( -
-

- {" "} - You have not uploaded any documents yet. -

-

To upload a document:

-
    -
  1. - Navigate to the cases view (above link in navigation bar).{" "} -
  2. -
  3. - {" "} - Click "View Case" to select the case with which your - document will be associated. This will open the Case Detail - view.{" "} -
  4. -
  5. - Note: If you have not yet created any cases, you will need - to create one first - click "Create Case" and follow the - prompts. -
  6. -
  7. - In the case detail view, click "Upload Case Document" and - select a document from your computer for upload. -
  8. -
  9. - Your document will be parsed into a processable form. You - will then be able to generate a response to the document. -
  10. -
-
- )} -
- {totalPages > 1 ? ( -
- -
- ) : null} + + const DesktopContent = () => { + return ( + <> +
+

Documents

+
{group.firm}
- ) : null} - {showDeleteModal && selectedDocumentId !== null ? ( - - ) : null} - - ); + {allDocs === null ?
Loading...
: null} + {allDocs !== null ? ( +
+ {allDocs.length > 0 ? ( +
+ +
+ ) : ( + <> + )} +
+ {allDocs.length > 0 ? ( + allDocs + .slice((page - 1) * perPage, page * perPage) + .map((doc, i) => ( + + )) + ) : ( +
+

+ {" "} + You have not uploaded any documents yet. +

+

To upload a document:

+
    +
  1. + Navigate to the cases view (above link in navigation bar).{" "} +
  2. +
  3. + {" "} + Click "View Case" to select the case with which your + document will be associated. This will open the Case + Detail view.{" "} +
  4. +
  5. + Note: If you have not yet created any cases, you will need + to create one first - click "Create Case" and follow the + prompts. +
  6. +
  7. + In the case detail view, click "Upload Case Document" and + select a document from your computer for upload. +
  8. +
  9. + Your document will be parsed into a processable form. You + will then be able to generate a response to the document. +
  10. +
+
+ )} +
+ {totalPages > 1 ? ( +
+ +
+ ) : null} +
+ ) : null} + {showDeleteModal && selectedDocumentId !== null ? ( + + ) : null} + + ); + }; + + return isMobile ? : ; }; export default DocumentListPage;