From 63c0f8c9fb9c7bba267e1de0c35889fc4d851e62 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 12 Aug 2020 17:54:33 -0500 Subject: [PATCH] Updated PageTitle component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated: - PageTitle component --- .../gabsocial/features/ui/util/page_title.js | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/javascript/gabsocial/features/ui/util/page_title.js b/app/javascript/gabsocial/features/ui/util/page_title.js index 1524e966..3afd571f 100644 --- a/app/javascript/gabsocial/features/ui/util/page_title.js +++ b/app/javascript/gabsocial/features/ui/util/page_title.js @@ -1,16 +1,7 @@ import isEqual from 'lodash.isequal' +import { APP_NAME } from '../../../constants' -export default class PageTitle extends PureComponent { - static propTypes = { - badge: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.string, - ]), - path: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.array, - ]), - } +class PageTitle extends PureComponent { componentDidMount() { this.updatePageTitle(this.props) @@ -23,14 +14,12 @@ export default class PageTitle extends PureComponent { } updatePageTitle = ({ badge, path}) => { - const site = 'Gab' - let realPath = Array.isArray(path) ? path.join(' / ') : path realPath = realPath.trim() const realBadge = !!badge ? `(${badge})` : '' - const title = `${realBadge} ${realPath} / ${site}`.trim() + const title = `${realBadge} ${realPath} / ${APP_NAME}`.trim() document.title = title } @@ -38,4 +27,18 @@ export default class PageTitle extends PureComponent { render() { return null } + } + +PageTitle.propTypes = { + badge: PropTypes.oneOfType([ + PropTypes.number, + PropTypes.string, + ]), + path: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.array, + ]), +} + +export default PageTitle \ No newline at end of file