use a map
This commit is contained in:
@@ -34,30 +34,41 @@ const RQKEY_ROOT = 'feed-previews'
|
|||||||
const RQKEY = (feeds: string[]) => [RQKEY_ROOT, feeds]
|
const RQKEY = (feeds: string[]) => [RQKEY_ROOT, feeds]
|
||||||
|
|
||||||
const LIMIT = 8 // sliced to 6, overfetch to account for moderation
|
const LIMIT = 8 // sliced to 6, overfetch to account for moderation
|
||||||
const PINNED_POST_URIS = [
|
const PINNED_POST_URIS: Record<string, boolean> = {
|
||||||
// 📰 News
|
// 📰 News
|
||||||
'at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.post/3lgh27w2ngc2b',
|
'at://did:plc:kkf4naxqmweop7dv4l2iqqf5/app.bsky.feed.post/3lgh27w2ngc2b':
|
||||||
|
true,
|
||||||
// Gardening
|
// Gardening
|
||||||
'at://did:plc:5rw2on4i56btlcajojaxwcat/app.bsky.feed.post/3kjorckgcwc27',
|
'at://did:plc:5rw2on4i56btlcajojaxwcat/app.bsky.feed.post/3kjorckgcwc27':
|
||||||
|
true,
|
||||||
// Web Development Trending
|
// Web Development Trending
|
||||||
'at://did:plc:m2sjv3wncvsasdapla35hzwj/app.bsky.feed.post/3lfaw445axs22',
|
'at://did:plc:m2sjv3wncvsasdapla35hzwj/app.bsky.feed.post/3lfaw445axs22':
|
||||||
|
true,
|
||||||
// Anime & Manga EN
|
// Anime & Manga EN
|
||||||
'at://did:plc:tazrmeme4dzahimsykusrwrk/app.bsky.feed.post/3knxx2gmkns2y',
|
'at://did:plc:tazrmeme4dzahimsykusrwrk/app.bsky.feed.post/3knxx2gmkns2y':
|
||||||
|
true,
|
||||||
// 📽️ Film
|
// 📽️ Film
|
||||||
'at://did:plc:2hwwem55ce6djnk6bn62cstr/app.bsky.feed.post/3llhpzhbq7c2g',
|
'at://did:plc:2hwwem55ce6djnk6bn62cstr/app.bsky.feed.post/3llhpzhbq7c2g':
|
||||||
|
true,
|
||||||
// PopSky
|
// PopSky
|
||||||
'at://did:plc:lfdf4srj43iwdng7jn35tjsp/app.bsky.feed.post/3lbblgly65c2g',
|
'at://did:plc:lfdf4srj43iwdng7jn35tjsp/app.bsky.feed.post/3lbblgly65c2g':
|
||||||
|
true,
|
||||||
// Science
|
// Science
|
||||||
'at://did:plc:hu2obebw3nhfj667522dahfg/app.bsky.feed.post/3kl33otd6ob2s',
|
'at://did:plc:hu2obebw3nhfj667522dahfg/app.bsky.feed.post/3kl33otd6ob2s':
|
||||||
|
true,
|
||||||
// Birds! 🦉
|
// Birds! 🦉
|
||||||
'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.post/3lbg4r57yk22d',
|
'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.post/3lbg4r57yk22d':
|
||||||
|
true,
|
||||||
// Astronomy
|
// Astronomy
|
||||||
'at://did:plc:xy2zorw2ys47poflotxthlzg/app.bsky.feed.post/3kyzye4lujs2w',
|
'at://did:plc:xy2zorw2ys47poflotxthlzg/app.bsky.feed.post/3kyzye4lujs2w':
|
||||||
|
true,
|
||||||
// What's Cooking 🍽️
|
// What's Cooking 🍽️
|
||||||
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3lfqhgvxbqc2q',
|
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3lfqhgvxbqc2q':
|
||||||
|
true,
|
||||||
// BookSky 💙📚 #booksky
|
// BookSky 💙📚 #booksky
|
||||||
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3kgrm2rw5ww2e',
|
'at://did:plc:geoqe3qls5mwezckxxsewys2/app.bsky.feed.post/3kgrm2rw5ww2e':
|
||||||
]
|
true,
|
||||||
|
}
|
||||||
|
|
||||||
export type FeedPreviewItem =
|
export type FeedPreviewItem =
|
||||||
| {
|
| {
|
||||||
@@ -208,7 +219,7 @@ export function useFeedPreviews(
|
|||||||
items: item.items
|
items: item.items
|
||||||
.slice(0, 6)
|
.slice(0, 6)
|
||||||
.filter(subItem => {
|
.filter(subItem => {
|
||||||
return !PINNED_POST_URIS.includes(subItem.post.uri)
|
return !PINNED_POST_URIS[subItem.post.uri]
|
||||||
})
|
})
|
||||||
.map((subItem, i) => {
|
.map((subItem, i) => {
|
||||||
const feedPostSliceItem: FeedPostSliceItem = {
|
const feedPostSliceItem: FeedPostSliceItem = {
|
||||||
|
|||||||
Reference in New Issue
Block a user