Files
frontend-app-authoring/src/generic/utils.js
Braden MacDonald 352ef35ac2 feat: display all child tags in the "bare bones" taxonomy detail page (#703)
Also includes:
- feat: set <title> on taxonomy list page and taxonomy detail page
- fix: display all taxonomies on the list page, even if > 10
- refactor: separate out loading spinner component
2023-11-23 01:44:17 +05:30

17 lines
573 B
JavaScript

import { isEmpty } from 'lodash';
/**
* Generate the string for the page <title>
* @param {string} courseOrSectionName The name of the course, or the section of the MFE that the user is in currently
* @param {string} pageName The name of the current page
* @returns {string} The combined title
*/
const getPageHeadTitle = (courseOrSectionName, pageName) => {
if (isEmpty(courseOrSectionName)) {
return `${pageName} | ${process.env.SITE_NAME}`;
}
return `${pageName} | ${courseOrSectionName} | ${process.env.SITE_NAME}`;
};
export default getPageHeadTitle;