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,35 +45,34 @@ const FileList = ({
))} ))}
</ul> </ul>
{!downloadLabel && ( <PopupState variant="popover" popupId="download-popup-menu">
<PopupState variant="popover" popupId="download-popup-menu"> {(popupState) => (
{(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.
<React.Fragment> <Button variant="contained" {...bindTrigger(popupState)}>
<Button variant="contained" {...bindTrigger(popupState)}> Export files
{downloadLabel || 'Export files'} </Button>
</Button> <Menu {...bindMenu(popupState)}>
<Menu {...bindMenu(popupState)}> <MenuItem
<MenuItem onClick={() => {
onClick={() => { popupState.close
popupState.close handleExport()
handleExport() }}
}} >
> Export Files
Export Files </MenuItem>
</MenuItem> <MenuItem
<MenuItem onClick={() => {
onClick={() => { popupState.close
popupState.close typeof handleEncryptedExport === 'function' &&
handleEncryptedExport && handleEncryptedExport() 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
</MenuItem> </MenuItem>
</Menu> </Menu>
</React.Fragment> </React.Fragment>
)} )}
</PopupState> </PopupState>
)}
</div> </div>
) )
} }