-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into dms/deleted-account
* origin/main: Update French localization (#4113) Update Japanese translations (#3886) Update pt-BR localization to latest version (#4009) Update zh-CN translations (#3932) Update zh-TW translations (#4025) Update Korean localization (#4030) Update catalan messages.po (#4079) Update Spanish Localization (#4105) Allow removal of feeds that fail to load (#4121) [🐴] Make message input layout resizing synchronous (#4123) [🐴] Adjust content height whenever the emoji picker keyboard is opened or closed (#4120) Conditionally set chat declaration (#4122) [🐴] Fix load state for disabled chats (#4119) Bump api sdk (#4118) [🐴] Switch back to encouraging users to report messages (#4117) convo button skeleton (#4115) [🐴] Screenreader accessibility actions for individual chat items (#4116) [🐴] DM button on profile (#4097) [🐴] Don't retry sends (#4111)
- Loading branch information
Showing
30 changed files
with
4,348 additions
and
5,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,4 @@ export type ReportDialogProps = { | |
did: string | ||
} | ||
| {type: 'convoMessage'} | ||
| {type: 'convoAccount'} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from 'react' | ||
import {View} from 'react-native' | ||
import {AppBskyActorDefs} from '@atproto/api' | ||
import {msg} from '@lingui/macro' | ||
import {useLingui} from '@lingui/react' | ||
|
||
import {useMaybeConvoForUser} from '#/state/queries/messages/get-convo-for-members' | ||
import {atoms as a, useTheme} from '#/alf' | ||
import {Message_Stroke2_Corner0_Rounded as Message} from '../icons/Message' | ||
import {Link} from '../Link' | ||
import {canBeMessaged} from './util' | ||
|
||
export function MessageProfileButton({ | ||
profile, | ||
}: { | ||
profile: AppBskyActorDefs.ProfileView | ||
}) { | ||
const {_} = useLingui() | ||
const t = useTheme() | ||
|
||
const {data: convoId, isPending} = useMaybeConvoForUser(profile.did) | ||
|
||
if (isPending) { | ||
// show pending state based on declaration | ||
if (canBeMessaged(profile)) { | ||
return ( | ||
<View | ||
testID="dmBtnLoading" | ||
aria-hidden={true} | ||
style={[ | ||
a.justify_center, | ||
a.align_center, | ||
t.atoms.bg_contrast_25, | ||
a.rounded_full, | ||
{width: 36, height: 36}, | ||
]}> | ||
<Message | ||
style={[ | ||
t.atoms.text, | ||
{marginLeft: 1, marginBottom: 1, opacity: 0.3}, | ||
]} | ||
size="md" | ||
/> | ||
</View> | ||
) | ||
} else { | ||
return null | ||
} | ||
} | ||
|
||
if (convoId) { | ||
return ( | ||
<Link | ||
testID="dmBtn" | ||
size="small" | ||
color="secondary" | ||
variant="solid" | ||
shape="round" | ||
label={_(msg`Message ${profile.handle}`)} | ||
to={`/messages/${convoId}`} | ||
style={[a.justify_center, {width: 36, height: 36}]}> | ||
<Message | ||
style={[t.atoms.text, {marginLeft: 1, marginBottom: 1}]} | ||
size="md" | ||
/> | ||
</Link> | ||
) | ||
} else { | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import {msg} from '@lingui/macro' | ||
import {useLingui} from '@lingui/react' | ||
|
||
import {DialogControlProps} from '#/components/Dialog' | ||
import * as Prompt from '#/components/Prompt' | ||
|
||
export function ReportConversationPrompt({ | ||
control, | ||
}: { | ||
control: DialogControlProps | ||
}) { | ||
const {_} = useLingui() | ||
|
||
return ( | ||
<Prompt.Basic | ||
control={control} | ||
title={_(msg`Report conversation`)} | ||
description={_( | ||
msg`To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue.`, | ||
)} | ||
confirmButtonCta={_(msg`I understand`)} | ||
onConfirm={() => {}} | ||
showCancel={false} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.