Releasing new design #161

Merged
b merged 241 commits from staging into main 2024-08-21 11:38:25 +00:00
5 changed files with 40 additions and 5 deletions
Showing only changes of commit ed7acd6cb4 - Show all commits

View File

@ -1,6 +1,8 @@
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[]
@ -26,8 +28,14 @@ const FileList = ({
className={`${styles.fileItem} ${isActive(file) && styles.active}`}
onClick={() => setCurrentFile(file)}
>
<span className={styles.fileNumber}>{file.id}</span>
<span className={styles.fileName}>{file.filename}</span>
<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>
</li>
))}
</ul>

View File

@ -21,6 +21,12 @@ 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;
@ -83,6 +89,12 @@ ul {
color: white;
}
.fileInfo {
flex-grow: 1;
font-size: 16px;
font-weight: 500;
}
.fileName {
display: -webkit-box;
-webkit-box-orient: vertical;
@ -97,4 +109,15 @@ ul {
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)}
files={getCurrentUserFiles(files, currentFileHashes, creatorFileHashes)}
currentUserMarks={currentUserMarks}
setIsReadyToSign={setIsReadyToSign}
setCurrentUserMarks={setCurrentUserMarks}

View File

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

View File

@ -72,17 +72,20 @@ 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 }
fileHashes: { [key: string]: string | null },
creatorFileHashes: { [key: string]: string }
): CurrentUserFile[] => {
return Object.entries(files).map(([filename, pdfFile], index) => {
return {
pdfFile,
filename,
id: index + 1,
...(!!fileHashes[filename] && { hash: fileHashes[filename]! })
...(!!fileHashes[filename] && { hash: fileHashes[filename]! }),
isHashValid: creatorFileHashes[filename] === fileHashes[filename]
}
})
}