Compare commits

..

No commits in common. "b22f577cc2de21bb1f8370c84a1d263f09fd7eb6" and "7d3daa8d13827fa8dc1b51ed8d3572efb187be88" have entirely different histories.

3 changed files with 7 additions and 13 deletions

View File

@ -14,8 +14,6 @@ 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[]
@ -24,7 +22,6 @@ interface PdfMarkingProps {
setCurrentUserMarks: (currentUserMarks: CurrentUserMark[]) => void
setUpdatedMarks: (markToUpdate: Mark) => void
handleDownload: () => void
meta: Meta | null
}
/**
@ -40,8 +37,7 @@ const PdfMarking = (props: PdfMarkingProps) => {
setIsReadyToSign,
setCurrentUserMarks,
setUpdatedMarks,
handleDownload,
meta
handleDownload
} = props
const [selectedMark, setSelectedMark] = useState<CurrentUserMark | null>(null)
const [selectedMarkValue, setSelectedMarkValue] = useState<string>('')
@ -85,8 +81,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,
@ -130,7 +126,6 @@ const PdfMarking = (props: PdfMarkingProps) => {
)}
</div>
}
right={meta !== null && <UsersDetails meta={meta} />}
>
<div className={styles.container}>
{currentUserMarks?.length > 0 && (

View File

@ -35,10 +35,10 @@ const PdfView = ({
}, [currentFile])
const filterByFile = (
currentUserMarks: CurrentUserMark[],
hash: string
fileName: string
): CurrentUserMark[] => {
return currentUserMarks.filter(
(currentUserMark) => currentUserMark.mark.pdfFileHash === hash
(currentUserMark) => currentUserMark.mark.fileName === fileName
)
}
const isNotLastPdfFile = (index: number, files: CurrentUserFile[]): boolean =>
@ -46,7 +46,7 @@ const PdfView = ({
return (
<>
{files.map((currentUserFile, index, arr) => {
const { hash, pdfFile, id } = currentUserFile
const { hash, pdfFile, filename, id } = currentUserFile
if (!hash) return
return (
<div
@ -56,7 +56,7 @@ const PdfView = ({
>
<PdfItem
pdfFile={pdfFile}
currentUserMarks={filterByFile(currentUserMarks, hash)}
currentUserMarks={filterByFile(currentUserMarks, filename)}
selectedMark={selectedMark}
handleMarkClick={handleMarkClick}
selectedMarkValue={selectedMarkValue}

View File

@ -958,7 +958,6 @@ export const SignPage = () => {
setCurrentUserMarks={setCurrentUserMarks}
setUpdatedMarks={setUpdatedMarks}
handleDownload={handleDownload}
meta={meta}
/>
)
}