From f071deb00309c277fa1b48ae5c9704684793a8f3 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Wed, 20 Feb 2019 06:08:07 -0800 Subject: [PATCH] [MM-13975] Add Terms of Service and Privacy Policy Links (#2559) * [MM-13975] Add terms of service and privacy policy links * [MM-13975] Address comments --- app/screens/about/about.js | 59 +++++++++++++++++++++++++++++++++++++- assets/base/i18n/en.json | 2 ++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/app/screens/about/about.js b/app/screens/about/about.js index b8c779c92..69aa156a4 100644 --- a/app/screens/about/about.js +++ b/app/screens/about/about.js @@ -51,6 +51,14 @@ export default class About extends PureComponent { Linking.openURL(Config.MobileNoticeURL); }; + handleTermsOfService = () => { + Linking.openURL(this.props.config.TermsOfServiceLink); + }; + + handlePrivacyPolicy = () => { + Linking.openURL(this.props.config.PrivacyPolicyLink); + } + render() { const {theme, config, license} = this.props; const style = getStyleSheet(theme); @@ -173,6 +181,39 @@ export default class About extends PureComponent { ); } + let termsOfService; + if (config.TermsOfServiceLink) { + termsOfService = ( + + ); + } + + let privacyPolicy; + if (config.PrivacyPolicyLink) { + privacyPolicy = ( + + ); + } + + let tosPrivacyHyphen; + if (termsOfService && privacyPolicy) { + tosPrivacyHyphen = ( + + {' - '} + + ); + } + return ( @@ -228,11 +269,16 @@ export default class About extends PureComponent { + + {termsOfService} + {tosPrivacyHyphen} + {privacyPolicy} + { lineHeight: 13, marginBottom: 10, }, + copyrightText: { + marginBottom: 0, + }, + hyphenText: { + marginBottom: 0, + }, + tosPrivacyContainer: { + flex: 1, + flexDirection: 'row', + marginBottom: 10, + }, }; }); diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index e837666d5..676de02eb 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -5,11 +5,13 @@ "about.enterpriseEditionSt": "Modern communication from behind your firewall.", "about.hash": "Build Hash:", "about.hashee": "EE Build Hash:", + "about.privacy": "Privacy Policy", "about.teamEditionLearn": "Join the Mattermost community at ", "about.teamEditionSt": "All your team communication in one place, instantly searchable and accessible anywhere.", "about.teamEditiont0": "Team Edition", "about.teamEditiont1": "Enterprise Edition", "about.title": "About Mattermost", + "about.tos": "Terms of Service", "announcment_banner.dont_show_again": "Don't show again", "api.channel.add_member.added": "{addedUsername} added to the channel by {username}.", "archivedChannelMessage": "You are viewing an **archived channel**. New messages cannot be posted.",