1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import { View , ScrollView } from 'react-native' ;
3
+ import {
4
+ View , ScrollView , Pressable , Linking ,
5
+ } from 'react-native' ;
4
6
import { withOnyx } from 'react-native-onyx' ;
5
7
import Str from 'expensify-common/lib/str' ;
6
8
import _ from 'underscore' ;
@@ -15,13 +17,16 @@ import Button from '../../components/Button';
15
17
import compose from '../../libs/compose' ;
16
18
import ONYXKEYS from '../../ONYXKEYS' ;
17
19
import { invite } from '../../libs/actions/Policy' ;
18
- import TextLink from '../../components/TextLink' ;
19
20
import Growl from '../../libs/Growl' ;
20
21
import ExpensiTextInput from '../../components/ExpensiTextInput' ;
21
22
import FixedFooter from '../../components/FixedFooter' ;
22
23
import KeyboardAvoidingView from '../../components/KeyboardAvoidingView' ;
23
24
import { isSystemUser } from '../../libs/userUtils' ;
24
25
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' ;
25
30
26
31
const propTypes = {
27
32
...withLocalizePropTypes ,
@@ -147,9 +152,37 @@ class WorkspaceInvitePage extends React.Component {
147
152
placeholder = { this . getWelcomeNotePlaceholder ( ) }
148
153
onChangeText = { text => this . setState ( { welcomeNote : text } ) }
149
154
/>
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 >
153
186
</ View >
154
187
</ ScrollView >
155
188
< FixedFooter style = { [ styles . flexGrow0 ] } >
0 commit comments