mirror of
https://github.com/plankanban/planka.git
synced 2025-07-23 23:29:43 +02:00
Prepare for collection board type, refactoring, update dependencies
This commit is contained in:
parent
2d92ade8dc
commit
c6ee7d54bb
190 changed files with 2144 additions and 1817 deletions
54
client/src/components/CardModal/AttachmentAddPopup.jsx
Normal file
54
client/src/components/CardModal/AttachmentAddPopup.jsx
Normal file
|
@ -0,0 +1,54 @@
|
|||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Menu } from 'semantic-ui-react';
|
||||
import { withPopup } from '../../lib/popup';
|
||||
import { FilePicker, Popup } from '../../lib/custom-ui';
|
||||
|
||||
import styles from './AttachmentAddPopup.module.scss';
|
||||
|
||||
const AttachmentAddStep = React.memo(({ onCreate, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleFileSelect = useCallback(
|
||||
(file) => {
|
||||
onCreate({
|
||||
file,
|
||||
});
|
||||
onClose();
|
||||
},
|
||||
[onCreate, onClose],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header>
|
||||
{t('common.addAttachment', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<Menu secondary vertical className={styles.menu}>
|
||||
<FilePicker onSelect={handleFileSelect}>
|
||||
<Menu.Item className={styles.menuItem}>
|
||||
{t('common.fromComputer', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
</FilePicker>
|
||||
</Menu>
|
||||
<hr className={styles.divider} />
|
||||
<div className={styles.tip}>
|
||||
{t('common.pressPasteShortcutToAddAttachmentFromClipboard')}
|
||||
</div>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
AttachmentAddStep.propTypes = {
|
||||
onCreate: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default withPopup(AttachmentAddStep);
|
Loading…
Add table
Add a link
Reference in a new issue