mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 04:24:43 -04: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
|
* 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'
|
import type { IconName } from '../fork-awesome/fork-awesome-icon'
|
||||||
|
|
||||||
interface GeneralLinkProp {
|
interface GeneralLinkProp {
|
||||||
|
@ -21,5 +21,5 @@ export interface LinkWithTextProps extends GeneralLinkProp {
|
||||||
|
|
||||||
export interface TranslatedLinkProps extends GeneralLinkProp {
|
export interface TranslatedLinkProps extends GeneralLinkProp {
|
||||||
i18nKey: string
|
i18nKey: string
|
||||||
i18nOption?: (TOptionsBase & StringMap) | string
|
i18nOption?: TOptions
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ interface UiNotificationContext {
|
||||||
dispatchOptions: Partial<DispatchOptions>
|
dispatchOptions: Partial<DispatchOptions>
|
||||||
) => void
|
) => void
|
||||||
|
|
||||||
showErrorNotification: (messageI18nKey: string, messageI18nOptions?: TOptions | string) => (error: Error) => void
|
showErrorNotification: (messageI18nKey: string, messageI18nOptions?: TOptions) => (error: Error) => void
|
||||||
|
|
||||||
dismissNotification: (notificationUuid: string) => void
|
dismissNotification: (notificationUuid: string) => void
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ export const UiNotificationBoundary: React.FC<PropsWithChildren> = ({ children }
|
||||||
)
|
)
|
||||||
|
|
||||||
const showErrorNotification = useCallback(
|
const showErrorNotification = useCallback(
|
||||||
(messageI18nKey: string, messageI18nOptions?: TOptions | string) =>
|
(messageI18nKey: string, messageI18nOptions?: TOptions) =>
|
||||||
(error: Error): void => {
|
(error: Error): void => {
|
||||||
log.error(t(messageI18nKey, messageI18nOptions), error)
|
log.error(t(messageI18nKey, messageI18nOptions), error)
|
||||||
void dispatchUiNotification('common.errorOccurred', messageI18nKey, {
|
void dispatchUiNotification('common.errorOccurred', messageI18nKey, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue