mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-27 00:33:23 +00:00
fix(i18next): fix used types
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
8a957fbf27
commit
80a5a73a9d
2 changed files with 4 additions and 4 deletions
4
src/components/common/links/types.d.ts
vendored
4
src/components/common/links/types.d.ts
vendored
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { StringMap, TOptionsBase } from 'i18next'
|
||||
import type { TOptions } from 'i18next'
|
||||
import type { IconName } from '../fork-awesome/fork-awesome-icon'
|
||||
|
||||
interface GeneralLinkProp {
|
||||
|
@ -21,5 +21,5 @@ export interface LinkWithTextProps extends GeneralLinkProp {
|
|||
|
||||
export interface TranslatedLinkProps extends GeneralLinkProp {
|
||||
i18nKey: string
|
||||
i18nOption?: (TOptionsBase & StringMap) | string
|
||||
i18nOption?: TOptions
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ interface UiNotificationContext {
|
|||
dispatchOptions: Partial<DispatchOptions>
|
||||
) => void
|
||||
|
||||
showErrorNotification: (messageI18nKey: string, messageI18nOptions?: TOptions | string) => (error: Error) => void
|
||||
showErrorNotification: (messageI18nKey: string, messageI18nOptions?: TOptions) => (error: Error) => void
|
||||
|
||||
dismissNotification: (notificationUuid: string) => void
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ export const UiNotificationBoundary: React.FC<PropsWithChildren> = ({ children }
|
|||
)
|
||||
|
||||
const showErrorNotification = useCallback(
|
||||
(messageI18nKey: string, messageI18nOptions?: TOptions | string) =>
|
||||
(messageI18nKey: string, messageI18nOptions?: TOptions) =>
|
||||
(error: Error): void => {
|
||||
log.error(t(messageI18nKey, messageI18nOptions), error)
|
||||
void dispatchUiNotification('common.errorOccurred', messageI18nKey, {
|
||||
|
|
Loading…
Reference in a new issue