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
17 lines
573 B
JavaScript
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;
|