Skip to content

Commit 954d86f

Browse files
committed
Clicking on the image launches it in browser
Helps with #34
1 parent cd35b4c commit 954d86f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/AiResponse.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type {PropsWithChildren} from 'react';
33
import {
44
ActivityIndicator,
55
Button,
6-
Pressable,
76
Image,
7+
Linking,
8+
Pressable,
89
Text,
910
View,
1011
} from 'react-native';
@@ -29,10 +30,13 @@ function AiImageResponse({imageUrl, prompt, rejectImage}: AiImageResponseProps):
2930
const styles = React.useContext(StylesContext);
3031
return (
3132
<View style={[styles.horizontalContainer, {flexWrap: 'nowrap', alignItems: 'flex-start'}]}>
32-
<Image
33-
source={{uri: imageUrl}}
34-
alt={prompt}
35-
style={[{flexGrow: 0}, styles.dalleImage]}/>
33+
<Pressable
34+
onPress={() => Linking.openURL(imageUrl)}>
35+
<Image
36+
source={{uri: imageUrl}}
37+
alt={prompt}
38+
style={styles.dalleImage}/>
39+
</Pressable>
3640
<View
3741
style={{flexShrink: 1, gap: 8}}>
3842
<Text>Here is an image created using the following requirements "{prompt}"</Text>

0 commit comments

Comments
 (0)