Add debug feedContext label (#4598)
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user