diff options
author | dan <dan.abramov@gmail.com> | 2024-06-22 02:11:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-22 02:11:39 +0300 |
commit | 7db8dd8980c71e189315d89289196820db8b7875 (patch) | |
tree | 4728018a04bce1aa416263eff0f9c4a9d2483022 /src/view | |
parent | 707ea5bf062755d4fd3a9476a4457cdc9d4991b7 (diff) | |
download | voidsky-7db8dd8980c71e189315d89289196820db8b7875.tar.zst |
Add debug feedContext label (#4598)
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/util/post-ctrls/PostCtrls.tsx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx index 472ce4043..231808bf2 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -6,6 +6,7 @@ import { View, type ViewStyle, } from 'react-native' +import * as Clipboard from 'expo-clipboard' import { AppBskyFeedDefs, AppBskyFeedPost, @@ -19,6 +20,7 @@ import {POST_CTRL_HITSLOP} from '#/lib/constants' import {useHaptics} from '#/lib/haptics' import {makeProfileLink} from '#/lib/routes/links' import {shareUrl} from '#/lib/sharing' +import {useGate} from '#/lib/statsig/statsig' import {toShareUrl} from '#/lib/strings/url-helpers' import {s} from '#/lib/styles' import {Shadow} from '#/state/cache/types' @@ -41,6 +43,7 @@ import * as Prompt from '#/components/Prompt' import {PostDropdownBtn} from '../forms/PostDropdownBtn' import {formatCount} from '../numeric/format' import {Text} from '../text/Text' +import * as Toast from '../Toast' import {RepostButton} from './RepostButton' let PostCtrls = ({ @@ -75,6 +78,7 @@ let PostCtrls = ({ const loggedOutWarningPromptControl = useDialogControl() const {sendInteraction} = useFeedFeedbackContext() const playHaptic = useHaptics() + const gate = useGate() const shouldShowLoggedOutWarning = React.useMemo(() => { return ( @@ -329,6 +333,31 @@ let PostCtrls = ({ timestamp={post.indexedAt} /> </View> + {gate('debug_show_feedcontext') && feedContext && ( + <Pressable + accessible={false} + style={{ + position: 'absolute', + top: 0, + bottom: 0, + right: 0, + display: 'flex', + justifyContent: 'center', + }} + onPress={e => { + e.stopPropagation() + Clipboard.setStringAsync(feedContext) + Toast.show(_(msg`Copied to clipboard`)) + }}> + <Text + style={{ + color: t.palette.contrast_400, + fontSize: 7, + }}> + {feedContext} + </Text> + </Pressable> + )} </View> ) } |