From db2e190f4c74354604d9cec92d76aac3b4b63195 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 9 Jun 2026 15:54:16 -0500 Subject: [PATCH] Hide domain if matches handle, new Standard Site icon treatment (#10767) --- .../StandardSiteEmbed/StandardSiteMetaRow.tsx | 37 ++++--------------- .../Post/Embed/StandardSiteEmbed/index.tsx | 27 +++++++++++++- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx b/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx index 8c1187216c..837f1b4a05 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx +++ b/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx @@ -1,13 +1,10 @@ import {Fragment, type ReactNode} from 'react' import {View} from 'react-native' import {AtUri} from '@atproto/api' -import {Trans, useLingui} from '@lingui/react/macro' +import {Trans} 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, matchStandardSitePublisherByUri, @@ -18,19 +15,15 @@ import { isStandardSitePublicationUri, } from '#/components/Post/Embed/StandardSiteEmbed/utils' import {Text} from '#/components/Typography' -import {useAnalytics} from '#/analytics' export function StandardSiteMetaRow({ type = 'document', - preview, view, }: ssTypes.CommonProps & ssTypes.PreviewProps & { type?: 'document' | 'publication' }) { - const ax = useAnalytics() const t = useTheme() - const {t: l} = useLingui() const highlightedPublisher = !!matchStandardSitePublisher(view) const didsFromRecords = view.associatedRefs @@ -47,7 +40,11 @@ export function StandardSiteMetaRow({ : undefined const articleDomain = toNiceDomain(view.uri) const articlePublisher = matchStandardSitePublisherByUri(view.uri) - const DomainIcon = articlePublisher?.Icon || StandardSite + const domainHandleMatch = + authorProfile?.handle && + (articleDomain === authorProfile.handle || + articleDomain.endsWith(`.${authorProfile.handle}`)) + const DomainIcon = articlePublisher?.Icon const metaTextStyle = [ a.text_xs, a.leading_tight, @@ -56,7 +53,7 @@ export function StandardSiteMetaRow({ const items: {key: string; node: ReactNode}[] = [] - if (!highlightedPublisher) { + if (!highlightedPublisher && !domainHandleMatch) { items.push({ key: 'domain', node: ( @@ -77,25 +74,7 @@ export function StandardSiteMetaRow({ key: 'author', node: ( - - by{' '} - { - e.stopPropagation() - e.preventDefault() - ax.metric('embed:standardSite:authorHandle:press', { - handle: authorProfile.handle, - }) - }}> - @{authorProfile.handle} - - + by @{authorProfile.handle} ), }) diff --git a/src/components/Post/Embed/StandardSiteEmbed/index.tsx b/src/components/Post/Embed/StandardSiteEmbed/index.tsx index b328bc38ff..dc60db53ad 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/index.tsx +++ b/src/components/Post/Embed/StandardSiteEmbed/index.tsx @@ -15,6 +15,7 @@ import {Divider} from '#/components/Divider' import {useInteractionState} from '#/components/hooks/useInteractionState' import {ArrowTopRight_Stroke2_Corner0_Rounded as ArrowTopRightIcon} from '#/components/icons/Arrow' import {Clock_Stroke2_Corner0_Rounded as Clock} from '#/components/icons/Clock' +import {StandardSite} from '#/components/icons/community/StandardSite' import {Link} from '#/components/Link' import {MediaInsetBorder} from '#/components/MediaInsetBorder' import {matchStandardSitePublisher} from '#/components/Post/Embed/StandardSiteEmbed/publishers' @@ -535,8 +536,9 @@ function PublicationIcon({ interacted?: boolean themeColors: ssTypes.ThemeColors }) { + const t = useTheme() if (!view.source) return null - return view.source?.icon ? ( + const icon = view.source?.icon ? ( ) + return ( + + + + + + {icon} + + ) } export function PublicationFooter({