This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
header_footer_template.jsx
129 lines (117 loc) · 4.01 KB
/
header_footer_template.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import PropTypes from 'prop-types';
import React from 'react';
import {FormattedMessage} from 'react-intl';
export default class NotLoggedIn extends React.PureComponent {
static propTypes = {
/*
* Content of the page
*/
children: PropTypes.object,
/*
* Mattermost configuration
*/
config: PropTypes.object,
};
componentDidMount() {
document.body.classList.add('sticky');
document.getElementById('root').classList.add('container-fluid');
}
componentWillUnmount() {
document.body.classList.remove('sticky');
document.getElementById('root').classList.remove('container-fluid');
}
render() {
const content = [];
if (this.props.config.AboutLink) {
content.push(
<a
key='about_link'
id='about_link'
className='footer-link'
target='_blank'
rel='noopener noreferrer'
href={this.props.config.AboutLink}
>
<FormattedMessage id='web.footer.about'/>
</a>
);
}
if (this.props.config.PrivacyPolicyLink) {
content.push(
<a
key='privacy_link'
id='privacy_link'
className='footer-link'
target='_blank'
rel='noopener noreferrer'
href={this.props.config.PrivacyPolicyLink}
>
<FormattedMessage id='web.footer.privacy'/>
</a>
);
}
if (this.props.config.TermsOfServiceLink) {
content.push(
<a
key='terms_link'
id='terms_link'
className='footer-link'
target='_blank'
rel='noopener noreferrer'
href={this.props.config.TermsOfServiceLink}
>
<FormattedMessage id='web.footer.terms'/>
</a>
);
}
if (this.props.config.HelpLink) {
content.push(
<a
key='help_link'
id='help_link'
className='footer-link'
target='_blank'
rel='noopener noreferrer'
href={this.props.config.HelpLink}
>
<FormattedMessage id='web.footer.help'/>
</a>
);
}
return (
<div className='inner-wrap'>
<div className='row content'>
{this.props.children}
</div>
<div className='row footer'>
<div
id='footer_section'
className='footer-pane col-xs-12'
>
<div className='col-xs-12'>
<span
id='company_name'
className='pull-right footer-site-name'
>
{'Mattermost'}
</span>
</div>
<div className='col-xs-12'>
<span
id='copyright'
className='pull-right footer-link copyright'
>
{`© 2015-${new Date().getFullYear()} Mattermost, Inc.`}
</span>
<span className='pull-right'>
{content}
</span>
</div>
</div>
</div>
</div>
);
}
}