Skip to content

Commit

Permalink
Add hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 24, 2024
1 parent c06877c commit 66fb8f3
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"react-native-emojicon": "^1.0.0",
"react-native-gesture-handler": "~2.12.0",
"react-native-htmlview": "^0.16.0",
"react-native-hyperlink": "^0.0.22",
"react-native-ionicons": "^4.6.5",
"react-native-modal-datetime-picker": "^17.1.0",
"react-native-neat-date-picker": "^1.4.12",
Expand Down
17 changes: 14 additions & 3 deletions src/app/(tabs)/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { router } from 'expo-router';
import { useEffect, useState } from 'react';
import { ActivityIndicator, ScrollView, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import Hyperlink from 'react-native-hyperlink';

import styles from './styles';
import ContentCard from '../../../components/ContentCard/ContentCard';
Expand Down Expand Up @@ -162,9 +163,19 @@ function HomeScreen() {
{featuredStoriesHeader != '' &&
featuredStoriesDescription != null &&
featuredStoriesDescription != '' && (
<Text style={[globalStyles.body1, styles.featuredDescription]}>
{featuredStoriesDescription}
</Text>
<Hyperlink
linkStyle={[
globalStyles.body1,
styles.featuredDescriptionLink,
]}
linkDefault={true}
>
<Text
style={[globalStyles.body1, styles.featuredDescription]}
>
{featuredStoriesDescription}
</Text>
</Hyperlink>
)}
<View style={{ marginRight: 24 }}>
{featuredStories.map(story => (
Expand Down
4 changes: 4 additions & 0 deletions src/app/(tabs)/home/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const styles = StyleSheet.create({
marginBottom: 24,
marginRight: 24,
},
featuredDescriptionLink: {
color: 'blue',
textDecorationLine: 'underline',
},
});

export default styles;

0 comments on commit 66fb8f3

Please sign in to comment.