1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-29 18:19:46 +02:00

ref: Creating popups with hook, fix translation keys passing

This commit is contained in:
Maksim Eltyshev 2023-01-24 18:53:13 +01:00
parent 6fd42e3b62
commit d975b2d07a
69 changed files with 309 additions and 332 deletions

View file

@ -3,11 +3,12 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { useTranslation } from 'react-i18next';
import { Comment } from 'semantic-ui-react';
import { usePopup } from '../../../lib/popup';
import { Markdown } from '../../../lib/custom-ui';
import CommentEdit from './CommentEdit';
import User from '../../User';
import DeletePopup from '../../DeletePopup';
import DeleteStep from '../../DeleteStep';
import styles from './ItemComment.module.scss';
@ -21,6 +22,8 @@ const ItemComment = React.memo(
commentEdit.current.open();
}, []);
const DeletePopup = usePopup(DeleteStep);
return (
<Comment>
<span className={styles.user}>
@ -50,11 +53,9 @@ const ItemComment = React.memo(
onClick={handleEditClick}
/>
<DeletePopup
title={t('common.deleteComment', {
context: 'title',
})}
content={t('common.areYouSureYouWantToDeleteThisComment')}
buttonContent={t('action.deleteComment')}
title="common.deleteComment"
content="common.areYouSureYouWantToDeleteThisComment"
buttonContent="action.deleteComment"
onConfirm={onDelete}
>
<Comment.Action