From fff22dce8c62c65fd0a478bff44a45848366ff7e Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 5 Aug 2024 13:25:58 +0300 Subject: [PATCH] refactor: post PR review changes --- .../DrawPDFFields/style.module.scss | 2 - src/pages/create/index.tsx | 2 - src/pages/sign/index.tsx | 66 ------------------- src/pages/verify/index.tsx | 4 -- src/types/mark.ts | 7 -- 5 files changed, 81 deletions(-) diff --git a/src/components/DrawPDFFields/style.module.scss b/src/components/DrawPDFFields/style.module.scss index b57aa65..e3e7856 100644 --- a/src/components/DrawPDFFields/style.module.scss +++ b/src/components/DrawPDFFields/style.module.scss @@ -59,8 +59,6 @@ .drawingRectangle { position: absolute; border: 1px solid #01aaad; - //width: 40px; - //height: 40px; z-index: 50; background-color: #01aaad4b; cursor: pointer; diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index f509fa6..fd77258 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -526,8 +526,6 @@ export const CreatePage = () => { title } - console.log('content: ', content) - setLoadingSpinnerDesc('Signing nostr event for create signature') const createSignature = await signEventForMetaFile( diff --git a/src/pages/sign/index.tsx b/src/pages/sign/index.tsx index 343f9c3..02631dc 100644 --- a/src/pages/sign/index.tsx +++ b/src/pages/sign/index.tsx @@ -319,8 +319,6 @@ export const SignPage = () => { } } - console.log('processed files: ', files); - setFiles(files) setCurrentFileHashes(fileHashes) } @@ -455,8 +453,6 @@ export const SignPage = () => { } } - console.log('processed files: ', files); - setFiles(files) setCurrentFileHashes(fileHashes) @@ -540,42 +536,6 @@ export const SignPage = () => { return currentUserMarks.map(( { mark }: CurrentUserMark) => mark); } - // const handleMarkClick = (id: number) => { - // const nextMark = currentUserMarks.find(mark => mark.mark.id === id) - // setCurrentUserMark(nextMark!) - // setCurrentMarkValue(nextMark?.mark.value || "") - // } - - // const getMarkConfigPerUser = (markConfig: MarkConfig) => { - // if (!usersPubkey) return; - // return markConfig[hexToNpub(usersPubkey)]; - // } - - // const handleChange = (event: any) => setCurrentMarkValue(event.target.value); - // - // const handleSubmit = (event: any) => { - // event.preventDefault(); - // if (!currentMarkValue || !currentUserMark) return; - // - // const curMark: Mark = { - // ...currentUserMark.mark, - // value: currentMarkValue - // }; - // - // const updatedMarks: Mark[] = updateMarks(marks, curMark) - // - // setMarks(updatedMarks) - // setCurrentMarkValue("") - // - // // do the similar thing to the thing above - // const metaMarks = filterMarksByPubkey(updatedMarks, usersPubkey!) - // const signedMarks = extractMarksFromSignedMeta(meta!) - // const currentUserMarks = getCurrentUserMarks(metaMarks, signedMarks) - // setCurrentUserMarks(currentUserMarks) - // setCurrentUserMark(findNextCurrentUserMark(currentUserMarks) || null) - // setIsReadyToSign(isCurrentUserMarksComplete(currentUserMarks)) - // } - // Update the meta signatures const updateMetaSignatures = (meta: Meta, signedEvent: SignedEvent): Meta => { const metaCopy = _.cloneDeep(meta) @@ -970,30 +930,4 @@ export const SignPage = () => { setCurrentUserMarks={setCurrentUserMarks} setUpdatedMarks={setUpdatedMarks} /> - - // return ( - // <> - // - // { - // marks.length > 0 && ( - // )} - // { - // currentUserMark !== null && ( - // - // )} - // - // - // ) } diff --git a/src/pages/verify/index.tsx b/src/pages/verify/index.tsx index cbb5b8d..444490a 100644 --- a/src/pages/verify/index.tsx +++ b/src/pages/verify/index.tsx @@ -380,10 +380,6 @@ export const VerifyPage = () => { } const handleExport = async () => { - // const proverbialUrls = await addMarksV2(Object.values(files)[0].file, meta!) - // await convertToFinalPdf(proverbialUrls) - - if (Object.entries(files).length === 0 ||!meta ||!usersPubkey) return; const usersNpub = hexToNpub(usersPubkey) diff --git a/src/types/mark.ts b/src/types/mark.ts index 3bc38f8..5381298 100644 --- a/src/types/mark.ts +++ b/src/types/mark.ts @@ -1,12 +1,5 @@ import { MarkType } from "./drawing"; -// export interface Mark { -// /** -// * @key png (pdf page) file hash -// */ -// [key: string]: MarkConfigDetails[] -// } - export interface CurrentUserMark { mark: Mark isLast: boolean