// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React, {PropTypes, PureComponent} from 'react';
import {
Linking,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import DeviceInfo from 'react-native-device-info';
import FormattedText from 'app/components/formatted_text';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
import MattermostIcon from 'app/components/mattermost_icon';
export default class About extends PureComponent {
static propTypes = {
config: PropTypes.object.isRequired,
license: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired
};
handleAboutTeam = () => {
Linking.openURL('http://www.mattermost.org/');
};
handleAboutEnterprise = () => {
Linking.openURL('http://about.mattermost.com/');
};
render() {
const {theme, config, license} = this.props;
const style = getStyleSheet(theme);
let title = (
);
let subTitle = (
);
let learnMore = (
{'mattermost.org'}
);
let licensee;
if (config.BuildEnterpriseReady === 'true') {
title = (
);
subTitle = (
);
learnMore = (
{'about.mattermost.com'}
);
if (license.IsLicensed === 'true') {
title = (
);
licensee = (
{'\u00a0' + license.Company}
);
}
}
let serverVersion;
if (config.BuildNumber === config.Version) {
serverVersion = (
);
} else {
serverVersion = (
);
}
return (
{'Mattermost '}
{title}
{subTitle}
{serverVersion}
{licensee}
{learnMore}
{'\u00a0' + config.BuildHash}
{'\u00a0' + config.BuildHashEnterprise}
{'\u00a0' + config.BuildDate}
);
}
}
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return StyleSheet.create({
wrapper: {
flex: 1,
backgroundColor: theme.centerChannelBg
},
scrollView: {
flex: 1,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.03)
},
scrollViewContent: {
paddingBottom: 30
},
logoContainer: {
alignItems: 'center',
flex: 1,
height: 200,
paddingVertical: 40
},
infoContainer: {
flex: 1,
flexDirection: 'column',
paddingHorizontal: 20
},
titleContainer: {
flex: 1,
flexDirection: 'row',
marginBottom: 20
},
title: {
fontSize: 22,
color: theme.centerChannelColor
},
subtitle: {
color: changeOpacity(theme.centerChannelColor, 0.5),
fontSize: 19,
marginBottom: 15
},
learnContainer: {
flex: 1,
flexDirection: 'column',
marginVertical: 20
},
learn: {
color: theme.centerChannelColor,
fontSize: 16
},
learnLink: {
color: theme.linkColor,
fontSize: 16
},
info: {
color: theme.centerChannelColor,
fontSize: 16,
lineHeight: 19
},
licenseContainer: {
flex: 1,
flexDirection: 'row',
marginVertical: 20
},
hashContainer: {
flex: 1,
flexDirection: 'column',
marginVertical: 15
},
footerGroup: {
flex: 1,
flexDirection: 'row'
},
footerText: {
color: changeOpacity(theme.centerChannelColor, 0.5),
fontSize: 11,
lineHeight: 13
}
});
});