refactor: prevent duplicated title for index page by making prop optional

This commit is contained in:
Danny Koppenhagen
2023-06-19 20:35:58 +02:00
committed by Stefan Rotsch
parent 810db6aea6
commit 0d2265c57e
5 changed files with 19 additions and 14 deletions

View File

@@ -5,9 +5,11 @@ exports.radarName = process.env.REACT_APP_RADAR_NAME || "AOE Technology Radar";
exports.radarNameShort = exports.radarName;
exports.titleFormat = process.env.REACT_APP_RADAR_TITLE_FORMAT || "%TECHNOLOGY_NAME% | %APP_TITLE%";
function setTitle(document, title) {
document.title = exports.titleFormat
.replace("%TECHNOLOGY_NAME%", title)
.replace("%APP_TITLE%", exports.radarName);
document.title = title
? exports.titleFormat
.replace("%TECHNOLOGY_NAME%", title)
.replace("%APP_TITLE%", exports.radarName)
: exports.radarName;
}
exports.setTitle = setTitle;
var getItemPageNames = function (items) {