[Explore] Small fixes (#8145)
* Hover on sugg account * Add subtle hover to all components except feed * Use skeleton states for refetch on focus * Empty results state for sugg users * Filter out pinned posts from feed previews * Add trending header if not top module * Tighten up spacing * Fetch 10 profiles * Update interests copy * Remove refetch on focus * Add PTR * use a map * Update src/screens/Search/modules/ExploreInterestsCard.tsx * fix web double border --------- Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
@@ -34,6 +34,41 @@ const RQKEY_ROOT = 'feed-previews'
|
||||
const RQKEY = (feeds: string[]) => [RQKEY_ROOT, feeds]
|
||||
|
||||
const LIMIT = 8 // sliced to 6, overfetch to account for moderation
|
||||
const PINNED_POST_URIS: Record<string, boolean> = {
|
||||
// 📰 News
|
||||
'at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.post/3lgh27w2ngc2b':
|
||||
true,
|
||||
// Gardening
|
||||
'at://did:plc:5rw2on4i56btlcajojaxwcat/app.bsky.feed.post/3kjorckgcwc27':
|
||||
true,
|
||||
// Web Development Trending
|
||||
'at://did:plc:m2sjv3wncvsasdapla35hzwj/app.bsky.feed.post/3lfaw445axs22':
|
||||
true,
|
||||
// Anime & Manga EN
|
||||
'at://did:plc:tazrmeme4dzahimsykusrwrk/app.bsky.feed.post/3knxx2gmkns2y':
|
||||
true,
|
||||
// 📽️ Film
|
||||
'at://did:plc:2hwwem55ce6djnk6bn62cstr/app.bsky.feed.post/3llhpzhbq7c2g':
|
||||
true,
|
||||
// PopSky
|
||||
'at://did:plc:lfdf4srj43iwdng7jn35tjsp/app.bsky.feed.post/3lbblgly65c2g':
|
||||
true,
|
||||
// Science
|
||||
'at://did:plc:hu2obebw3nhfj667522dahfg/app.bsky.feed.post/3kl33otd6ob2s':
|
||||
true,
|
||||
// Birds! 🦉
|
||||
'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.post/3lbg4r57yk22d':
|
||||
true,
|
||||
// Astronomy
|
||||
'at://did:plc:xy2zorw2ys47poflotxthlzg/app.bsky.feed.post/3kyzye4lujs2w':
|
||||
true,
|
||||
// What's Cooking 🍽️
|
||||
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3lfqhgvxbqc2q':
|
||||
true,
|
||||
// BookSky 💙📚 #booksky
|
||||
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3kgrm2rw5ww2e':
|
||||
true,
|
||||
}
|
||||
|
||||
export type FeedPreviewItem =
|
||||
| {
|
||||
@@ -181,19 +216,24 @@ export function useFeedPreviews(
|
||||
feedContext: item.feedContext,
|
||||
reason: item.reason,
|
||||
feedPostUri: item.feedPostUri,
|
||||
items: item.items.slice(0, 6).map((subItem, i) => {
|
||||
const feedPostSliceItem: FeedPostSliceItem = {
|
||||
_reactKey: `${item._reactKey}-${i}-${subItem.post.uri}`,
|
||||
uri: subItem.post.uri,
|
||||
post: subItem.post,
|
||||
record: subItem.record,
|
||||
moderation: moderations[i],
|
||||
parentAuthor: subItem.parentAuthor,
|
||||
isParentBlocked: subItem.isParentBlocked,
|
||||
isParentNotFound: subItem.isParentNotFound,
|
||||
}
|
||||
return feedPostSliceItem
|
||||
}),
|
||||
items: item.items
|
||||
.slice(0, 6)
|
||||
.filter(subItem => {
|
||||
return !PINNED_POST_URIS[subItem.post.uri]
|
||||
})
|
||||
.map((subItem, i) => {
|
||||
const feedPostSliceItem: FeedPostSliceItem = {
|
||||
_reactKey: `${item._reactKey}-${i}-${subItem.post.uri}`,
|
||||
uri: subItem.post.uri,
|
||||
post: subItem.post,
|
||||
record: subItem.record,
|
||||
moderation: moderations[i],
|
||||
parentAuthor: subItem.parentAuthor,
|
||||
isParentBlocked: subItem.isParentBlocked,
|
||||
isParentNotFound: subItem.isParentNotFound,
|
||||
}
|
||||
return feedPostSliceItem
|
||||
}),
|
||||
}
|
||||
if (slice.isIncompleteThread && slice.items.length >= 3) {
|
||||
const beforeLast = slice.items.length - 2
|
||||
|
||||
@@ -20,8 +20,7 @@ export function useGetSuggestedFeedsQuery() {
|
||||
|
||||
return useQuery({
|
||||
enabled: !!preferences,
|
||||
refetchOnWindowFocus: true,
|
||||
staleTime: STALE.MINUTES.ONE,
|
||||
staleTime: STALE.MINUTES.THREE,
|
||||
queryKey: createGetSuggestedFeedsQueryKey(),
|
||||
queryFn: async () => {
|
||||
const contentLangs = getContentLanguages().join(',')
|
||||
|
||||
@@ -27,14 +27,14 @@ export function useGetSuggestedUsersQuery(props: QueryProps) {
|
||||
|
||||
return useQuery({
|
||||
enabled: !!preferences,
|
||||
refetchOnWindowFocus: true,
|
||||
staleTime: STALE.MINUTES.ONE,
|
||||
staleTime: STALE.MINUTES.THREE,
|
||||
queryKey: createGetSuggestedUsersQueryKey(props),
|
||||
queryFn: async () => {
|
||||
const contentLangs = getContentLanguages().join(',')
|
||||
const {data} = await agent.app.bsky.unspecced.getSuggestedUsers(
|
||||
{
|
||||
category: props.category ?? undefined,
|
||||
limit: 10,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
|
||||
@@ -25,7 +25,6 @@ export function useGetTrendsQuery() {
|
||||
|
||||
return useQuery({
|
||||
enabled: !!preferences,
|
||||
refetchOnWindowFocus: true,
|
||||
staleTime: STALE.MINUTES.THREE,
|
||||
queryKey: createGetTrendsQueryKey(),
|
||||
queryFn: async () => {
|
||||
|
||||
@@ -20,8 +20,7 @@ export function useSuggestedStarterPacksQuery() {
|
||||
|
||||
return useQuery({
|
||||
enabled: !!preferences,
|
||||
refetchOnWindowFocus: true,
|
||||
staleTime: STALE.MINUTES.ONE,
|
||||
staleTime: STALE.MINUTES.THREE,
|
||||
queryKey: createSuggestedStarterPacksQueryKey(),
|
||||
async queryFn() {
|
||||
const {data} = await agent.app.bsky.unspecced.getSuggestedStarterPacks(
|
||||
|
||||
Reference in New Issue
Block a user