This reverts commit 521a764d4f.
This commit is contained in:
@@ -26,7 +26,6 @@ import {
|
|||||||
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
||||||
import * as Hider from '#/components/moderation/Hider'
|
import * as Hider from '#/components/moderation/Hider'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {ButtonProps} from './Button'
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This component is based on `FeedCard` and is tightly coupled with that
|
* This component is based on `FeedCard` and is tightly coupled with that
|
||||||
@@ -49,7 +48,7 @@ const MODLIST = 'app.bsky.graph.defs#modlist'
|
|||||||
type Props = {
|
type Props = {
|
||||||
view: AppBskyGraphDefs.ListView
|
view: AppBskyGraphDefs.ListView
|
||||||
showPinButton?: boolean
|
showPinButton?: boolean
|
||||||
} & Omit<LinkProps, 'to' | 'label' | 'children'>
|
}
|
||||||
|
|
||||||
export function Default(props: Props) {
|
export function Default(props: Props) {
|
||||||
const {view, showPinButton} = props
|
const {view, showPinButton} = props
|
||||||
@@ -83,7 +82,7 @@ export function Link({
|
|||||||
view,
|
view,
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: Props & Pick<ButtonProps, 'children'>) {
|
}: Props & Omit<LinkProps, 'to' | 'label'>) {
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
const href = React.useMemo(() => {
|
const href = React.useMemo(() => {
|
||||||
|
|||||||
@@ -221,15 +221,16 @@ export function QuoteEmbed({
|
|||||||
modui={moderation?.ui('contentList')}
|
modui={moderation?.ui('contentList')}
|
||||||
style={[
|
style={[
|
||||||
a.rounded_md,
|
a.rounded_md,
|
||||||
|
a.p_md,
|
||||||
a.mt_sm,
|
a.mt_sm,
|
||||||
a.border,
|
a.border,
|
||||||
t.atoms.border_contrast_low,
|
t.atoms.border_contrast_low,
|
||||||
style,
|
style,
|
||||||
]}>
|
]}
|
||||||
|
childContainerStyle={[a.pt_sm]}>
|
||||||
<SubtleWebHover hover={hover} />
|
<SubtleWebHover hover={hover} />
|
||||||
<Link
|
<Link
|
||||||
hoverStyle={{borderColor: pal.colors.borderLinkHover}}
|
hoverStyle={{borderColor: pal.colors.borderLinkHover}}
|
||||||
style={[a.p_md, a.pt_sm]}
|
|
||||||
href={itemHref}
|
href={itemHref}
|
||||||
title={itemTitle}
|
title={itemTitle}
|
||||||
onBeforePress={onBeforePress}>
|
onBeforePress={onBeforePress}>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {InteractionManager, StyleProp, View, ViewStyle} from 'react-native'
|
import {
|
||||||
|
InteractionManager,
|
||||||
|
StyleProp,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
ViewStyle,
|
||||||
|
} from 'react-native'
|
||||||
import {MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated'
|
import {MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {
|
import {
|
||||||
@@ -16,6 +22,7 @@ import {
|
|||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
import {HandleRef, measureHandle} from '#/lib/hooks/useHandleRef'
|
import {HandleRef, measureHandle} from '#/lib/hooks/useHandleRef'
|
||||||
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {useLightboxControls} from '#/state/lightbox'
|
import {useLightboxControls} from '#/state/lightbox'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard'
|
import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard'
|
||||||
@@ -248,7 +255,7 @@ export function PostEmbeds({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function MaybeFeedCard({view}: {view: AppBskyFeedDefs.GeneratorView}) {
|
export function MaybeFeedCard({view}: {view: AppBskyFeedDefs.GeneratorView}) {
|
||||||
const t = useTheme()
|
const pal = usePalette('default')
|
||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
const moderation = React.useMemo(() => {
|
const moderation = React.useMemo(() => {
|
||||||
return moderationOpts
|
return moderationOpts
|
||||||
@@ -260,7 +267,7 @@ export function MaybeFeedCard({view}: {view: AppBskyFeedDefs.GeneratorView}) {
|
|||||||
<ContentHider modui={moderation?.ui('contentList')}>
|
<ContentHider modui={moderation?.ui('contentList')}>
|
||||||
<FeedSourceCard
|
<FeedSourceCard
|
||||||
feedUri={view.uri}
|
feedUri={view.uri}
|
||||||
style={[a.border, t.atoms.border_contrast_medium, a.p_md, a.rounded_sm]}
|
style={[pal.view, pal.border, styles.customFeedOuter]}
|
||||||
showLikes
|
showLikes
|
||||||
/>
|
/>
|
||||||
</ContentHider>
|
</ContentHider>
|
||||||
@@ -276,10 +283,38 @@ export function MaybeListCard({view}: {view: AppBskyGraphDefs.ListView}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ContentHider modui={moderation?.ui('contentList')}>
|
<ContentHider modui={moderation?.ui('contentList')}>
|
||||||
<ListCard.Default
|
<View
|
||||||
view={view}
|
style={[
|
||||||
style={[a.border, t.atoms.border_contrast_medium, a.p_md, a.rounded_sm]}
|
a.border,
|
||||||
/>
|
t.atoms.border_contrast_medium,
|
||||||
|
a.p_md,
|
||||||
|
a.rounded_sm,
|
||||||
|
]}>
|
||||||
|
<ListCard.Default view={view} />
|
||||||
|
</View>
|
||||||
</ContentHider>
|
</ContentHider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
altContainer: {
|
||||||
|
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||||
|
borderRadius: 6,
|
||||||
|
paddingHorizontal: 6,
|
||||||
|
paddingVertical: 3,
|
||||||
|
position: 'absolute',
|
||||||
|
right: 6,
|
||||||
|
bottom: 6,
|
||||||
|
},
|
||||||
|
alt: {
|
||||||
|
color: 'white',
|
||||||
|
fontSize: 7,
|
||||||
|
fontWeight: '600',
|
||||||
|
},
|
||||||
|
customFeedOuter: {
|
||||||
|
borderWidth: StyleSheet.hairlineWidth,
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
paddingVertical: 12,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user