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 setCurrentFile: (file: CurrentUserFile) => void
handleExport: () => void handleExport: () => void
handleEncryptedExport?: () => void handleEncryptedExport?: () => void
downloadLabel?: string
} }
const FileList = ({ const FileList = ({
@ -20,8 +19,7 @@ const FileList = ({
currentFile, currentFile,
setCurrentFile, setCurrentFile,
handleExport, handleExport,
handleEncryptedExport, handleEncryptedExport
downloadLabel
}: FileListProps) => { }: FileListProps) => {
const isActive = (file: CurrentUserFile) => file.id === currentFile.id const isActive = (file: CurrentUserFile) => file.id === currentFile.id
return ( return (
@ -47,12 +45,11 @@ const FileList = ({
))} ))}
</ul> </ul>
{!downloadLabel && (
<PopupState variant="popover" popupId="download-popup-menu"> <PopupState variant="popover" popupId="download-popup-menu">
{(popupState) => ( {(popupState) => (
<React.Fragment> <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)}> <Button variant="contained" {...bindTrigger(popupState)}>
{downloadLabel || 'Export files'} Export files
</Button> </Button>
<Menu {...bindMenu(popupState)}> <Menu {...bindMenu(popupState)}>
<MenuItem <MenuItem
@ -66,7 +63,8 @@ const FileList = ({
<MenuItem <MenuItem
onClick={() => { onClick={() => {
popupState.close popupState.close
handleEncryptedExport && handleEncryptedExport() 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 Export Encrypted Files
@ -75,7 +73,6 @@ const FileList = ({
</React.Fragment> </React.Fragment>
)} )}
</PopupState> </PopupState>
)}
</div> </div>
) )
} }