From a13079b715b4808cac26f02477161228bf9a23e4 Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Wed, 25 Oct 2017 12:24:22 -0700 Subject: [PATCH] White label about modal. Move strings to config. (#943) * White label about modal. Move strings to config. * Refactor styling and add powered by Mattermost * Review feedback * Use full bundle ids for about modal check --- .../{mattermost_icon.js => app_icon.js} | 0 .../post_profile_picture.js | 4 +- app/screens/about/about.js | 47 ++++++++++++------- assets/base/config.json | 4 ++ assets/base/i18n/en.json | 2 + 5 files changed, 37 insertions(+), 20 deletions(-) rename app/components/{mattermost_icon.js => app_icon.js} (100%) diff --git a/app/components/mattermost_icon.js b/app/components/app_icon.js similarity index 100% rename from app/components/mattermost_icon.js rename to app/components/app_icon.js diff --git a/app/components/post_profile_picture/post_profile_picture.js b/app/components/post_profile_picture/post_profile_picture.js index b58e74878..2b3162250 100644 --- a/app/components/post_profile_picture/post_profile_picture.js +++ b/app/components/post_profile_picture/post_profile_picture.js @@ -5,7 +5,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Image, TouchableOpacity, View} from 'react-native'; -import MattermostIcon from 'app/components/mattermost_icon'; +import AppIcon from 'app/components/app_icon'; import ProfilePicture from 'app/components/profile_picture'; import {emptyFunction} from 'app/utils/general'; import webhookIcon from 'assets/images/icons/webhook.jpg'; @@ -25,7 +25,7 @@ function PostProfilePicture(props) { if (isSystemMessage) { return ( - { - Linking.openURL('http://www.mattermost.org/'); + Linking.openURL(Config.AboutTeamURL); }; handleAboutEnterprise = () => { - Linking.openURL('http://about.mattermost.com/'); + Linking.openURL(Config.AboutEnterpriseURL); }; handlePlatformNotice = () => { @@ -73,7 +75,7 @@ export default class About extends PureComponent { onPress={this.handleAboutTeam} > - {'mattermost.org'} + {Config.TeamEditionLearnURL} @@ -108,7 +110,7 @@ export default class About extends PureComponent { onPress={this.handleAboutEnterprise} > - {'about.mattermost.com'} + {Config.EELearnURL} @@ -126,13 +128,13 @@ export default class About extends PureComponent { licensee = ( - - {'\u00a0' + license.Company} - ); } @@ -172,7 +174,7 @@ export default class About extends PureComponent { contentContainerStyle={style.scrollViewContent} > - - {'Mattermost '} + {`${config.SiteName} `} {title} @@ -206,6 +208,16 @@ export default class About extends PureComponent { /> {licensee} {learnMore} + {!MATTERMOST_BUNDLE_IDS.includes(DeviceInfo.getBundleId()) && + + } { licenseContainer: { flex: 1, flexDirection: 'row', - marginVertical: 20 + marginTop: 20 }, noticeContainer: { flex: 1, - flexDirection: 'column', - marginTop: 10 + flexDirection: 'column' }, noticeLink: { color: theme.linkColor, @@ -353,8 +364,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }, hashContainer: { flex: 1, - flexDirection: 'column', - marginVertical: 15 + flexDirection: 'column' }, footerGroup: { flex: 1, @@ -363,7 +373,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { footerText: { color: changeOpacity(theme.centerChannelColor, 0.5), fontSize: 11, - lineHeight: 13 + lineHeight: 13, + marginBottom: 10 } }; }); diff --git a/assets/base/config.json b/assets/base/config.json index 40803194e..c9ac6addc 100644 --- a/assets/base/config.json +++ b/assets/base/config.json @@ -4,6 +4,10 @@ "DefaultTheme": "default", "ShowErrorsList": false, "MinServerVersion": "4.0.0", + "EELearnURL": "about.mattermost.com", + "TeamEditionLearnURL": "mattermost.org", + "AboutTeamURL": "http://www.mattermost.org/", + "AboutEnterpriseURL": "http://about.mattermost.com/", "PlatformNoticeURL": "https://about.mattermost.com/platform-notice-txt/", "MobileNoticeURL": "https://about.mattermost.com/mobile-notice-txt/", "SegmentApiKey": "3MT7rAoC0OP7yy3ThzqFSAtKzmzqtUPX", diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index 15a286ec3..d054187c1 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -1865,6 +1865,8 @@ "mobile.about.appVersion": "App Version: {version} (Build {number})", "mobile.about.copyright": "Copyright 2015-{currentYear} Mattermost, Inc. All rights reserved", "mobile.about.database": "Database: {type}", + "mobile.about.licensed": "Licensed to: {company}", + "mobile.about.powered_by": "{site} is powered by Mattermost", "mobile.about.serverVersion": "Server Version: {version} (Build {number})", "mobile.about.serverVersionNoBuild": "Server Version: {version}", "mobile.account.notifications.email.footer": "When offline or away for more than five minutes",