diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-05 15:03:42 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-05 15:03:42 -0600 |
commit | bbe6bf8fc2f94b5f3aad03c7c356e2a34ae6f124 (patch) | |
tree | 971be0dd6871c116de69f0771e3c30f96fdf8ef5 /src/view/com/post/Post.tsx | |
parent | 73c84f6f64d70473da6f77675a00c7e222d4dfee (diff) | |
download | voidsky-bbe6bf8fc2f94b5f3aad03c7c356e2a34ae6f124.tar.zst |
Add 'copy post text' tool
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r-- | src/view/com/post/Post.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 2996991e7..23ec44c6b 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -8,6 +8,7 @@ import { ViewStyle, } from 'react-native' import {observer} from 'mobx-react-lite' +import Clipboard from '@react-native-clipboard/clipboard' import {AtUri} from '../../../third-party/uri' import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' @@ -110,6 +111,10 @@ export const Post = observer(function Post({ .toggleUpvote() .catch(e => console.error('Failed to toggle upvote', record, e)) } + const onCopyPostText = () => { + Clipboard.setString(record.text) + Toast.show('Copied to clipboard') + } const onDeletePost = () => { item.delete().then( () => { @@ -144,6 +149,7 @@ export const Post = observer(function Post({ authorDisplayName={item.author.displayName} timestamp={item.indexedAt} isAuthor={item.author.did === store.me.did} + onCopyPostText={onCopyPostText} onDeletePost={onDeletePost} /> {replyHref !== '' && ( |