@rhc-shared-components/title-util 1.0.0

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.
Files changed (2) hide show
  1. package/index.js +9 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Red Hat Connect title library
3
+ * @param title {string} Title to set
4
+ * @param postfix {string} Postfix for the SPA title eg: "Red Hat Partner Connect"
5
+ */
6
+ export const SetSPATitle = (title, postfix = "Red Hat Partner Connect") => {
7
+ const titleToSet = `${title} | ${postfix}`;
8
+ if (document.title !== titleToSet) document.title = titleToSet;
9
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@rhc-shared-components/title-util",
3
+ "version": "1.0.0",
4
+ "description": "Title for CTE Apps",
5
+ "main": "index.js",
6
+ "author": "redhatofficial",
7
+ "license": ".",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ }
11
+ }