about summary refs log tree commit diff
path: root/src/view/com/post/Post.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r--src/view/com/post/Post.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx
index e8e6781f7..bf8dfed05 100644
--- a/src/view/com/post/Post.tsx
+++ b/src/view/com/post/Post.tsx
@@ -1,6 +1,7 @@
 import React, {useState, useEffect} from 'react'
 import {
   ActivityIndicator,
+  Linking,
   StyleProp,
   StyleSheet,
   View,
@@ -120,6 +121,11 @@ export const Post = observer(function Post({
     Clipboard.setString(record.text)
     Toast.show('Copied to clipboard')
   }
+  const onOpenTranslate = () => {
+    Linking.openURL(
+      encodeURI(`https://translate.google.com/#auto|en|${record?.text || ''}`),
+    )
+  }
   const onDeletePost = () => {
     item.delete().then(
       () => {
@@ -214,6 +220,7 @@ export const Post = observer(function Post({
             onPressToggleRepost={onPressToggleRepost}
             onPressToggleUpvote={onPressToggleUpvote}
             onCopyPostText={onCopyPostText}
+            onOpenTranslate={onOpenTranslate}
             onDeletePost={onDeletePost}
           />
         </View>