-
Add {markLabel}
+ {!complete && (
+
Add {markLabel}
+ )}
+ {complete &&
Finish
}
-
+ )}
+
+ {complete && (
-
-
+ )}
+
{currentUserMarks.map((mark, index) => {
@@ -104,7 +149,7 @@ const MarkFormField = ({
handleCurrentUserMarkChange(mark)}
+ onClick={() => handleCurrentUserMarkClick(mark)}
>
{mark.id}
@@ -114,6 +159,20 @@ const MarkFormField = ({
)
})}
+
+
+
+
+ {complete && (
+
+ )}
+
diff --git a/src/components/MarkFormField/style.module.scss b/src/components/MarkFormField/style.module.scss
index 686595f..3825146 100644
--- a/src/components/MarkFormField/style.module.scss
+++ b/src/components/MarkFormField/style.module.scss
@@ -216,3 +216,7 @@
flex-direction: column;
grid-gap: 5px;
}
+
+.finishPage {
+ padding: 1px 0;
+}
diff --git a/src/components/PDFView/PdfMarking.tsx b/src/components/PDFView/PdfMarking.tsx
index 222c393..f0d4f60 100644
--- a/src/components/PDFView/PdfMarking.tsx
+++ b/src/components/PDFView/PdfMarking.tsx
@@ -24,11 +24,12 @@ import {
interface PdfMarkingProps {
currentUserMarks: CurrentUserMark[]
files: CurrentUserFile[]
- handleDownload: () => void
+ handleExport: () => void
+ handleEncryptedExport: () => void
+ handleSign: () => void
meta: Meta | null
otherUserMarks: Mark[]
setCurrentUserMarks: (currentUserMarks: CurrentUserMark[]) => void
- setIsMarksCompleted: (isMarksCompleted: boolean) => void
setUpdatedMarks: (markToUpdate: Mark) => void
}
@@ -42,10 +43,11 @@ const PdfMarking = (props: PdfMarkingProps) => {
const {
files,
currentUserMarks,
- setIsMarksCompleted,
setCurrentUserMarks,
setUpdatedMarks,
- handleDownload,
+ handleExport,
+ handleEncryptedExport,
+ handleSign,
meta,
otherUserMarks
} = props
@@ -86,11 +88,18 @@ const PdfMarking = (props: PdfMarkingProps) => {
updatedSelectedMark
)
setCurrentUserMarks(updatedCurrentUserMarks)
- setSelectedMarkValue(mark.currentValue ?? EMPTY)
- setSelectedMark(mark)
+
+ // If clicking on the same mark, don't update the value, otherwise do update
+ if (mark.id !== selectedMark.id) {
+ setSelectedMarkValue(mark.currentValue ?? EMPTY)
+ setSelectedMark(mark)
+ }
}
- const handleSubmit = (event: React.FormEvent
) => {
+ /**
+ * Sign and Complete
+ */
+ const handleSubmit = (event: React.MouseEvent) => {
event.preventDefault()
if (!selectedMarkValue || !selectedMark) return
@@ -106,8 +115,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
)
setCurrentUserMarks(updatedCurrentUserMarks)
setSelectedMark(null)
- setIsMarksCompleted(true)
setUpdatedMarks(updatedMark.mark)
+ handleSign()
}
// const updateCurrentUserMarkValues = () => {
@@ -132,7 +141,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
files={files}
currentFile={currentFile}
setCurrentFile={setCurrentFile}
- handleDownload={handleDownload}
+ handleExport={handleExport}
+ handleEncryptedExport={handleEncryptedExport}
/>
)}
diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx
index 63140bf..25a2f0d 100644
--- a/src/pages/create/index.tsx
+++ b/src/pages/create/index.tsx
@@ -150,6 +150,17 @@ export const CreatePage = () => {
[setUserInput]
)
+ const handleSearchUserNip05 = async (
+ nip05: string
+ ): Promise