release #306

Merged
b merged 25 commits from staging into main 2025-01-23 18:54:21 +00:00
2 changed files with 40 additions and 34 deletions
Showing only changes of commit b7410c7d33 - Show all commits

View File

@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react'
import styles from './style.module.scss' import styles from './style.module.scss'
interface ButtonUnderlineProps { interface ButtonUnderlineProps {
onClick: () => void onClick: (event: React.MouseEvent<HTMLButtonElement>) => void
disabled?: boolean | undefined disabled?: boolean | undefined
} }

View File

@ -1,16 +1,16 @@
import { CurrentUserFile } from '../../types/file.ts' import React from 'react'
import styles from './style.module.scss'
import { Button, Menu, MenuItem } from '@mui/material' import { Button, Menu, MenuItem } from '@mui/material'
import PopupState, { bindTrigger, bindMenu } from 'material-ui-popup-state'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCheck } from '@fortawesome/free-solid-svg-icons' import { faCheck } from '@fortawesome/free-solid-svg-icons'
import PopupState, { bindTrigger, bindMenu } from 'material-ui-popup-state' import { CurrentUserFile } from '../../types/file.ts'
import React from 'react' import styles from './style.module.scss'
interface FileListProps { interface FileListProps {
files: CurrentUserFile[] files: CurrentUserFile[]
currentFile: CurrentUserFile currentFile: CurrentUserFile
setCurrentFile: (file: CurrentUserFile) => void setCurrentFile: (file: CurrentUserFile) => void
handleExport: () => void handleExport?: () => void
handleEncryptedExport?: () => void handleEncryptedExport?: () => void
} }
@ -45,6 +45,8 @@ const FileList = ({
))} ))}
</ul> </ul>
{(typeof handleExport === 'function' ||
typeof handleEncryptedExport === 'function') && (
<PopupState variant="popover" popupId="download-popup-menu"> <PopupState variant="popover" popupId="download-popup-menu">
{(popupState) => ( {(popupState) => (
<React.Fragment> <React.Fragment>
@ -52,6 +54,7 @@ const FileList = ({
Export files Export files
</Button> </Button>
<Menu {...bindMenu(popupState)}> <Menu {...bindMenu(popupState)}>
{typeof handleExport === 'function' && (
<MenuItem <MenuItem
onClick={() => { onClick={() => {
popupState.close popupState.close
@ -60,19 +63,22 @@ const FileList = ({
> >
Export Files Export Files
</MenuItem> </MenuItem>
)}
{typeof handleEncryptedExport === 'function' && (
<MenuItem <MenuItem
onClick={() => { onClick={() => {
popupState.close popupState.close
typeof handleEncryptedExport === 'function' &&
handleEncryptedExport() handleEncryptedExport()
}} }}
> >
Export Encrypted Files Export Encrypted Files
</MenuItem> </MenuItem>
)}
</Menu> </Menu>
</React.Fragment> </React.Fragment>
)} )}
</PopupState> </PopupState>
)}
</div> </div>
) )
} }