Skip to content

Commit 6a4f898

Browse files
authored
Merge pull request #5400 from Expensify/cmartins-privacyPolicy
Fix Privacy link on Invite People page
2 parents ab25a02 + 22b8a02 commit 6a4f898

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

src/pages/workspace/WorkspaceInvitePage.js

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import {View, ScrollView} from 'react-native';
3+
import {
4+
View, ScrollView, Pressable, Linking,
5+
} from 'react-native';
46
import {withOnyx} from 'react-native-onyx';
57
import Str from 'expensify-common/lib/str';
68
import _ from 'underscore';
@@ -15,13 +17,16 @@ import Button from '../../components/Button';
1517
import compose from '../../libs/compose';
1618
import ONYXKEYS from '../../ONYXKEYS';
1719
import {invite} from '../../libs/actions/Policy';
18-
import TextLink from '../../components/TextLink';
1920
import Growl from '../../libs/Growl';
2021
import ExpensiTextInput from '../../components/ExpensiTextInput';
2122
import FixedFooter from '../../components/FixedFooter';
2223
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView';
2324
import {isSystemUser} from '../../libs/userUtils';
2425
import {addSMSDomainIfPhoneNumber} from '../../libs/OptionsListUtils';
26+
import Icon from '../../components/Icon';
27+
import {NewWindow} from '../../components/Icon/Expensicons';
28+
import variables from '../../styles/variables';
29+
import CONST from '../../CONST';
2530

2631
const propTypes = {
2732
...withLocalizePropTypes,
@@ -147,9 +152,37 @@ class WorkspaceInvitePage extends React.Component {
147152
placeholder={this.getWelcomeNotePlaceholder()}
148153
onChangeText={text => this.setState({welcomeNote: text})}
149154
/>
150-
<TextLink href="https://use.expensify.com/privacy">
151-
{this.props.translate('common.privacy')}
152-
</TextLink>
155+
<View style={[styles.mt5, styles.alignSelfStart]}>
156+
<Pressable
157+
onPress={(e) => {
158+
e.preventDefault();
159+
Linking.openURL(CONST.PRIVACY_URL);
160+
}}
161+
accessibilityRole="link"
162+
href={CONST.PRIVACY_URL}
163+
>
164+
{({hovered, pressed}) => (
165+
<View style={[styles.flexRow]}>
166+
<Text
167+
style={[
168+
styles.mr1,
169+
styles.label,
170+
(hovered || pressed) ? styles.linkMutedHovered : styles.linkMuted,
171+
]}
172+
>
173+
{this.props.translate('common.privacyPolicy')}
174+
</Text>
175+
<View style={styles.alignSelfCenter}>
176+
<Icon
177+
src={NewWindow}
178+
width={variables.iconSizeSmall}
179+
height={variables.iconSizeSmall}
180+
/>
181+
</View>
182+
</View>
183+
)}
184+
</Pressable>
185+
</View>
153186
</View>
154187
</ScrollView>
155188
<FixedFooter style={[styles.flexGrow0]}>

src/styles/styles.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ const styles = {
5050
color: themeColors.linkHover,
5151
},
5252

53+
linkMuted: {
54+
color: themeColors.textSupporting,
55+
textDecorationColor: themeColors.textSupporting,
56+
fontFamily: fontFamily.GTA,
57+
},
58+
59+
linkMutedHovered: {
60+
color: themeColors.textMutedReversed,
61+
},
62+
5363
h1: {
5464
color: themeColors.heading,
5565
fontFamily: fontFamily.GTA_BOLD,

0 commit comments

Comments
 (0)