Merge branch 'main' into gif-autoplay
This commit is contained in:
@@ -6,6 +6,7 @@ import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import {makeProfileLink} from '#/lib/routes/links'
|
||||
import {toNiceDomain} from '#/lib/strings/url-helpers'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {StandardSite} from '#/components/icons/community/StandardSite'
|
||||
import {InlineLinkText} from '#/components/Link'
|
||||
import {
|
||||
matchStandardSitePublisher,
|
||||
@@ -46,10 +47,10 @@ export function StandardSiteMetaRow({
|
||||
: undefined
|
||||
const articleDomain = toNiceDomain(view.uri)
|
||||
const articlePublisher = matchStandardSitePublisherByUri(view.uri)
|
||||
const DomainIcon = articlePublisher?.Icon
|
||||
const DomainIcon = articlePublisher?.Icon || StandardSite
|
||||
const metaTextStyle = [
|
||||
a.text_xs,
|
||||
a.leading_snug,
|
||||
a.leading_tight,
|
||||
t.atoms.text_contrast_medium,
|
||||
]
|
||||
|
||||
@@ -59,11 +60,11 @@ export function StandardSiteMetaRow({
|
||||
items.push({
|
||||
key: 'domain',
|
||||
node: (
|
||||
<View style={[a.flex_row, a.align_center]}>
|
||||
<View style={[a.flex_shrink, a.flex_row, a.align_center, a.gap_2xs]}>
|
||||
{DomainIcon && (
|
||||
<DomainIcon size="sm" fill={t.atoms.text_contrast_medium.color} />
|
||||
<DomainIcon size="xs" fill={t.atoms.text_contrast_medium.color} />
|
||||
)}
|
||||
<Text numberOfLines={1} style={metaTextStyle}>
|
||||
<Text numberOfLines={1} style={[metaTextStyle, a.flex_shrink]}>
|
||||
{articleDomain}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -75,7 +76,7 @@ export function StandardSiteMetaRow({
|
||||
items.push({
|
||||
key: 'author',
|
||||
node: (
|
||||
<Text numberOfLines={1} style={metaTextStyle}>
|
||||
<Text numberOfLines={1} style={[metaTextStyle]}>
|
||||
<Trans>
|
||||
by{' '}
|
||||
<InlineLinkText
|
||||
@@ -85,7 +86,9 @@ export function StandardSiteMetaRow({
|
||||
metaTextStyle,
|
||||
preview ? a.pointer_events_none : a.pointer_events_auto,
|
||||
]}
|
||||
onPress={() => {
|
||||
onPress={e => {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
ax.metric('embed:standardSite:authorHandle:press', {
|
||||
handle: authorProfile.handle,
|
||||
})
|
||||
|
||||
@@ -356,7 +356,12 @@ export function PublicationCard({
|
||||
<View style={[a.flex_1, a.gap_2xs]}>
|
||||
<Text
|
||||
numberOfLines={1}
|
||||
style={[a.text_md, a.font_semi_bold, t.atoms.text]}>
|
||||
style={[
|
||||
a.text_md,
|
||||
a.font_semi_bold,
|
||||
t.atoms.text,
|
||||
a.leading_snug,
|
||||
]}>
|
||||
{view.source?.title}
|
||||
</Text>
|
||||
<StandardSiteMetaRow
|
||||
@@ -615,6 +620,7 @@ export function PublicationFooter({
|
||||
style={[
|
||||
a.text_sm,
|
||||
a.font_medium,
|
||||
a.leading_tight,
|
||||
t.atoms.text,
|
||||
interacted && a.underline,
|
||||
]}>
|
||||
|
||||
@@ -9,12 +9,13 @@ import {useLingui} from '@lingui/react/macro'
|
||||
|
||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||
import {makeProfileLink} from '#/lib/routes/links'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useSession} from '#/state/session'
|
||||
import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar'
|
||||
import {useIsWithinSplitView} from '#/screens/Messages/components/splitView/context'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {AvatarBubbles} from '#/components/AvatarBubbles'
|
||||
import {ButtonIcon} from '#/components/Button'
|
||||
import {ConvoMenu} from '#/components/dms/ConvoMenu'
|
||||
@@ -85,6 +86,7 @@ function ProfileHeaderReady({
|
||||
convo: Extract<ConvoWithDetails, {kind: 'direct'}>
|
||||
moderationOpts: ModerationOpts
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const {t: l} = useLingui()
|
||||
const {currentAccount} = useSession()
|
||||
const profile = useProfileShadow(convo.primaryMember)
|
||||
@@ -106,6 +108,7 @@ function ProfileHeaderReady({
|
||||
const displayName = isDeletedAccount
|
||||
? l`Deleted Account`
|
||||
: createSanitizedDisplayName(profile, true, moderation.ui('displayName'))
|
||||
const handle = isDeletedAccount ? null : sanitizeHandle(profile.handle, '@')
|
||||
|
||||
const latestReportableMessage =
|
||||
ChatBskyConvoDefs.isMessageView(convo.view.lastMessage) &&
|
||||
@@ -126,14 +129,23 @@ function ProfileHeaderReady({
|
||||
moderation={moderation.ui('avatar')}
|
||||
disableHoverCard={moderation.blocked}
|
||||
/>
|
||||
<View style={[a.flex_row, a.align_center, a.flex_1]}>
|
||||
<Text
|
||||
style={[a.text_md, a.font_semi_bold, a.flex_shrink]}
|
||||
numberOfLines={1}>
|
||||
{displayName}
|
||||
</Text>
|
||||
<ProfileBadges profile={profile} size="md" style={[a.pl_xs]} />
|
||||
<MuteStatus muted={convo.view.muted} />
|
||||
<View style={[a.flex_1]}>
|
||||
<View style={[a.flex_row, a.align_center, a.flex_1, web(a.mb_2xs)]}>
|
||||
<Text
|
||||
style={[a.text_lg, a.font_semi_bold, a.flex_shrink]}
|
||||
numberOfLines={1}>
|
||||
{displayName}
|
||||
</Text>
|
||||
<ProfileBadges profile={profile} size="md" style={[a.pl_xs]} />
|
||||
<MuteStatus muted={convo.view.muted} />
|
||||
</View>
|
||||
{handle ? (
|
||||
<Text
|
||||
style={[a.text_xs, t.atoms.text_contrast_high]}
|
||||
numberOfLines={1}>
|
||||
{handle}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
</Link>
|
||||
}
|
||||
@@ -185,7 +197,7 @@ function GroupHeaderReady({
|
||||
/>
|
||||
<View style={[a.flex_row, a.flex_1, a.align_center]}>
|
||||
<Text
|
||||
style={[a.text_md, a.font_semi_bold, a.flex_shrink]}
|
||||
style={[a.text_lg, a.font_semi_bold, a.flex_shrink]}
|
||||
numberOfLines={1}>
|
||||
{convo.details.name}
|
||||
</Text>
|
||||
|
||||
@@ -217,7 +217,7 @@ function GroupSettings({
|
||||
type: 'MEMBERS_AND_REQUESTS',
|
||||
key: 'members-and-requests',
|
||||
},
|
||||
...(isOwner
|
||||
...(isOwner && convo.details.lockStatus === 'unlocked'
|
||||
? [{type: 'ADD_MEMBERS_LINK', key: 'add-members-link'} as const]
|
||||
: []),
|
||||
]
|
||||
@@ -457,7 +457,7 @@ function SettingsHeader({
|
||||
]}>
|
||||
<SettingsButton
|
||||
color={convo.view.muted ? 'negative_subtle' : 'secondary'}
|
||||
disabled={!isReady || isMuting}
|
||||
disabled={!isReady || isMuting || lockStatus !== 'unlocked'}
|
||||
icon={convo.view.muted ? BellOffIcon : BellIcon}
|
||||
label={
|
||||
convo.view.muted
|
||||
@@ -469,7 +469,7 @@ function SettingsHeader({
|
||||
/>
|
||||
{isOwner ? (
|
||||
<SettingsButton
|
||||
disabled={!isReady || isEditingName}
|
||||
disabled={!isReady || isEditingName || lockStatus !== 'unlocked'}
|
||||
icon={EditIcon}
|
||||
label={l`Edit this group chat’s name`}
|
||||
text={l`Edit name`}
|
||||
|
||||
@@ -83,7 +83,9 @@ export function MessagesListGroupInfoPanel({
|
||||
)
|
||||
}
|
||||
|
||||
const showButtons = isOwner || isJoinLinkEnabled
|
||||
const isLocked = convo.details.lockStatus !== 'unlocked'
|
||||
|
||||
const showButtons = !isLocked && (isOwner || isJoinLinkEnabled)
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user