Compare commits
2 Commits
7d3daa8d13
...
b22f577cc2
Author | SHA1 | Date | |
---|---|---|---|
b22f577cc2 | |||
2becab9f79 |
@ -14,6 +14,8 @@ import styles from './style.module.scss'
|
||||
import { CurrentUserFile } from '../../types/file.ts'
|
||||
import FileList from '../FileList'
|
||||
import { StickySideColumns } from '../../layouts/StickySideColumns.tsx'
|
||||
import { UsersDetails } from '../UsersDetails.tsx'
|
||||
import { Meta } from '../../types'
|
||||
|
||||
interface PdfMarkingProps {
|
||||
files: CurrentUserFile[]
|
||||
@ -22,6 +24,7 @@ interface PdfMarkingProps {
|
||||
setCurrentUserMarks: (currentUserMarks: CurrentUserMark[]) => void
|
||||
setUpdatedMarks: (markToUpdate: Mark) => void
|
||||
handleDownload: () => void
|
||||
meta: Meta | null
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,7 +40,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
|
||||
setIsReadyToSign,
|
||||
setCurrentUserMarks,
|
||||
setUpdatedMarks,
|
||||
handleDownload
|
||||
handleDownload,
|
||||
meta
|
||||
} = props
|
||||
const [selectedMark, setSelectedMark] = useState<CurrentUserMark | null>(null)
|
||||
const [selectedMarkValue, setSelectedMarkValue] = useState<string>('')
|
||||
@ -81,8 +85,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
|
||||
}
|
||||
|
||||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
if (!selectedMarkValue || !selectedMark) return;
|
||||
event.preventDefault()
|
||||
if (!selectedMarkValue || !selectedMark) return
|
||||
|
||||
const updatedMark: CurrentUserMark = getUpdatedMark(
|
||||
selectedMark,
|
||||
@ -126,6 +130,7 @@ const PdfMarking = (props: PdfMarkingProps) => {
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
right={meta !== null && <UsersDetails meta={meta} />}
|
||||
>
|
||||
<div className={styles.container}>
|
||||
{currentUserMarks?.length > 0 && (
|
||||
|
@ -35,10 +35,10 @@ const PdfView = ({
|
||||
}, [currentFile])
|
||||
const filterByFile = (
|
||||
currentUserMarks: CurrentUserMark[],
|
||||
fileName: string
|
||||
hash: string
|
||||
): CurrentUserMark[] => {
|
||||
return currentUserMarks.filter(
|
||||
(currentUserMark) => currentUserMark.mark.fileName === fileName
|
||||
(currentUserMark) => currentUserMark.mark.pdfFileHash === hash
|
||||
)
|
||||
}
|
||||
const isNotLastPdfFile = (index: number, files: CurrentUserFile[]): boolean =>
|
||||
@ -46,7 +46,7 @@ const PdfView = ({
|
||||
return (
|
||||
<>
|
||||
{files.map((currentUserFile, index, arr) => {
|
||||
const { hash, pdfFile, filename, id } = currentUserFile
|
||||
const { hash, pdfFile, id } = currentUserFile
|
||||
if (!hash) return
|
||||
return (
|
||||
<div
|
||||
@ -56,7 +56,7 @@ const PdfView = ({
|
||||
>
|
||||
<PdfItem
|
||||
pdfFile={pdfFile}
|
||||
currentUserMarks={filterByFile(currentUserMarks, filename)}
|
||||
currentUserMarks={filterByFile(currentUserMarks, hash)}
|
||||
selectedMark={selectedMark}
|
||||
handleMarkClick={handleMarkClick}
|
||||
selectedMarkValue={selectedMarkValue}
|
||||
|
@ -958,6 +958,7 @@ export const SignPage = () => {
|
||||
setCurrentUserMarks={setCurrentUserMarks}
|
||||
setUpdatedMarks={setUpdatedMarks}
|
||||
handleDownload={handleDownload}
|
||||
meta={meta}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user