mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
refactor(frontend): remove unused TranslatedIconButton
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
944304b274
commit
f24c46101b
3 changed files with 0 additions and 67 deletions
|
@ -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>
|
||||
`;
|
|
@ -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()
|
||||
})
|
||||
})
|
|
@ -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>
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue