diff --git a/package.json b/package.json index 886b536612..752b8aadfd 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "@lingui/react": "^4.14.1", "@mattermost/react-native-paste-input": "^0.7.1", "@miblanchard/react-native-slider": "^2.6.0", - "@mozzius/expo-dynamic-app-icon": "1.5.0", + "@mozzius/expo-dynamic-app-icon": "^1.5.0", "@react-native-async-storage/async-storage": "2.1.2", "@react-native-menu/menu": "^1.2.3", "@react-native-picker/picker": "2.11.0", @@ -223,7 +223,7 @@ "@babel/core": "^7.26.0", "@babel/preset-env": "^7.26.0", "@babel/runtime": "^7.26.0", - "@expo/config-plugins": "~10.0.0", + "@expo/config-plugins": "~10.0.2", "@lingui/cli": "^4.14.1", "@lingui/macro": "^4.14.1", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15", diff --git a/src/lib/api/feed/demo.ts b/src/lib/api/feed/demo.ts new file mode 100644 index 0000000000..049e0f116e --- /dev/null +++ b/src/lib/api/feed/demo.ts @@ -0,0 +1,20 @@ +import {type AppBskyFeedDefs, type BskyAgent} from '@atproto/api' + +import {DEMO_FEED} from '#/lib/demo' +import {type FeedAPI, type FeedAPIResponse} from './types' + +export class DemoFeedAPI implements FeedAPI { + agent: BskyAgent + + constructor({agent}: {agent: BskyAgent}) { + this.agent = agent + } + + async peekLatest(): Promise { + return DEMO_FEED.feed[0] + } + + async fetch(): Promise { + return DEMO_FEED + } +} diff --git a/src/lib/demo.ts b/src/lib/demo.ts new file mode 100644 index 0000000000..5ead62c9d3 --- /dev/null +++ b/src/lib/demo.ts @@ -0,0 +1,202 @@ +import {type AppBskyFeedGetFeed} from '@atproto/api' +import {subDays, subMinutes} from 'date-fns' + +const DID = `did:plc:z72i7hdynmk6r22z27h6tvur` +const NOW = new Date() +const POST_1_DATE = subMinutes(NOW, 2).toISOString() +const POST_2_DATE = subMinutes(NOW, 4).toISOString() +const POST_3_DATE = subMinutes(NOW, 5).toISOString() + +export const DEMO_FEED = { + feed: [ + { + post: { + uri: 'at://did:plc:pvooorihapc2lf2pijehgrdf/app.bsky.feed.post/3lniysofyll2d', + cid: 'bafyreihwh3wxxme732ylbylhhdyz7ex6t4jtu6s3gjxxvnnh4feddhg3ku', + author: { + did: 'did:plc:pvooorihapc2lf2pijehgrdf', + handle: 'forkedriverband.bsky.social', + displayName: 'Forked River Band', + avatar: 'https://bsky.social/about/adi/post_1_avi.jpg', + viewer: { + muted: false, + blockedBy: false, + following: `at://${DID}/app.bsky.graph.follow/post1`, + }, + labels: [], + createdAt: POST_1_DATE, + verification: { + verifications: [ + { + issuer: DID, + uri: `at://${DID}/app.bsky.graph.verification/post1`, + isValid: true, + createdAt: subDays(NOW, 11).toISOString(), + }, + ], + verifiedStatus: 'valid', + trustedVerifierStatus: 'none', + }, + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_1_DATE, + // embed: { + // $type: 'app.bsky.embed.images', + // images: [ + // { + // alt: 'Fake flier for Sebastapol Bluegrass Fest', + // aspectRatio: { + // height: 1350, + // width: 900, + // }, + // image: { + // $type: 'blob', + // ref: { + // $link: + // 'bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi', + // }, + // mimeType: 'image/jpeg', + // size: 562871, + // }, + // }, + // ], + // }, + langs: ['en'], + text: 'Sonoma County folks: Come tip your hats our way and see us play new and old bluegrass tunes at Sebastopol Solstice Fest on June 20th.', + }, + embed: { + $type: 'app.bsky.embed.images#view', + images: [ + { + thumb: 'https://bsky.social/about/adi/post_1_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_1_image.jpg', + alt: 'Fake flier for Sebastapol Bluegrass Fest', + aspectRatio: { + height: 1350, + width: 900, + }, + }, + ], + }, + replyCount: 1, + repostCount: 4, + likeCount: 18, + quoteCount: 0, + indexedAt: POST_1_DATE, + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + { + post: { + uri: 'at://did:plc:fhhqii56ppgyh5qcm2b3mokf/app.bsky.feed.post/3lnizc7fug52c', + cid: 'bafyreienuabsr55rycirdf4ewue5tjcseg5lzqompcsh2brqzag6hvxllm', + author: { + did: 'did:plc:fhhqii56ppgyh5qcm2b3mokf', + handle: 'dinh-designs.bsky.social', + displayName: 'Rich Dinh Designs', + avatar: 'https://bsky.social/about/adi/post_2_avi.jpg', + viewer: { + muted: false, + blockedBy: false, + following: `at://${DID}/app.bsky.graph.follow/post2`, + }, + labels: [], + createdAt: POST_2_DATE, + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_2_DATE, + // embed: { + // $type: 'app.bsky.embed.images', + // images: [ + // { + // alt: 'Placeholder image of interior design', + // aspectRatio: { + // height: 872, + // width: 598, + // }, + // image: { + // $type: 'blob', + // ref: { + // $link: + // 'bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu', + // }, + // mimeType: 'image/jpeg', + // size: 296003, + // }, + // }, + // ], + // }, + langs: ['en'], + text: 'Details from our install at the Lucas residence in Joshua Tree. We populated the space with rich, earthy tones and locally-sourced materials to suit the landscape.', + }, + embed: { + $type: 'app.bsky.embed.images#view', + images: [ + { + thumb: 'https://bsky.social/about/adi/post_2_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_2_image.jpg', + alt: 'Placeholder image of interior design', + aspectRatio: { + height: 872, + width: 598, + }, + }, + ], + }, + replyCount: 3, + repostCount: 1, + likeCount: 4, + quoteCount: 0, + indexedAt: POST_2_DATE, + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + { + post: { + uri: 'at://did:plc:h7fwnfejmmifveeea5eyxgkc/app.bsky.feed.post/3lnizna3g4f2t', + cid: 'bafyreiepn7obmlshliori4j34texpaukrqkyyu7cq6nmpzk4lkis7nqeae', + author: { + did: 'did:plc:h7fwnfejmmifveeea5eyxgkc', + handle: 'rodyalbuerne.bsky.social', + displayName: 'Rody Albuerne', + avatar: 'https://bsky.social/about/adi/post_3_avi.jpg', + viewer: { + muted: false, + blockedBy: false, + following: `at://${DID}/app.bsky.graph.follow/post3`, + }, + labels: [], + createdAt: POST_3_DATE, + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_3_DATE, + langs: ['en'], + text: 'Tinkering with the basics of traditional wooden joinery in my shop lately. Starting small with this ox, made using simple mortise and tenon joints.', + }, + replyCount: 11, + repostCount: 97, + likeCount: 399, + quoteCount: 0, + indexedAt: POST_3_DATE, + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + ], +} satisfies AppBskyFeedGetFeed.OutputSchema + +export const BOTTOM_BAR_AVI = 'https://bsky.social/about/adi/user_avi.jpg' diff --git a/src/locale/locales/en/messages.po b/src/locale/locales/en/messages.po index 6ad7d50f30..122e9afe4f 100644 --- a/src/locale/locales/en/messages.po +++ b/src/locale/locales/en/messages.po @@ -74,8 +74,8 @@ msgstr "" msgid "{0, plural, one {# second} other {# seconds}}" msgstr "" -#: src/view/shell/bottom-bar/BottomBar.tsx:209 -#: src/view/shell/bottom-bar/BottomBar.tsx:241 +#: src/view/shell/bottom-bar/BottomBar.tsx:213 +#: src/view/shell/bottom-bar/BottomBar.tsx:245 #: src/view/shell/Drawer.tsx:470 msgid "{0, plural, one {# unread item} other {# unread items}}" msgstr "" @@ -446,7 +446,7 @@ msgid "A new form of verification" msgstr "" #: src/Navigation.tsx:401 -#: src/screens/Settings/AboutSettings.tsx:72 +#: src/screens/Settings/AboutSettings.tsx:75 #: src/screens/Settings/Settings.tsx:224 #: src/screens/Settings/Settings.tsx:227 msgid "About" @@ -621,7 +621,7 @@ msgstr "" msgid "Add muted words and tags" msgstr "" -#: src/view/com/composer/Composer.tsx:1306 +#: src/view/com/composer/Composer.tsx:1308 msgid "Add new post" msgstr "" @@ -822,7 +822,7 @@ msgstr "" msgid "An error occurred while fetching the feed." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:336 +#: src/components/StarterPack/ProfileStarterPacks.tsx:337 msgid "An error occurred while generating your starter pack. Want to try again?" msgstr "" @@ -1119,7 +1119,7 @@ msgstr "" msgid "Before creating a post, you must first verify your email." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:343 +#: src/components/StarterPack/ProfileStarterPacks.tsx:344 msgid "Before creating a starter pack, you must first verify your email." msgstr "" @@ -1262,7 +1262,7 @@ msgstr "" msgid "Bluesky Social Terms of Service" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:303 +#: src/components/StarterPack/ProfileStarterPacks.tsx:304 msgid "Bluesky will choose a set of recommended accounts from people in your network." msgstr "" @@ -1519,7 +1519,7 @@ msgid "Changes hosting provider" msgstr "" #: src/Navigation.tsx:426 -#: src/view/shell/bottom-bar/BottomBar.tsx:205 +#: src/view/shell/bottom-bar/BottomBar.tsx:209 #: src/view/shell/desktop/LeftNav.tsx:535 #: src/view/shell/Drawer.tsx:438 msgid "Chat" @@ -1587,7 +1587,7 @@ msgstr "" msgid "Choose Feeds" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:311 +#: src/components/StarterPack/ProfileStarterPacks.tsx:312 msgid "Choose for me" msgstr "" @@ -1627,8 +1627,8 @@ msgstr "" msgid "Clear all storage data (restart after this)" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:113 -#: src/screens/Settings/AboutSettings.tsx:117 +#: src/screens/Settings/AboutSettings.tsx:116 +#: src/screens/Settings/AboutSettings.tsx:120 msgid "Clear image cache" msgstr "" @@ -1807,7 +1807,7 @@ msgstr "" msgid "Compose reply" msgstr "" -#: src/view/com/composer/Composer.tsx:1688 +#: src/view/com/composer/Composer.tsx:1690 msgid "Compressing video..." msgstr "" @@ -1958,7 +1958,7 @@ msgstr "" msgid "Copied" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:148 +#: src/screens/Settings/AboutSettings.tsx:151 msgid "Copied build version to clipboard" msgstr "" @@ -1976,7 +1976,7 @@ msgstr "" msgid "Copied!" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:124 +#: src/screens/Settings/AboutSettings.tsx:127 msgid "Copies build version to clipboard" msgstr "" @@ -2079,7 +2079,7 @@ msgstr "" msgid "Could not process your video" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:293 +#: src/components/StarterPack/ProfileStarterPacks.tsx:294 msgid "Create" msgstr "" @@ -2087,20 +2087,20 @@ msgstr "" msgid "Create a QR code for a starter pack" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:178 -#: src/components/StarterPack/ProfileStarterPacks.tsx:274 +#: src/components/StarterPack/ProfileStarterPacks.tsx:179 +#: src/components/StarterPack/ProfileStarterPacks.tsx:275 #: src/Navigation.tsx:461 msgid "Create a starter pack" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:255 +#: src/components/StarterPack/ProfileStarterPacks.tsx:256 msgid "Create a starter pack for me" msgstr "" #: src/view/com/auth/SplashScreen.tsx:55 #: src/view/com/auth/SplashScreen.web.tsx:117 -#: src/view/shell/bottom-bar/BottomBar.tsx:315 -#: src/view/shell/bottom-bar/BottomBar.tsx:320 +#: src/view/shell/bottom-bar/BottomBar.tsx:319 +#: src/view/shell/bottom-bar/BottomBar.tsx:324 #: src/view/shell/bottom-bar/BottomBarWeb.tsx:199 #: src/view/shell/bottom-bar/BottomBarWeb.tsx:204 #: src/view/shell/NavSignupCard.tsx:47 @@ -2126,7 +2126,7 @@ msgstr "" msgid "Create an avatar instead" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:185 +#: src/components/StarterPack/ProfileStarterPacks.tsx:186 msgid "Create another" msgstr "" @@ -2350,12 +2350,12 @@ msgstr "" msgid "Detach quote post?" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:137 +#: src/screens/Settings/AboutSettings.tsx:140 msgctxt "toast" msgid "Developer mode disabled" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:131 +#: src/screens/Settings/AboutSettings.tsx:134 msgctxt "toast" msgid "Developer mode enabled" msgstr "" @@ -2435,7 +2435,7 @@ msgstr "" msgid "Dismiss" msgstr "" -#: src/view/com/composer/Composer.tsx:1612 +#: src/view/com/composer/Composer.tsx:1614 msgid "Dismiss error" msgstr "" @@ -2886,7 +2886,7 @@ msgstr "" msgid "Entertainment" msgstr "" -#: src/view/com/composer/Composer.tsx:1697 +#: src/view/com/composer/Composer.tsx:1699 #: src/view/com/util/error/ErrorScreen.tsx:42 msgid "Error" msgstr "" @@ -3494,7 +3494,7 @@ msgstr "" msgid "Gallery" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:300 +#: src/components/StarterPack/ProfileStarterPacks.tsx:301 msgid "Generate a starter pack" msgstr "" @@ -3780,7 +3780,7 @@ msgstr "" #: src/Navigation.tsx:645 #: src/Navigation.tsx:665 -#: src/view/shell/bottom-bar/BottomBar.tsx:162 +#: src/view/shell/bottom-bar/BottomBar.tsx:166 #: src/view/shell/desktop/LeftNav.tsx:599 #: src/view/shell/Drawer.tsx:412 msgid "Home" @@ -3871,12 +3871,12 @@ msgstr "" msgid "Image" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:61 +#: src/screens/Settings/AboutSettings.tsx:64 msgid "Image cache cleared" msgstr "" #. Android-only toast message which includes amount of space freed using localized number formatting -#: src/screens/Settings/AboutSettings.tsx:47 +#: src/screens/Settings/AboutSettings.tsx:50 msgid "Image cache cleared, freed {0}" msgstr "" @@ -3997,7 +3997,7 @@ msgstr "" msgid "It's just you right now! Add more people to your starter pack by searching above." msgstr "" -#: src/view/com/composer/Composer.tsx:1631 +#: src/view/com/composer/Composer.tsx:1633 msgid "Job ID: {0}" msgstr "" @@ -4158,7 +4158,7 @@ msgstr "" msgid "left to go." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:316 +#: src/components/StarterPack/ProfileStarterPacks.tsx:317 msgid "Let me choose" msgstr "" @@ -4374,7 +4374,7 @@ msgstr "" msgid "Looks like you're missing a following feed. <0>Click here to add one." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:269 +#: src/components/StarterPack/ProfileStarterPacks.tsx:270 msgid "Make one for me" msgstr "" @@ -5039,7 +5039,7 @@ msgstr "" #: src/Navigation.tsx:655 #: src/view/screens/Notifications.tsx:128 -#: src/view/shell/bottom-bar/BottomBar.tsx:236 +#: src/view/shell/bottom-bar/BottomBar.tsx:240 #: src/view/shell/desktop/LeftNav.tsx:636 #: src/view/shell/Drawer.tsx:465 msgid "Notifications" @@ -5141,8 +5141,8 @@ msgid "Oops, something went wrong!" msgstr "" #: src/components/Lists.tsx:173 -#: src/components/StarterPack/ProfileStarterPacks.tsx:325 -#: src/components/StarterPack/ProfileStarterPacks.tsx:334 +#: src/components/StarterPack/ProfileStarterPacks.tsx:326 +#: src/components/StarterPack/ProfileStarterPacks.tsx:335 #: src/screens/Settings/AppPasswords.tsx:59 #: src/screens/Settings/components/ChangeHandleDialog.tsx:106 #: src/screens/Settings/NotificationSettings.tsx:54 @@ -5172,7 +5172,7 @@ msgid "Open drawer menu" msgstr "" #: src/screens/Messages/components/MessageInput.web.tsx:181 -#: src/view/com/composer/Composer.tsx:1292 +#: src/view/com/composer/Composer.tsx:1293 msgid "Open emoji picker" msgstr "" @@ -5185,7 +5185,7 @@ msgstr "" msgid "Open feed options menu" msgstr "" -#: src/components/dms/EmojiPopup.android.tsx:28 +#: src/components/dms/EmojiPopup.android.tsx:27 msgid "Open full emoji list" msgstr "" @@ -5266,7 +5266,7 @@ msgstr "" msgid "Opens device photo gallery" msgstr "" -#: src/view/com/composer/Composer.tsx:1293 +#: src/view/com/composer/Composer.tsx:1294 msgid "Opens emoji picker" msgstr "" @@ -5774,15 +5774,15 @@ msgid "Privacy and Security" msgstr "" #: src/Navigation.tsx:301 -#: src/screens/Settings/AboutSettings.tsx:89 #: src/screens/Settings/AboutSettings.tsx:92 +#: src/screens/Settings/AboutSettings.tsx:95 #: src/view/screens/PrivacyPolicy.tsx:31 #: src/view/shell/Drawer.tsx:650 #: src/view/shell/Drawer.tsx:651 msgid "Privacy Policy" msgstr "" -#: src/view/com/composer/Composer.tsx:1694 +#: src/view/com/composer/Composer.tsx:1696 msgid "Processing video..." msgstr "" @@ -5796,7 +5796,7 @@ msgstr "" msgid "profile" msgstr "" -#: src/view/shell/bottom-bar/BottomBar.tsx:286 +#: src/view/shell/bottom-bar/BottomBar.tsx:290 #: src/view/shell/desktop/LeftNav.tsx:691 #: src/view/shell/Drawer.tsx:74 #: src/view/shell/Drawer.tsx:542 @@ -6412,7 +6412,7 @@ msgstr "" #: src/components/Error.tsx:65 #: src/components/Lists.tsx:110 #: src/components/moderation/ReportDialog/index.tsx:221 -#: src/components/StarterPack/ProfileStarterPacks.tsx:339 +#: src/components/StarterPack/ProfileStarterPacks.tsx:340 #: src/screens/Login/LoginForm.tsx:323 #: src/screens/Login/LoginForm.tsx:330 #: src/screens/Messages/ChatList.tsx:253 @@ -6473,7 +6473,7 @@ msgstr "" msgid "Save" msgstr "" -#: src/view/com/lightbox/ImageViewing/index.tsx:608 +#: src/view/com/lightbox/ImageViewing/index.tsx:610 #: src/view/com/modals/CreateOrEditList.tsx:325 msgctxt "action" msgid "Save" @@ -6556,7 +6556,7 @@ msgstr "" #: src/components/forms/SearchInput.tsx:36 #: src/screens/Search/Shell.tsx:307 #: src/screens/Search/Shell.tsx:464 -#: src/view/shell/bottom-bar/BottomBar.tsx:182 +#: src/view/shell/bottom-bar/BottomBar.tsx:186 msgid "Search" msgstr "" @@ -6884,7 +6884,7 @@ msgstr "" msgid "Share" msgstr "" -#: src/view/com/lightbox/ImageViewing/index.tsx:617 +#: src/view/com/lightbox/ImageViewing/index.tsx:619 msgctxt "action" msgid "Share" msgstr "" @@ -7073,8 +7073,8 @@ msgstr "" #: src/view/com/auth/SplashScreen.tsx:69 #: src/view/com/auth/SplashScreen.web.tsx:123 #: src/view/com/auth/SplashScreen.web.tsx:131 -#: src/view/shell/bottom-bar/BottomBar.tsx:325 -#: src/view/shell/bottom-bar/BottomBar.tsx:330 +#: src/view/shell/bottom-bar/BottomBar.tsx:329 +#: src/view/shell/bottom-bar/BottomBar.tsx:334 #: src/view/shell/bottom-bar/BottomBarWeb.tsx:209 #: src/view/shell/bottom-bar/BottomBarWeb.tsx:214 #: src/view/shell/NavSignupCard.tsx:57 @@ -7217,7 +7217,7 @@ msgstr "" msgid "Something wrong? Let us know." msgstr "" -#: src/App.native.tsx:122 +#: src/App.native.tsx:121 #: src/App.web.tsx:98 msgid "Sorry! Your session expired. Please sign in again." msgstr "" @@ -7303,12 +7303,12 @@ msgstr "" msgid "Starter Packs" msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:247 +#: src/components/StarterPack/ProfileStarterPacks.tsx:248 msgid "Starter packs let you easily share your favorite feeds and people with your friends." msgstr "" -#: src/screens/Settings/AboutSettings.tsx:97 #: src/screens/Settings/AboutSettings.tsx:100 +#: src/screens/Settings/AboutSettings.tsx:103 msgid "Status Page" msgstr "" @@ -7430,8 +7430,8 @@ msgstr "" msgid "System" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:104 #: src/screens/Settings/AboutSettings.tsx:107 +#: src/screens/Settings/AboutSettings.tsx:110 #: src/screens/Settings/Settings.tsx:380 msgid "System log" msgstr "" @@ -7485,8 +7485,8 @@ msgid "Terms" msgstr "" #: src/Navigation.tsx:306 -#: src/screens/Settings/AboutSettings.tsx:81 #: src/screens/Settings/AboutSettings.tsx:84 +#: src/screens/Settings/AboutSettings.tsx:87 #: src/view/screens/TermsOfService.tsx:31 #: src/view/shell/Drawer.tsx:643 #: src/view/shell/Drawer.tsx:645 @@ -8369,7 +8369,7 @@ msgstr "" msgid "Uploading link thumbnail..." msgstr "" -#: src/view/com/composer/Composer.tsx:1691 +#: src/view/com/composer/Composer.tsx:1693 msgid "Uploading video..." msgstr "" @@ -8555,8 +8555,8 @@ msgstr "" msgid "Verify Your Email" msgstr "" -#: src/screens/Settings/AboutSettings.tsx:123 -#: src/screens/Settings/AboutSettings.tsx:152 +#: src/screens/Settings/AboutSettings.tsx:126 +#: src/screens/Settings/AboutSettings.tsx:155 msgid "Version {appVersion}" msgstr "" @@ -8599,7 +8599,7 @@ msgstr "" msgid "Video settings" msgstr "" -#: src/view/com/composer/Composer.tsx:1701 +#: src/view/com/composer/Composer.tsx:1703 msgid "Video uploaded" msgstr "" @@ -8655,7 +8655,7 @@ msgstr "" msgid "View details for reporting a copyright violation" msgstr "" -#: src/view/com/posts/ViewFullThread.tsx:56 +#: src/view/com/posts/ViewFullThread.tsx:59 msgid "View full thread" msgstr "" @@ -9162,7 +9162,7 @@ msgstr "" msgid "You have temporarily reached the limit for video uploads. Please try again later." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:244 +#: src/components/StarterPack/ProfileStarterPacks.tsx:245 msgid "You haven't created a starter pack yet!" msgstr "" @@ -9199,7 +9199,7 @@ msgstr "" msgid "You must be 13 years of age or older to create an account." msgstr "" -#: src/components/StarterPack/ProfileStarterPacks.tsx:327 +#: src/components/StarterPack/ProfileStarterPacks.tsx:328 msgid "You must be following at least seven other people to generate a starter pack." msgstr "" diff --git a/src/screens/Settings/AboutSettings.tsx b/src/screens/Settings/AboutSettings.tsx index 199d12e63d..0ce127ff3f 100644 --- a/src/screens/Settings/AboutSettings.tsx +++ b/src/screens/Settings/AboutSettings.tsx @@ -12,9 +12,10 @@ import {Statsig} from 'statsig-react-native-expo' import {appVersion, BUNDLE_DATE, bundleInfo} from '#/lib/app-info' import {STATUS_PAGE_URL} from '#/lib/constants' import {type CommonNavigatorParams} from '#/lib/routes/types' -import {isAndroid, isNative} from '#/platform/detection' +import {isAndroid, isIOS, isNative} from '#/platform/detection' import * as Toast from '#/view/com/util/Toast' import * as SettingsList from '#/screens/Settings/components/SettingsList' +import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom' import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle' import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines' import {Globe_Stroke2_Corner0_Rounded as GlobeIcon} from '#/components/icons/Globe' @@ -22,6 +23,7 @@ import {Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon} from '#/components/i import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench' import * as Layout from '#/components/Layout' import {Loader} from '#/components/Loader' +import {useDemoMode} from '#/storage/hooks/demo-mode' import {useDevMode} from '#/storage/hooks/dev-mode' import {OTAInfo} from './components/OTAInfo' @@ -29,6 +31,7 @@ type Props = NativeStackScreenProps export function AboutSettingsScreen({}: Props) { const {_, i18n} = useLingui() const [devModeEnabled, setDevModeEnabled] = useDevMode() + const [demoModeEnabled, setDemoModeEnabled] = useDemoMode() const stableID = useMemo(() => Statsig.getStableID(), []) const {mutate: onClearImageCache, isPending: isClearingImageCache} = @@ -153,7 +156,31 @@ export function AboutSettingsScreen({}: Props) { {bundleInfo} - {devModeEnabled && } + {devModeEnabled && ( + <> + + {isIOS && ( + { + const newDemoModeEnabled = !demoModeEnabled + setDemoModeEnabled(newDemoModeEnabled) + Toast.show( + 'Demo mode ' + + (newDemoModeEnabled ? 'enabled' : 'disabled'), + ) + }} + label={ + demoModeEnabled ? 'Disable demo mode' : 'Enable demo mode' + } + disabled={isClearingImageCache}> + + + {demoModeEnabled ? 'Disable demo mode' : 'Enable demo mode'} + + + )} + + )} diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts index 82a118ec2c..f3fa13cfba 100644 --- a/src/state/queries/post-feed.ts +++ b/src/state/queries/post-feed.ts @@ -1,31 +1,32 @@ import React, {useCallback, useEffect, useRef} from 'react' import {AppState} from 'react-native' import { - AppBskyActorDefs, + type AppBskyActorDefs, AppBskyFeedDefs, - AppBskyFeedPost, + type AppBskyFeedPost, AtUri, - BskyAgent, + type BskyAgent, moderatePost, - ModerationDecision, + type ModerationDecision, } from '@atproto/api' import { - InfiniteData, - QueryClient, - QueryKey, + type InfiniteData, + type QueryClient, + type QueryKey, useInfiniteQuery, } from '@tanstack/react-query' import {AuthorFeedAPI} from '#/lib/api/feed/author' import {CustomFeedAPI} from '#/lib/api/feed/custom' +import {DemoFeedAPI} from '#/lib/api/feed/demo' import {FollowingFeedAPI} from '#/lib/api/feed/following' import {HomeFeedAPI} from '#/lib/api/feed/home' import {LikesFeedAPI} from '#/lib/api/feed/likes' import {ListFeedAPI} from '#/lib/api/feed/list' import {MergeFeedAPI} from '#/lib/api/feed/merge' -import {FeedAPI, ReasonFeedSource} from '#/lib/api/feed/types' +import {type FeedAPI, type ReasonFeedSource} from '#/lib/api/feed/types' import {aggregateUserInterests} from '#/lib/api/feed/utils' -import {FeedTuner, FeedTunerFn} from '#/lib/api/feed-manip' +import {FeedTuner, type FeedTunerFn} from '#/lib/api/feed-manip' import {DISCOVER_FEED_URI} from '#/lib/constants' import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants' import {logger} from '#/logger' @@ -59,6 +60,7 @@ export type FeedDescriptor = | `feedgen|${FeedUri}` | `likes|${ActorDid}` | `list|${ListUri}` + | 'demo' export interface FeedParams { mergeFeedEnabled?: boolean mergeFeedSources?: string[] @@ -483,6 +485,8 @@ function createApi({ } else if (feedDesc.startsWith('list')) { const [_, list] = feedDesc.split('|') return new ListFeedAPI({agent, feedParams: {list}}) + } else if (feedDesc === 'demo') { + return new DemoFeedAPI({agent}) } else { // shouldnt happen return new FollowingFeedAPI({agent}) diff --git a/src/storage/hooks/demo-mode.ts b/src/storage/hooks/demo-mode.ts new file mode 100644 index 0000000000..b65dd147e2 --- /dev/null +++ b/src/storage/hooks/demo-mode.ts @@ -0,0 +1,7 @@ +import {device, useStorage} from '#/storage' + +export function useDemoMode() { + const [demoMode = false, setDemoMode] = useStorage(device, ['demoMode']) + + return [demoMode, setDemoMode] as const +} diff --git a/src/storage/schema.ts b/src/storage/schema.ts index 0e9b1985cb..7430532a96 100644 --- a/src/storage/schema.ts +++ b/src/storage/schema.ts @@ -10,6 +10,7 @@ export type Device = { } trendingBetaEnabled: boolean devMode: boolean + demoMode: boolean } export type Account = { diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index a6e2595eec..e058e28831 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -8,28 +8,36 @@ import {useOTAUpdates} from '#/lib/hooks/useOTAUpdates' import {useSetTitle} from '#/lib/hooks/useSetTitle' import {useRequestNotificationsPermission} from '#/lib/notifications/notifications' import { - HomeTabNavigatorParams, - NativeStackScreenProps, + type HomeTabNavigatorParams, + type NativeStackScreenProps, } from '#/lib/routes/types' import {logEvent} from '#/lib/statsig/statsig' import {isWeb} from '#/platform/detection' import {emitSoftReset} from '#/state/events' -import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed' -import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed' +import { + type SavedFeedSourceInfo, + usePinnedFeedsInfos, +} from '#/state/queries/feed' +import {type FeedDescriptor, type FeedParams} from '#/state/queries/post-feed' import {usePreferencesQuery} from '#/state/queries/preferences' -import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types' +import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types' import {useSession} from '#/state/session' import {useSetMinimalShellMode} from '#/state/shell' import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed' import {FeedPage} from '#/view/com/feeds/FeedPage' import {HomeHeader} from '#/view/com/home/HomeHeader' -import {Pager, PagerRef, RenderTabBarFnProps} from '#/view/com/pager/Pager' +import { + Pager, + type PagerRef, + type RenderTabBarFnProps, +} from '#/view/com/pager/Pager' import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState' import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState' import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed' import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned' import * as Layout from '#/components/Layout' +import {useDemoMode} from '#/storage/hooks/demo-mode' type Props = NativeStackScreenProps export function HomeScreen(props: Props) { @@ -184,8 +192,22 @@ function HomeScreenReady({ [setMinimalShellMode], ) + const [demoMode] = useDemoMode() + const renderTabBar = React.useCallback( (props: RenderTabBarFnProps) => { + if (demoMode) { + return ( + + ) + } return ( ) }, - [onPressSelected, pinnedFeedInfos], + [onPressSelected, pinnedFeedInfos, demoMode], ) const renderFollowingEmptyState = React.useCallback(() => { @@ -218,6 +240,35 @@ function HomeScreenReady({ } }, [preferences]) + if (demoMode) { + return ( + + + + + ) + } + return hasSession ? ( @@ -259,7 +263,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { {borderColor: pal.text.color}, ]}>