Hide domain if matches handle, new Standard Site icon treatment
This commit is contained in:
@@ -6,7 +6,6 @@ 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,
|
||||
@@ -47,7 +46,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 +59,7 @@ export function StandardSiteMetaRow({
|
||||
|
||||
const items: {key: string; node: ReactNode}[] = []
|
||||
|
||||
if (!highlightedPublisher) {
|
||||
if (!highlightedPublisher && !domainHandleMatch) {
|
||||
items.push({
|
||||
key: 'domain',
|
||||
node: (
|
||||
|
||||
@@ -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 ? (
|
||||
<View>
|
||||
<UserAvatar
|
||||
noBorder
|
||||
@@ -567,6 +569,29 @@ function PublicationIcon({
|
||||
<MediaInsetBorder opaque style={[a.rounded_sm]} />
|
||||
</View>
|
||||
)
|
||||
return (
|
||||
<View style={[a.relative]}>
|
||||
<View
|
||||
style={[
|
||||
a.absolute,
|
||||
a.rounded_full,
|
||||
a.z_10,
|
||||
a.justify_center,
|
||||
a.align_center,
|
||||
t.atoms.bg,
|
||||
{
|
||||
width: 16,
|
||||
height: 16,
|
||||
top: -6,
|
||||
left: -6,
|
||||
},
|
||||
]}>
|
||||
<StandardSite size="xs" fill={t.atoms.text_contrast_medium.color} />
|
||||
<MediaInsetBorder />
|
||||
</View>
|
||||
{icon}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export function PublicationFooter({
|
||||
|
||||
Reference in New Issue
Block a user