fix(i18next): fix used types

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-10-23 00:07:05 +02:00
parent 8a957fbf27
commit 80a5a73a9d
2 changed files with 4 additions and 4 deletions

View file

@ -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
}

View file

@ -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, {