feat(verify-page): new verify page design #151

Merged
enes merged 11 commits from 136-verify-page-after-merges into staging 2024-08-20 11:57:40 +00:00
5 changed files with 5 additions and 40 deletions
Showing only changes of commit 268a4db3ff - Show all commits

View File

@ -1,8 +1,6 @@
import { CurrentUserFile } from '../../types/file.ts'
import styles from './style.module.scss'
import { Button } from '@mui/material'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCheck } from '@fortawesome/free-solid-svg-icons'
interface FileListProps {
files: CurrentUserFile[]
@ -28,14 +26,8 @@ const FileList = ({
className={`${styles.fileItem} ${isActive(file) && styles.active}`}
onClick={() => setCurrentFile(file)}
>
<div className={styles.fileNumber}>{file.id}</div>
<div className={styles.fileInfo}>
<div className={styles.fileName}>{file.filename}</div>
</div>
<div className={styles.fileVisual}>
{file.isHashValid && <FontAwesomeIcon icon={faCheck} />}
</div>
<span className={styles.fileNumber}>{file.id}</span>
<span className={styles.fileName}>{file.filename}</span>
</li>
))}
</ul>

View File

@ -21,12 +21,6 @@ ul {
padding: 0; /* Removes default padding */
}
li {
list-style-type: none; /* Removes the bullets */
margin: 0; /* Removes any default margin */
padding: 0; /* Removes any default padding */
}
.wrap {
display: flex;
@ -89,12 +83,6 @@ li {
color: white;
}
.fileInfo {
flex-grow: 1;
font-size: 16px;
font-weight: 500;
}
.fileName {
display: -webkit-box;
-webkit-box-orient: vertical;
@ -109,15 +97,4 @@ li {
flex-direction: column;
justify-content: center;
align-items: center;
width: 10px;
}
.fileVisual {
display: flex;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
align-items: center;
height: 25px;
width: 25px;
}

View File

@ -952,7 +952,7 @@ export const SignPage = () => {
return (
<PdfMarking
files={getCurrentUserFiles(files, currentFileHashes, creatorFileHashes)}
files={getCurrentUserFiles(files, currentFileHashes)}
currentUserMarks={currentUserMarks}
setIsReadyToSign={setIsReadyToSign}
setCurrentUserMarks={setCurrentUserMarks}

View File

@ -5,5 +5,4 @@ export interface CurrentUserFile {
pdfFile: PdfFile
filename: string
hash?: string
isHashValid: boolean
}

View File

@ -72,20 +72,17 @@ export const timeout = (ms: number = 60000) => {
* including its name, hash, and content
* @param files
* @param fileHashes
* @param creatorFileHashes
*/
export const getCurrentUserFiles = (
files: { [filename: string]: PdfFile },
fileHashes: { [key: string]: string | null },
creatorFileHashes: { [key: string]: string }
fileHashes: { [key: string]: string | null }
): CurrentUserFile[] => {
return Object.entries(files).map(([filename, pdfFile], index) => {
return {
pdfFile,
filename,
id: index + 1,
...(!!fileHashes[filename] && { hash: fileHashes[filename]! }),
isHashValid: creatorFileHashes[filename] === fileHashes[filename]
...(!!fileHashes[filename] && { hash: fileHashes[filename]! })
}
})
}