forked from abner/for-legacy-web
Implement new auto-size text area.
Add bars + header + sidebar to channels.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IntlContext } from "preact-i18n";
|
||||
import { IntlContext, translate } from "preact-i18n";
|
||||
import { useContext } from "preact/hooks";
|
||||
import { Children } from "../types/Preact";
|
||||
|
||||
@@ -52,3 +52,8 @@ export function TextReact({ id, fields }: Props) {
|
||||
|
||||
return <>{ recursiveReplaceFields(entry as string, fields) }</>;
|
||||
}
|
||||
|
||||
export function useTranslation() {
|
||||
const { intl } = useContext(IntlContext) as unknown as IntlType;
|
||||
return (id: string, fields?: Object, plural?: number, fallback?: string) => translate(id, "", intl.dictionary, fields, plural, fallback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user