feat: Sign Directly From the Marking Screen fix: Marking inputs glitches, losing values #272
@ -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
|
|||||||
<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
enes
commented
Would it be safer to check for 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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
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.