mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
ref: Creating popups with hook, fix translation keys passing
This commit is contained in:
parent
6fd42e3b62
commit
d975b2d07a
69 changed files with 309 additions and 332 deletions
|
@ -3,7 +3,6 @@ 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 { Popup } from '../../../lib/custom-ui';
|
||||
|
||||
import { useSteps } from '../../../hooks';
|
||||
|
@ -13,7 +12,7 @@ import UserEmailEditStep from '../../UserEmailEditStep';
|
|||
import UserPasswordEditStep from '../../UserPasswordEditStep';
|
||||
import DeleteStep from '../../DeleteStep';
|
||||
|
||||
import styles from './ActionsPopup.module.scss';
|
||||
import styles from './ActionsStep.module.scss';
|
||||
|
||||
const StepTypes = {
|
||||
EDIT_INFORMATION: 'EDIT_INFORMATION',
|
||||
|
@ -111,11 +110,9 @@ const ActionsStep = React.memo(
|
|||
case StepTypes.DELETE:
|
||||
return (
|
||||
<DeleteStep
|
||||
title={t('common.deleteUser', {
|
||||
context: 'title',
|
||||
})}
|
||||
content={t('common.areYouSureYouWantToDeleteThisUser')}
|
||||
buttonContent={t('action.deleteUser')}
|
||||
title="common.deleteUser"
|
||||
content="common.areYouSureYouWantToDeleteThisUser"
|
||||
buttonContent="action.deleteUser"
|
||||
onConfirm={onDelete}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
|
@ -178,4 +175,4 @@ ActionsStep.propTypes = {
|
|||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default withPopup(ActionsStep);
|
||||
export default ActionsStep;
|
|
@ -1,8 +1,9 @@
|
|||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Icon, Radio, Table } from 'semantic-ui-react';
|
||||
import { usePopup } from '../../../lib/popup';
|
||||
|
||||
import ActionsPopup from './ActionsPopup';
|
||||
import ActionsStep from './ActionsStep';
|
||||
import User from '../../User';
|
||||
|
||||
import styles from './Item.module.scss';
|
||||
|
@ -34,6 +35,8 @@ const Item = React.memo(
|
|||
});
|
||||
}, [isAdmin, onUpdate]);
|
||||
|
||||
const ActionsPopup = usePopup(ActionsStep);
|
||||
|
||||
return (
|
||||
<Table.Row>
|
||||
<Table.Cell>
|
||||
|
|
|
@ -2,8 +2,9 @@ import React, { useCallback } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Modal, Table } from 'semantic-ui-react';
|
||||
import { usePopup } from '../../lib/popup';
|
||||
|
||||
import UserAddPopupContainer from '../../containers/UserAddPopupContainer';
|
||||
import UserAddStepContainer from '../../containers/UserAddStepContainer';
|
||||
import Item from './Item';
|
||||
|
||||
const UsersModal = React.memo(
|
||||
|
@ -77,6 +78,8 @@ const UsersModal = React.memo(
|
|||
[onDelete],
|
||||
);
|
||||
|
||||
const UserAddPopupContainer = usePopup(UserAddStepContainer);
|
||||
|
||||
return (
|
||||
<Modal open closeIcon size="large" centered={false} onClose={onClose}>
|
||||
<Modal.Header>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue