refactor(frontend): remove unused TranslatedIconButton

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2023-02-19 18:31:28 +01:00
parent 944304b274
commit f24c46101b
3 changed files with 0 additions and 67 deletions

View file

@ -1,24 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`TranslatedIconButton renders heart icon with i18nKey 1`] = `
<div>
<button
class="btn-icon p-0 d-inline-flex align-items-stretch btn btn-primary"
data-testid="icon-button"
type="button"
>
<span
class="icon-part d-flex align-items-center"
>
<i
class="fa fa-heart icon "
/>
</span>
<span
class="text-part d-flex align-items-center"
>
testi18nKey
</span>
</button>
</div>
`;

View file

@ -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(<TranslatedIconButton i18nKey={'testi18nKey'} icon={'heart'} />)
expect(view.container).toMatchSnapshot()
})
})

View file

@ -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<TranslatedIconButtonProps> = ({ i18nKey, ...props }) => {
return (
<IconButton {...props}>
<Trans i18nKey={i18nKey} />
</IconButton>
)
}