feat: Sign Directly From the Marking Screen fix: Marking inputs glitches, losing values #272

Merged
b merged 7 commits from issue-173 into staging 2024-12-10 15:34:01 +00:00
Showing only changes of commit 8d8c38e90b - Show all commits

View File

@ -12,7 +12,6 @@ interface FileListProps {
setCurrentFile: (file: CurrentUserFile) => void
handleExport: () => void
handleEncryptedExport?: () => void
downloadLabel?: string
}
const FileList = ({
@ -20,8 +19,7 @@ const FileList = ({
currentFile,
setCurrentFile,
handleExport,
handleEncryptedExport,
downloadLabel
handleEncryptedExport
}: FileListProps) => {
const isActive = (file: CurrentUserFile) => file.id === currentFile.id
return (
@ -47,35 +45,34 @@ const FileList = ({
))}
</ul>
{!downloadLabel && (
<PopupState variant="popover" popupId="download-popup-menu">
{(popupState) => (
<React.Fragment>
<Button variant="contained" {...bindTrigger(popupState)}>
{downloadLabel || 'Export files'}
</Button>
<Menu {...bindMenu(popupState)}>
<MenuItem
onClick={() => {
popupState.close
handleExport()
}}
>
Export Files
</MenuItem>
<MenuItem
onClick={() => {
popupState.close
handleEncryptedExport && handleEncryptedExport()
}}
>
Export Encrypted Files
</MenuItem>
</Menu>
</React.Fragment>
)}
</PopupState>
)}
<PopupState variant="popover" popupId="download-popup-menu">
{(popupState) => (
<React.Fragment>
m marked this conversation as resolved Outdated
Outdated
Review

Do we need the downloadLabel at all? Especially as a condition here, it's a bit confusing.

Do we need the `downloadLabel` at all? Especially as a condition here, it's a bit confusing.
<Button variant="contained" {...bindTrigger(popupState)}>
Export files
</Button>
<Menu {...bindMenu(popupState)}>
<MenuItem
onClick={() => {
popupState.close
handleExport()
}}
>
Export Files
</MenuItem>
<MenuItem
onClick={() => {
popupState.close
typeof handleEncryptedExport === 'function' &&
handleEncryptedExport()
}}
>
m marked this conversation as resolved Outdated
Outdated
Review

Would it be safer to check for typeof handleEncryptedExport === "function"?

Would it be safer to check for `typeof handleEncryptedExport === "function"`?
Export Encrypted Files
</MenuItem>
</Menu>
</React.Fragment>
)}
</PopupState>
</div>
)
}