summaryrefslogtreecommitdiffstats
path: root/webapp/components/header_footer_template.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-07-25 20:03:15 -0400
committerCorey Hulen <corey@hulen.com>2016-07-25 16:03:15 -0800
commitc56b429e1dee257bac69de1db55cafee01ccd005 (patch)
tree50e8cc442ac6bcc34766bc045f5c8e8b6106b6ad /webapp/components/header_footer_template.jsx
parent426b14d8a9dfbec152dde6f75c5ec3b0a903af92 (diff)
downloadchat-c56b429e1dee257bac69de1db55cafee01ccd005.tar.gz
chat-c56b429e1dee257bac69de1db55cafee01ccd005.tar.bz2
chat-c56b429e1dee257bac69de1db55cafee01ccd005.zip
Removed Legal & Support settings from UI if empty (#3662)
Diffstat (limited to 'webapp/components/header_footer_template.jsx')
-rw-r--r--webapp/components/header_footer_template.jsx95
1 files changed, 59 insertions, 36 deletions
diff --git a/webapp/components/header_footer_template.jsx b/webapp/components/header_footer_template.jsx
index 8267c73c5..1c9591dbf 100644
--- a/webapp/components/header_footer_template.jsx
+++ b/webapp/components/header_footer_template.jsx
@@ -16,6 +16,64 @@ export default class NotLoggedIn extends React.Component {
$('#root').removeClass('container-fluid');
}
render() {
+ let content = [];
+
+ if (global.window.mm_config.HelpLink) {
+ content.push(
+ <a
+ id='help_link'
+ className='pull-right footer-link'
+ target='_blank'
+ rel='noopener noreferrer'
+ href={global.window.mm_config.HelpLink}
+ >
+ <FormattedMessage id='web.footer.help'/>
+ </a>
+ );
+ }
+
+ if (global.window.mm_config.TermsOfServiceLink) {
+ content.push(
+ <a
+ id='terms_link'
+ className='pull-right footer-link'
+ target='_blank'
+ rel='noopener noreferrer'
+ href={global.window.mm_config.TermsOfServiceLink}
+ >
+ <FormattedMessage id='web.footer.terms'/>
+ </a>
+ );
+ }
+
+ if (global.window.mm_config.PrivacyPolicyLink) {
+ content.push(
+ <a
+ id='privacy_link'
+ className='pull-right footer-link'
+ target='_blank'
+ rel='noopener noreferrer'
+ href={global.window.mm_config.PrivacyPolicyLink}
+ >
+ <FormattedMessage id='web.footer.privacy'/>
+ </a>
+ );
+ }
+
+ if (global.window.mm_config.AboutLink) {
+ content.push(
+ <a
+ id='about_link'
+ className='pull-right footer-link'
+ target='_blank'
+ rel='noopener noreferrer'
+ href={global.window.mm_config.AboutLink}
+ >
+ <FormattedMessage id='web.footer.about'/>
+ </a>
+ );
+ }
+
return (
<div className='inner-wrap'>
<div className='row content'>
@@ -29,42 +87,7 @@ export default class NotLoggedIn extends React.Component {
</div>
<div className='col-xs-12'>
<span className='pull-right footer-link copyright'>{'© 2015-2016 Mattermost, Inc.'}</span>
- <a
- id='help_link'
- className='pull-right footer-link'
- target='_blank'
- rel='noopener noreferrer'
- href={global.window.mm_config.HelpLink}
- >
- <FormattedMessage id='web.footer.help'/>
- </a>
- <a
- id='terms_link'
- className='pull-right footer-link'
- target='_blank'
- rel='noopener noreferrer'
- href={global.window.mm_config.TermsOfServiceLink}
- >
- <FormattedMessage id='web.footer.terms'/>
- </a>
- <a
- id='privacy_link'
- className='pull-right footer-link'
- target='_blank'
- rel='noopener noreferrer'
- href={global.window.mm_config.PrivacyPolicyLink}
- >
- <FormattedMessage id='web.footer.privacy'/>
- </a>
- <a
- id='about_link'
- className='pull-right footer-link'
- target='_blank'
- rel='noopener noreferrer'
- href={global.window.mm_config.AboutLink}
- >
- <FormattedMessage id='web.footer.about'/>
- </a>
+ {content}
</div>
</div>
</div>