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