feat: Sign Directly From the Marking Screen fix: Marking inputs glitches, losing values #272
@ -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
|
||||
<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
enes
commented
Would it be safer to check for Would it be safer to check for `typeof handleEncryptedExport === "function"`?
|
||||
Export Encrypted Files
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</React.Fragment>
|
||||
)}
|
||||
</PopupState>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user
Do we need the
downloadLabel
at all? Especially as a condition here, it's a bit confusing.