Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

Select the types of activity you want to include in your feed.

at a876aae44ea07494ebea9727350aa060b81f317b 80 lines 2.4 kB view raw
1import {useCallback} from 'react' 2import {View} from 'react-native' 3import {msg} from '@lingui/core/macro' 4import {useLingui} from '@lingui/react' 5 6import {type ActiveConvoStates} from '#/state/messages/convo' 7import {useModerationOpts} from '#/state/preferences/moderation-opts' 8import {useSession} from '#/state/session' 9import {atoms as a, useTheme} from '#/alf' 10import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt' 11import {KnownFollowers} from '#/components/KnownFollowers' 12import {usePromptControl} from '#/components/Prompt' 13import {AcceptChatButton, DeleteChatButton, RejectMenu} from './RequestButtons' 14 15export function ChatStatusInfo({convoState}: {convoState: ActiveConvoStates}) { 16 const t = useTheme() 17 const {_} = useLingui() 18 const moderationOpts = useModerationOpts() 19 const {currentAccount} = useSession() 20 const leaveConvoControl = usePromptControl() 21 22 const onAcceptChat = useCallback(() => { 23 convoState.markConvoAccepted() 24 }, [convoState]) 25 26 const otherUser = convoState.recipients.find( 27 user => user.did !== currentAccount?.did, 28 ) 29 30 if (!moderationOpts) { 31 return null 32 } 33 34 return ( 35 <View style={[t.atoms.bg, a.p_lg, a.gap_md, a.align_center]}> 36 {otherUser && ( 37 <KnownFollowers 38 profile={otherUser} 39 moderationOpts={moderationOpts} 40 showIfEmpty 41 /> 42 )} 43 <View style={[a.flex_row, a.gap_md, a.w_full, otherUser && a.pt_sm]}> 44 {otherUser && ( 45 <RejectMenu 46 label={_(msg`Block or report`)} 47 convo={convoState.convo} 48 profile={otherUser} 49 color="negative_subtle" 50 size="small" 51 currentScreen="conversation" 52 /> 53 )} 54 <DeleteChatButton 55 label={_(msg`Delete`)} 56 convo={convoState.convo} 57 color="secondary" 58 size="small" 59 currentScreen="conversation" 60 onPress={leaveConvoControl.open} 61 /> 62 <LeaveConvoPrompt 63 convoId={convoState.convo.id} 64 control={leaveConvoControl} 65 currentScreen="conversation" 66 hasMessages={false} 67 /> 68 </View> 69 <View style={[a.w_full, a.flex_row]}> 70 <AcceptChatButton 71 onAcceptConvo={onAcceptChat} 72 convo={convoState.convo} 73 color="primary_subtle" 74 size="small" 75 currentScreen="conversation" 76 /> 77 </View> 78 </View> 79 ) 80}