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

View File

@ -21,12 +21,6 @@ ul {
padding: 0; /* Removes default padding */ 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 { .wrap {
display: flex; display: flex;
@ -89,12 +83,6 @@ li {
color: white; color: white;
} }
.fileInfo {
flex-grow: 1;
font-size: 16px;
font-weight: 500;
}
.fileName { .fileName {
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
@ -109,15 +97,4 @@ li {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: 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 ( return (
<PdfMarking <PdfMarking
files={getCurrentUserFiles(files, currentFileHashes, creatorFileHashes)} files={getCurrentUserFiles(files, currentFileHashes)}
currentUserMarks={currentUserMarks} currentUserMarks={currentUserMarks}
setIsReadyToSign={setIsReadyToSign} setIsReadyToSign={setIsReadyToSign}
setCurrentUserMarks={setCurrentUserMarks} setCurrentUserMarks={setCurrentUserMarks}

View File

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

View File

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