Some styling tweaks
This commit is contained in:
@@ -59,7 +59,6 @@ import {List} from '#/view/com/util/List'
|
|||||||
import {Text} from '#/view/com/util/text/Text'
|
import {Text} from '#/view/com/util/text/Text'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
import {CenteredView, ScrollView} from '#/view/com/util/Views'
|
import {CenteredView, ScrollView} from '#/view/com/util/Views'
|
||||||
import {KNOWN_AUTHED_ONLY_FEEDS} from '#/view/screens/Feeds'
|
|
||||||
import {SearchLinkCard, SearchProfileCard} from '#/view/shell/desktop/Search'
|
import {SearchLinkCard, SearchProfileCard} from '#/view/shell/desktop/Search'
|
||||||
import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
|
import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
|
||||||
import {
|
import {
|
||||||
@@ -145,22 +144,15 @@ function SuggestedItemsHeader({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={
|
style={[
|
||||||
isWeb
|
isWeb
|
||||||
? [
|
? [a.flex_row, a.px_lg, a.py_lg, a.gap_md]
|
||||||
a.flex_row,
|
: [{flexDirection: 'row-reverse'}, a.p_lg, a.gap_md],
|
||||||
a.px_lg,
|
{
|
||||||
a.py_lg,
|
borderBottomWidth: 4,
|
||||||
a.gap_md,
|
borderColor: t.palette.primary_500,
|
||||||
t.atoms.border_contrast_low,
|
},
|
||||||
]
|
]}>
|
||||||
: [
|
|
||||||
{flexDirection: 'row-reverse'},
|
|
||||||
a.p_lg,
|
|
||||||
a.gap_md,
|
|
||||||
t.atoms.border_contrast_low,
|
|
||||||
]
|
|
||||||
}>
|
|
||||||
<View style={[a.flex_1, a.gap_xs]}>
|
<View style={[a.flex_1, a.gap_xs]}>
|
||||||
<Text style={[a.flex_1, a.text_2xl, a.font_bold, t.atoms.text]}>
|
<Text style={[a.flex_1, a.text_2xl, a.font_bold, t.atoms.text]}>
|
||||||
{title}
|
{title}
|
||||||
@@ -223,7 +215,7 @@ function ExploreScreen() {
|
|||||||
isFetchingNextPage: isFetchingNextProfilesPage,
|
isFetchingNextPage: isFetchingNextProfilesPage,
|
||||||
error: profilesError,
|
error: profilesError,
|
||||||
fetchNextPage: fetchNextProfilesPage,
|
fetchNextPage: fetchNextProfilesPage,
|
||||||
} = useSuggestedFollowsQuery({limit: 4})
|
} = useSuggestedFollowsQuery({limit: 3})
|
||||||
const {
|
const {
|
||||||
data: feeds,
|
data: feeds,
|
||||||
hasNextPage: hasNextFeedsPage,
|
hasNextPage: hasNextFeedsPage,
|
||||||
@@ -231,7 +223,7 @@ function ExploreScreen() {
|
|||||||
isFetchingNextPage: isFetchingNextFeedsPage,
|
isFetchingNextPage: isFetchingNextFeedsPage,
|
||||||
error: feedsError,
|
error: feedsError,
|
||||||
fetchNextPage: fetchNextFeedsPage,
|
fetchNextPage: fetchNextFeedsPage,
|
||||||
} = useGetPopularFeedsQuery({limit: 4})
|
} = useGetPopularFeedsQuery({limit: 3})
|
||||||
|
|
||||||
const isLoadingMoreProfiles = isFetchingNextProfilesPage && !isLoadingProfiles
|
const isLoadingMoreProfiles = isFetchingNextProfilesPage && !isLoadingProfiles
|
||||||
const onLoadMoreProfiles = React.useCallback(async () => {
|
const onLoadMoreProfiles = React.useCallback(async () => {
|
||||||
@@ -319,26 +311,10 @@ function ExploreScreen() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (feeds && preferences) {
|
if (feeds && preferences) {
|
||||||
const filtered = feeds.pages.map(page => {
|
|
||||||
page.feeds = page.feeds.filter(feed => {
|
|
||||||
if (!hasSession && KNOWN_AUTHED_ONLY_FEEDS.includes(feed.uri)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const alreadySaved = Boolean(
|
|
||||||
preferences?.savedFeeds?.find(f => {
|
|
||||||
return f.value === feed.uri
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
return !alreadySaved
|
|
||||||
})
|
|
||||||
|
|
||||||
return page
|
|
||||||
})
|
|
||||||
|
|
||||||
// Currently the responses contain duplicate items.
|
// Currently the responses contain duplicate items.
|
||||||
// Needs to be fixed on backend, but let's dedupe to be safe.
|
// Needs to be fixed on backend, but let's dedupe to be safe.
|
||||||
let seen = new Set()
|
let seen = new Set()
|
||||||
for (const page of filtered) {
|
for (const page of feeds.pages) {
|
||||||
for (const feed of page.feeds) {
|
for (const feed of page.feeds) {
|
||||||
if (!seen.has(feed.uri)) {
|
if (!seen.has(feed.uri)) {
|
||||||
seen.add(feed.uri)
|
seen.add(feed.uri)
|
||||||
@@ -397,7 +373,6 @@ function ExploreScreen() {
|
|||||||
return i
|
return i
|
||||||
}, [
|
}, [
|
||||||
_,
|
_,
|
||||||
hasSession,
|
|
||||||
profiles,
|
profiles,
|
||||||
feeds,
|
feeds,
|
||||||
preferences,
|
preferences,
|
||||||
@@ -437,7 +412,7 @@ function ExploreScreen() {
|
|||||||
}
|
}
|
||||||
case 'loadMore': {
|
case 'loadMore': {
|
||||||
return (
|
return (
|
||||||
<View style={[a.border_t, t.atoms.border_contrast_low]}>
|
<View style={[a.border_t, a.pb_md, t.atoms.border_contrast_low]}>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Load more`)}
|
label={_(msg`Load more`)}
|
||||||
onPress={item.onLoadMore}
|
onPress={item.onLoadMore}
|
||||||
@@ -505,9 +480,10 @@ function ExploreScreen() {
|
|||||||
<TextNewText
|
<TextNewText
|
||||||
style={[
|
style={[
|
||||||
a.pl_sm,
|
a.pl_sm,
|
||||||
|
a.leading_snug,
|
||||||
hovered ? t.atoms.text : t.atoms.text_contrast_medium,
|
hovered ? t.atoms.text : t.atoms.text_contrast_medium,
|
||||||
]}>
|
]}>
|
||||||
<Trans>Load more suggestions like these</Trans>
|
<Trans>Load more suggestions</Trans>
|
||||||
</TextNewText>
|
</TextNewText>
|
||||||
|
|
||||||
<View style={[a.flex_1, a.align_end]}>
|
<View style={[a.flex_1, a.align_end]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user