BOD-24 WIP for document previews for non images. Random cleanup included. #comment Current design for document previews may be bandwidth intensive. Proceeding with design to get v1 completed.

This commit is contained in:
Patrick Fic
2020-03-17 16:50:21 -07:00
parent 5f7284d3a0
commit ec53663a1d
32 changed files with 491 additions and 384 deletions

View File

@@ -0,0 +1,18 @@
import React from "react";
import { useQuery } from "react-apollo";
import { GET_DOCUMENTS_BY_JOB } from "../../graphql/documents.queries";
import AlertComponent from "../alert/alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import JobDocuments from "./jobs-documents-gallery.component";
export default function JobsDocumentsContainer({ jobId }) {
const { loading, error, data, refetch } = useQuery(GET_DOCUMENTS_BY_JOB, {
variables: { jobId: jobId },
fetchPolicy: "network-only"
});
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent type="error" message={error.message} />;
return <JobDocuments data={data.documents} jobId={jobId} refetch={refetch} />;
}