From 2f4408582bf27a83ba8d22605077d067f8433d7c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 18 May 2023 15:06:32 -0500 Subject: Set default feeds --- src/lib/constants.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 6d0d4797b..88e429d83 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -94,6 +94,49 @@ export function SUGGESTED_FOLLOWS(serviceUrl: string) { } } +export const STAGING_DEFAULT_FEED = (rkey: string) => + `at://did:plc:wqzurwm3kmaig6e6hnc2gqwo/app.bsky.feed.generator/${rkey}` +export const PROD_DEFAULT_FEED = (rkey: string) => + `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/${rkey}` +export async function DEFAULT_FEEDS( + serviceUrl: string, + resolveHandle: (name: string) => Promise, +) { + if (serviceUrl.includes('localhost')) { + const aliceDid = await resolveHandle('alice.test') + return { + pinned: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], + saved: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], + } + } else if (serviceUrl.includes('staging')) { + return { + pinned: [ + STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('whats-hot'), + ], + saved: [ + STAGING_DEFAULT_FEED('bsky-team'), + STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('whats-hot'), + STAGING_DEFAULT_FEED('hot-classic'), + ], + } + } else { + return { + pinned: [ + STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('whats-hot'), + ], + saved: [ + STAGING_DEFAULT_FEED('bsky-team'), + STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('whats-hot'), + STAGING_DEFAULT_FEED('hot-classic'), + ], + } + } +} + export const POST_IMG_MAX = { width: 2000, height: 2000, -- cgit 1.4.1 From 37acc9e9304b594ff21443e1be896e1e576bb488 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 18 May 2023 18:22:46 -0500 Subject: A few more UX tweaks --- src/lib/constants.ts | 14 ++++-------- src/view/com/feeds/SavedFeeds.tsx | 39 ++++++++++++++++++++++++-------- src/view/com/pager/FeedsTabBar.web.tsx | 2 +- src/view/com/pager/FeedsTabBarMobile.tsx | 2 +- 4 files changed, 36 insertions(+), 21 deletions(-) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 88e429d83..f4c6f5021 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -110,26 +110,20 @@ export async function DEFAULT_FEEDS( } } else if (serviceUrl.includes('staging')) { return { - pinned: [ - STAGING_DEFAULT_FEED('skyline'), - STAGING_DEFAULT_FEED('whats-hot'), - ], + pinned: [STAGING_DEFAULT_FEED('whats-hot')], saved: [ STAGING_DEFAULT_FEED('bsky-team'), - STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('with-friends'), STAGING_DEFAULT_FEED('whats-hot'), STAGING_DEFAULT_FEED('hot-classic'), ], } } else { return { - pinned: [ - STAGING_DEFAULT_FEED('skyline'), - STAGING_DEFAULT_FEED('whats-hot'), - ], + pinned: [STAGING_DEFAULT_FEED('whats-hot')], saved: [ STAGING_DEFAULT_FEED('bsky-team'), - STAGING_DEFAULT_FEED('skyline'), + STAGING_DEFAULT_FEED('with-friends'), STAGING_DEFAULT_FEED('whats-hot'), STAGING_DEFAULT_FEED('hot-classic'), ], diff --git a/src/view/com/feeds/SavedFeeds.tsx b/src/view/com/feeds/SavedFeeds.tsx index 110a6e894..e92e741da 100644 --- a/src/view/com/feeds/SavedFeeds.tsx +++ b/src/view/com/feeds/SavedFeeds.tsx @@ -8,7 +8,7 @@ import {FlatList} from 'view/com/util/Views' import {Text} from 'view/com/util/text/Text' import {isDesktopWeb} from 'platform/detection' import {s} from 'lib/styles' -import {Link} from 'view/com/util/Link' +import {Link, TextLink} from 'view/com/util/Link' import {CustomFeed} from './CustomFeed' export const SavedFeeds = observer( @@ -52,14 +52,35 @@ export const SavedFeeds = observer( const renderListFooterComponent = useCallback(() => { return ( - - - - Settings - - + <> + + + + Change Order + + + + + Feeds are custom algorithms that users build with a little coding + expertise.{' '} + {' '} + for more information. + + + ) }, [pal]) diff --git a/src/view/com/pager/FeedsTabBar.web.tsx b/src/view/com/pager/FeedsTabBar.web.tsx index 78937611b..fc04c3b2c 100644 --- a/src/view/com/pager/FeedsTabBar.web.tsx +++ b/src/view/com/pager/FeedsTabBar.web.tsx @@ -28,7 +28,7 @@ const FeedsTabBarDesktop = observer( ) => { const store = useStores() const items = useMemo( - () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My feeds'], + () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My Feeds'], [store.me.savedFeeds.pinnedFeedNames], ) const pal = usePalette('default') diff --git a/src/view/com/pager/FeedsTabBarMobile.tsx b/src/view/com/pager/FeedsTabBarMobile.tsx index a41f0ef32..5954e7f2e 100644 --- a/src/view/com/pager/FeedsTabBarMobile.tsx +++ b/src/view/com/pager/FeedsTabBarMobile.tsx @@ -33,7 +33,7 @@ export const FeedsTabBar = observer( }, [store]) const items = useMemo( - () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My feeds'], + () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My Feeds'], [store.me.savedFeeds.pinnedFeedNames], ) -- cgit 1.4.1 From 762bd15ed625c9a7d50b0ee832a1422bac3321eb Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Mon, 22 May 2023 16:12:05 -0700 Subject: fix prod default feeds not working --- src/lib/constants.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f4c6f5021..e492dd61a 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -102,13 +102,13 @@ export async function DEFAULT_FEEDS( serviceUrl: string, resolveHandle: (name: string) => Promise, ) { - if (serviceUrl.includes('localhost')) { + if (serviceUrl.includes('localhost')) { // local dev const aliceDid = await resolveHandle('alice.test') return { pinned: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], saved: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], } - } else if (serviceUrl.includes('staging')) { + } else if (serviceUrl.includes('staging')) { // staging return { pinned: [STAGING_DEFAULT_FEED('whats-hot')], saved: [ @@ -118,14 +118,14 @@ export async function DEFAULT_FEEDS( STAGING_DEFAULT_FEED('hot-classic'), ], } - } else { + } else { // production return { - pinned: [STAGING_DEFAULT_FEED('whats-hot')], + pinned: [PROD_DEFAULT_FEED('whats-hot')], saved: [ - STAGING_DEFAULT_FEED('bsky-team'), - STAGING_DEFAULT_FEED('with-friends'), - STAGING_DEFAULT_FEED('whats-hot'), - STAGING_DEFAULT_FEED('hot-classic'), + PROD_DEFAULT_FEED('bsky-team'), + PROD_DEFAULT_FEED('with-friends'), + PROD_DEFAULT_FEED('whats-hot'), + PROD_DEFAULT_FEED('hot-classic'), ], } } -- cgit 1.4.1 From 7e555ecc1b04fed96192d3c68b87cf679993abfa Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Wed, 24 May 2023 15:00:36 -0700 Subject: fix lint errors --- src/lib/constants.ts | 9 ++++++--- src/view/screens/Notifications.tsx | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index e492dd61a..c42e6f3a9 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -102,13 +102,15 @@ export async function DEFAULT_FEEDS( serviceUrl: string, resolveHandle: (name: string) => Promise, ) { - if (serviceUrl.includes('localhost')) { // local dev + if (serviceUrl.includes('localhost')) { + // local dev const aliceDid = await resolveHandle('alice.test') return { pinned: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], saved: [`at://${aliceDid}/app.bsky.feed.generator/alice-favs`], } - } else if (serviceUrl.includes('staging')) { // staging + } else if (serviceUrl.includes('staging')) { + // staging return { pinned: [STAGING_DEFAULT_FEED('whats-hot')], saved: [ @@ -118,7 +120,8 @@ export async function DEFAULT_FEEDS( STAGING_DEFAULT_FEED('hot-classic'), ], } - } else { // production + } else { + // production return { pinned: [PROD_DEFAULT_FEED('whats-hot')], saved: [ diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx index df84b541b..67507d009 100644 --- a/src/view/screens/Notifications.tsx +++ b/src/view/screens/Notifications.tsx @@ -98,7 +98,10 @@ export const NotificationsScreen = withAuthRequired( /> {store.me.notifications.hasNewLatest && !store.me.notifications.isRefreshing && ( - + )} ) -- cgit 1.4.1 From 7916c2e02ec66e32de258d2e5a605c1ee1faeac9 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 25 May 2023 17:10:00 -0500 Subject: Add 'popular with friends' to default feeds --- src/lib/constants.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/constants.ts') diff --git a/src/lib/constants.ts b/src/lib/constants.ts index c42e6f3a9..41aab1431 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -123,7 +123,10 @@ export async function DEFAULT_FEEDS( } else { // production return { - pinned: [PROD_DEFAULT_FEED('whats-hot')], + pinned: [ + PROD_DEFAULT_FEED('whats-hot'), + PROD_DEFAULT_FEED('with-friends'), + ], saved: [ PROD_DEFAULT_FEED('bsky-team'), PROD_DEFAULT_FEED('with-friends'), -- cgit 1.4.1