Fix widget delete modal

This commit is contained in:
ajnart
2023-01-13 10:57:13 +09:00
parent cb85bf4827
commit 5a2653a189
4 changed files with 8 additions and 7 deletions

View File

@@ -9,6 +9,7 @@
"version": "Version",
"changePosition": "Change position",
"remove": "Remove",
"removeConfirm": "Are you sure that you want to remove {{item}} ?",
"sections": {
"settings": "Settings",
"dangerZone": "Danger zone"

View File

@@ -19,10 +19,6 @@
"url": {
"label": "Dash. URL"
}
},
"remove": {
"title": "Remove Dash. widget",
"confirm": "Are you sure, that you want to remove the Dash. widget?"
}
},
"card": {

View File

@@ -36,7 +36,7 @@ export const WidgetsMenu = ({ integration, widget }: WidgetsMenuProps) => {
const handleDeleteClick = () => {
openContextModalGeneric<WidgetsRemoveModalInnerProps>({
modal: 'integrationRemove',
title: <Title order={4}>{t('descriptor.remove.title')}</Title>,
title: <Title order={4}>{t('common:remove')}</Title>,
innerProps: {
widgetId: integration,
},

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Button, Group, Stack, Text } from '@mantine/core';
import { ContextModalProps } from '@mantine/modals';
import { useTranslation } from 'next-i18next';
import { Trans, useTranslation } from 'next-i18next';
import { useConfigContext } from '../../../../config/provider';
import { useConfigStore } from '../../../../config/store';
@@ -32,7 +32,11 @@ export const WidgetsRemoveModal = ({
return (
<Stack>
<Text>{t('descriptor.remove.confirm')}</Text>
<Trans
i18nKey="common:removeConfirm"
components={[<Text weight={500} />]}
values={{ item: innerProps.widgetId }}
/>
<Group position="right">
<Button onClick={() => context.closeModal(id)} variant="light">
{t('common:cancel')}