From f24c46101b3dac4b0aebe88e685a5261b341ba33 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 19 Feb 2023 18:31:28 +0100 Subject: [PATCH] refactor(frontend): remove unused TranslatedIconButton Signed-off-by: Philip Molares --- .../translated-icon-button.test.tsx.snap | 24 ----------------- .../translated-icon-button.test.tsx | 16 ----------- .../icon-button/translated-icon-button.tsx | 27 ------------------- 3 files changed, 67 deletions(-) delete mode 100644 frontend/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap delete mode 100644 frontend/src/components/common/icon-button/translated-icon-button.test.tsx delete mode 100644 frontend/src/components/common/icon-button/translated-icon-button.tsx diff --git a/frontend/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap b/frontend/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap deleted file mode 100644 index 0265d76a6..000000000 --- a/frontend/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TranslatedIconButton renders heart icon with i18nKey 1`] = ` -
- -
-`; diff --git a/frontend/src/components/common/icon-button/translated-icon-button.test.tsx b/frontend/src/components/common/icon-button/translated-icon-button.test.tsx deleted file mode 100644 index 559be43b6..000000000 --- a/frontend/src/components/common/icon-button/translated-icon-button.test.tsx +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) - * - * SPDX-License-Identifier: AGPL-3.0-only - */ -import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n' -import { TranslatedIconButton } from './translated-icon-button' -import { render } from '@testing-library/react' - -describe('TranslatedIconButton', () => { - it('renders heart icon with i18nKey', async () => { - await mockI18n() - const view = render() - expect(view.container).toMatchSnapshot() - }) -}) diff --git a/frontend/src/components/common/icon-button/translated-icon-button.tsx b/frontend/src/components/common/icon-button/translated-icon-button.tsx deleted file mode 100644 index 8fa14f0a7..000000000 --- a/frontend/src/components/common/icon-button/translated-icon-button.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) - * - * SPDX-License-Identifier: AGPL-3.0-only - */ -import type { IconButtonProps } from './icon-button' -import { IconButton } from './icon-button' -import React from 'react' -import { Trans } from 'react-i18next' - -export interface TranslatedIconButtonProps extends IconButtonProps { - i18nKey: string -} - -/** - * Renders an {@link IconButton icon button} with a translation inside. - * - * @param i18nKey The key for the translated string. - * @param props Additional props directly given to the {@link IconButton}. - */ -export const TranslatedIconButton: React.FC = ({ i18nKey, ...props }) => { - return ( - - - - ) -}