From c7cb4b1491c8718a2ff79e8e43531fb76b628f65 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 7 Dec 2020 18:06:46 -0500 Subject: [TMA-405] Website now clickable (#127) * clickable * changed to http --- src/components/profile/ProfileBody.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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 = ({ {`@${username}`} {`${biography}`} - {`${website}`} + { + Linking.openURL( + website.startsWith('http') ? website : 'http://' + website, + ); + }}>{`${website}`} {userXId && !isOwnProfile ? ( {!isBlocked && ( -- cgit v1.2.3-70-g09d2