mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 15:47:55 +01:00
Move label dialog with the rest of the dialogs.
This commit is contained in:
parent
a5847c64d4
commit
18531a981b
@ -22,7 +22,7 @@ type AddLabelFormProps = {
|
||||
onAdd: (newLabel: Label) => void;
|
||||
};
|
||||
|
||||
export default function AddLabelForm({ onAdd }: AddLabelFormProps): React.ReactElement {
|
||||
const AddLabelDialog = ({ onAdd }: AddLabelFormProps): React.ReactElement => {
|
||||
const intl = useIntl();
|
||||
const [createLabelColorIndex, setCreateLabelColorIndex] = React.useState(
|
||||
Math.floor(Math.random() * labelColors.length)
|
||||
@ -92,3 +92,5 @@ export default function AddLabelForm({ onAdd }: AddLabelFormProps): React.ReactE
|
||||
</CreateLabel>
|
||||
);
|
||||
}
|
||||
|
||||
export default AddLabelDialog;
|
@ -8,7 +8,7 @@ import Client, { Label, ErrorInfo, MapInfo } from '../../../../classes/client';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { activeInstance } from '../../../../redux/clientSlice';
|
||||
import AddLabelForm from '../add-label-form';
|
||||
import AddLabelDialog from '../../action-dispatcher/add-label-dialog';
|
||||
import { LabelListContainer } from './styled';
|
||||
|
||||
export type LabelSelectorProps = {
|
||||
@ -29,7 +29,7 @@ export function LabelSelector({ onChange, maps }: LabelSelectorProps): React.Rea
|
||||
return (
|
||||
<Container>
|
||||
<FormGroup>
|
||||
<AddLabelForm onAdd={(label) => onChange(label, true)} />
|
||||
<AddLabelDialog onAdd={(label) => onChange(label, true)} />
|
||||
</FormGroup>
|
||||
<LabelListContainer>
|
||||
{labels.map(({ id, title, color }) => (
|
||||
|
Loading…
Reference in New Issue
Block a user