feat(frontend): replace forkawesome with bootstrap icons

These icon replace fork awesome. A linter informs the user about the deprecation.

See https://github.com/hedgedoc/hedgedoc/issues/2929

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Philip Molares 2023-02-05 22:05:02 +01:00 committed by Tilman Vatteroth
parent e7246f1484
commit 1c16e25e14
179 changed files with 4974 additions and 1943 deletions

View file

@ -7,9 +7,7 @@ exports[`Copy to clipboard button show an error text if clipboard api isn't avai
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;
@ -22,9 +20,7 @@ exports[`Copy to clipboard button show an error text if clipboard api isn't avai
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;
@ -36,9 +32,7 @@ exports[`Copy to clipboard button shows an error text if writing failed 1`] = `
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;
@ -51,9 +45,7 @@ exports[`Copy to clipboard button shows an error text if writing failed 2`] = `
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;
@ -65,9 +57,7 @@ exports[`Copy to clipboard button shows an success text if writing succeeded 1`]
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;
@ -80,9 +70,7 @@ exports[`Copy to clipboard button shows an success text if writing succeeded 2`]
title="renderer.highlightCode.copyCode"
type="button"
>
<i
class="fa fa-files-o "
/>
BootstrapIconMock_Files
</button>
</div>
`;

View file

@ -5,10 +5,11 @@
*/
import type { PropsWithDataCypressId } from '../../../../utils/cypress-attribute'
import { cypressId } from '../../../../utils/cypress-attribute'
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
import { UiIcon } from '../../icons/ui-icon'
import { useCopyOverlay } from '../hooks/use-copy-overlay'
import React, { Fragment, useRef } from 'react'
import { Button } from 'react-bootstrap'
import { Files as IconFiles } from 'react-bootstrap-icons'
import type { Variant } from 'react-bootstrap/types'
import { useTranslation } from 'react-i18next'
@ -46,7 +47,7 @@ export const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps> = ({
title={t('renderer.highlightCode.copyCode') ?? undefined}
onClick={copyToClipboard}
{...cypressId(props)}>
<ForkAwesomeIcon icon='files-o' />
<UiIcon icon={IconFiles} />
</Button>
{overlayElement}
</Fragment>

View file

@ -5,11 +5,12 @@
*/
import { isClientSideRendering } from '../../../../utils/is-client-side-rendering'
import { Logger } from '../../../../utils/logger'
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
import { UiIcon } from '../../icons/ui-icon'
import { ShowIf } from '../../show-if/show-if'
import { CopyToClipboardButton } from '../copy-to-clipboard-button/copy-to-clipboard-button'
import React, { useCallback, useMemo } from 'react'
import { Button, FormControl, InputGroup } from 'react-bootstrap'
import { Share as IconShare } from 'react-bootstrap-icons'
import { useTranslation } from 'react-i18next'
export interface CopyableFieldProps {
@ -57,7 +58,7 @@ export const CopyableField: React.FC<CopyableFieldProps> = ({ content, shareOrig
<ShowIf condition={sharingSupported}>
<InputGroup.Text>
<Button variant='secondary' title={'Share'} onClick={doShareAction}>
<ForkAwesomeIcon icon='share-alt' />
<UiIcon icon={IconShare} />
</Button>
</InputGroup.Text>
</ShowIf>