@digitaldefiance/express-suite-react-components 2.1.42 → 2.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
language?: string;
|
|
1
|
+
interface FCParams<TEnum extends string> {
|
|
2
|
+
componentId: string;
|
|
3
|
+
stringKey: TEnum;
|
|
5
4
|
}
|
|
6
|
-
|
|
5
|
+
declare const TranslatedTitle: <TEnum extends string>({ componentId, stringKey }: FCParams<TEnum>) => null;
|
|
6
|
+
export default TranslatedTitle;
|
|
7
7
|
//# sourceMappingURL=TranslatedTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TranslatedTitle.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/components/TranslatedTitle.tsx"],"names":[],"mappings":"AAKA,UAAU,QAAQ,CAAC,KAAK,SAAS,MAAM;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC;CAClB;AAED,QAAA,MAAM,eAAe,GAAI,KAAK,SAAS,MAAM,EAAE,4BAA4B,QAAQ,CAAC,KAAK,CAAC,KAAG,IAQ5F,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// src/app/components/TranslatedTitle.tsx
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TranslatedTitle = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const contexts_1 = require("../contexts");
|
|
6
|
+
const TranslatedTitle = ({ componentId, stringKey }) => {
|
|
7
|
+
const { t, tComponent, currentLanguage } = (0, contexts_1.useI18n)();
|
|
6
8
|
(0, react_1.useEffect)(() => {
|
|
7
|
-
document.title =
|
|
8
|
-
}, [
|
|
9
|
+
document.title = t(tComponent(componentId, stringKey), undefined, currentLanguage);
|
|
10
|
+
}, [t, tComponent, componentId, stringKey, currentLanguage]);
|
|
9
11
|
return null;
|
|
10
12
|
};
|
|
11
|
-
exports.
|
|
13
|
+
exports.default = TranslatedTitle;
|