diff options
author | Ivan Chen <ivan@thetaggid.com> | 2020-12-07 18:06:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 18:06:46 -0500 |
commit | c7cb4b1491c8718a2ff79e8e43531fb76b628f65 (patch) | |
tree | 333dd7ea5f9aed1c9ab1e27a506a06baf1cd6392 /src | |
parent | 0fd892ad288f2e1eaaa4fdf5e1fd6f15dbd45860 (diff) |
[TMA-405] Website now clickable (#127)
* clickable
* changed to http
Diffstat (limited to 'src')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 3c05fc26..dbaf78c9 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -1,5 +1,5 @@ -import React, {useContext} from 'react'; -import {StyleSheet, View, Text, LayoutChangeEvent} from 'react-native'; +import React from 'react'; +import {StyleSheet, View, Text, LayoutChangeEvent, Linking} from 'react-native'; import {TAGG_DARK_BLUE, TOGGLE_BUTTON_TYPE} from '../../constants'; import ToggleButton from './ToggleButton'; import {RootState} from '../../store/rootReducer'; @@ -40,7 +40,13 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ <View onLayout={onLayout} style={styles.container}> <Text style={styles.username}>{`@${username}`}</Text> <Text style={styles.biography}>{`${biography}`}</Text> - <Text style={styles.website}>{`${website}`}</Text> + <Text + style={styles.website} + onPress={() => { + Linking.openURL( + website.startsWith('http') ? website : 'http://' + website, + ); + }}>{`${website}`}</Text> {userXId && !isOwnProfile ? ( <View style={styles.toggleButtonContainer}> {!isBlocked && ( |