about summary refs log tree commit diff
path: root/src/lib/hooks
Commit message (Collapse)AuthorAgeFilesLines
* use granular permission of for media perm request (#4609)Hailey2024-06-241-1/+3
|
* Starter Packs (#4332)Hailey2024-06-212-0/+16
| | | | | | | Co-authored-by: Dan Abramov <dan.abramov@gmail.com> Co-authored-by: Paul Frazee <pfrazee@gmail.com> Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: Samuel Newman <mozzius@protonmail.com>
* Force callers of `getTimeAgo` to pass in the value for "now" (#4560)Eric Bailey2024-06-181-13/+4
| | | | | | | * Remove icky hook for now * Force callers of getTimeAgo to pass in the 'now' value * Update usage in Newskie dialog
* Add `useGetTimeAgo` and utils (#4556)Eric Bailey2024-06-182-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create a testable version of ago() and re-enable the disabled test (#4364) * Enable the test of ago() * Use test cases This puts the input and the expected values next to each other. * Create dateDiff function This is a copy of ago(), but with the ability to specify the second date instead of using Date.now(). * Let ago() use dateDiff() * Move constants close to usage * Test dateDiff instead of ago This makes it possible to test the dates without being forced to rely on what the current date is. The commented out tests do not yet pass. This is fixed in later commits. * Update dateDiff and enable the remaining tests * Split up tests, use date-fns as helpers * Remove old test * Add long format * Add hook * Migrate to hooks * Delete old code * Or equal to * Update comment --------- Co-authored-by: Jan Aagaard <jan@aagaard.net>
* Move feeds screen into common navigator, handle usages (#4365)Eric Bailey2024-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move feeds screen into common navigator, handle usages * Add link to Feeds from home screen (#4366) * Add link to feeds to home screen header * Center logo * Replace icons * Tweak spacing * Tweak spacing * Swap icon, sizing * Buttonize, size * Make menu same alignment on all screens * Remove FeedsTab support, enable drawer swipe on MessagesTab * Add note * Vertically align header * Swap in Pin * Use hashtag icon * Remove png * Fix reference * Ensure alignment with home and other screens
* Fix (#4430): Use separate hooks for shell mode animated styles (#4451)Francesco Lodovici2024-06-101-14/+27
| | | | | | | | | * Fix (#4430): Use separate hooks for shell mode animated styles * Consolidate in one file --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* Bump more Expo libs (#4251)dan2024-05-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Bump more Expo libs * Use legacy camera API * fix `expo-notifications` patch * bump `menu` * change patch name * patch reanimated * Revert "patch reanimated" This reverts commit dad822d8ea04c71a609784114d60f2e67b78290b. * Use nightly reanimated * Revert "Use nightly reanimated" This reverts commit 6687c7182883feb889cbf2c67dd14890e06bc501. * Revert "Revert "patch reanimated"" This reverts commit c30abd6732f559ca04dc59698411e1058800d63e. --------- Co-authored-by: Hailey <me@haileyok.com>
* Upgrade to Expo 51 and React Native 0.74 (#3980)Hailey2024-05-291-56/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upgrade packages * remove `expo-image-picker` patch * remove old expo-updates patch * rename rn patch * downgrade crop picker * bump `ExpoGifView` `SDWebImage` version * apply config changes * update build docs for apple silicon * update build docs for apple silicon * update expo-updates patch * add back patch readme * bump `expo-dev-client` * bump `babel-preset` * update `babel.config.js` * update `react-native-paste-input` patch * remove old ota updates hook * update types * update types * downgrade pager-view * update animated ref type * fix web-only type * update `react-native-bottom-sheet` `BottomSheetTextInput` * add `expo-application` to jest mocks * remove reanimated patch * update notifications patch * update reanimated path * fix import * update yarn.lock * use `ItemT` instead of `any` * expo bump * Revert logic change, fix types * Fix JSON file --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* [🐴] update convo list from message bus (#4189)Samuel Newman2024-05-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | * update convo list from message bus * don't increase unread count if you're the sender * add refetch interval back * Fix deleted message state copy * only enable if `hasSession` * Fix logged out handling * increase refetch interval to 60s * request 10s interval when message screen active * use useAppState hook for convo resume/background * Combine forces * fix useFocusEffect logic --------- Co-authored-by: Eric Bailey <git@esb.lol>
* [🐴] Reset screen when pressing a DM notification while already in the ↵Hailey2024-05-181-4/+26
| | | | | | | conversation screen (#4091) * add a small comment * reset if current screen
* Disable badge incrementing for DMs (#4088)Hailey2024-05-171-9/+6
| | | | | | | | | | | * disable badge increments for dms * revert decrementing in js for dms * reset badge on read notifications * remove some other code * prevent duplicate notification events
* [🐴] Don't always show notification for everything (#4083)Hailey2024-05-171-1/+1
| | | | | * don't always show a notification * nit
* [🐴] Decrement app badge when opening unread chat (#4040)Hailey2024-05-161-2/+3
| | | | | | | | | * decrement badge count for chats * handle decrement in `useMarkAsRead` * remove async * oops
* Handle failed resumeSession case when switching accounts (#4047)Eric Bailey2024-05-161-0/+5
|
* Add push notification extensions (#4005)Hailey2024-05-151-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add wav * add sound to config * add extension to `updateExtensions.sh` * add ios source files * add a build extension * add a new module * use correct type on ios * update the build plugin * add android handler * create a patch for expo-notifications * basic android implementation * add entitlements for notifications extension * add some generic logic for ios * add age check logic * add extension to app config * remove dash * move directory * rename again * update privacy manifest * add prefs storage ios * better types * create interface for setting and getting prefs * add notifications prefs for android * add functions to module * add types to js * add prefs context * add web stub * wrap the app * fix types * more preferences for ios * add a test toggle * swap vars * update patch * fix patch error * fix typo * sigh * sigh * get stored prefs on launch * anotehr type * simplify * about finished * comment * adjust plugin * use supported file types * update NSE * futureproof ios * futureproof android * update sound file name * handle initialization * more cleanup * update js types * strict js types * set the notification channel * rm * add silent channel * add mute logic * update patch * podfile * adjust channels * fix android channel * update readme * oreo or higher * nit * don't use getValue * nit
* [🐴] Adjust messages list styles (#3945)Hailey2024-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * some initial tweaks * tweaks * more tweaks * tweak chat header * properly align placeholders * tweak web header * one more... * remove extra loading states from chat * limit line count for display name * Tweaks styles (#3949) * Adjust sizing * Consistent font size * Adjust header * oops * fix accessibility in list * don't use `identifier` for notifications, use `dates` instead --------- Co-authored-by: Eric Bailey <git@esb.lol>
* Handle push notifications for DMs (#3895)Hailey2024-05-091-0/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add some better handling for notifications prep merge move `useNotificationsListener` into shell progress better structure only show messages notifications while using app if it is the current account progress only emit on native current chat emitter only show alerts for the current chat type add logs setup handlers * remove event emitter * just needs cleanup * oops * remove unnecessary `queryClient` param * few fixes * cleanup * nit * remove folds * remove comment * simplify if * add back invalidate * comment out other navigations for now * rename type * handle various navigation cases * push to conversation from notification * update badge in all cases except `chat-message` * ensure no duplicate notifications * rm unused `animationOnReplace` * revert to using `goBack` in the conversation header * add todo comment
* [Session] Code cleanup (#3854)dan2024-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split utils into files * Move reducer to another file * Write types explicitly * Remove unnnecessary check * Move things around a bit * Move more stuff into agent factories * Move more stuff into agent * Fix gates await * Clarify comments * Enforce more via types * Nit * initSession -> resumeSession * Protect against races * Make agent opaque to reducer * Check using plain condition
* [Session] Align state and global agent switchpoints (#3845)dan2024-05-031-10/+2
| | | | | | | | | | | | | * Adopt synced accounts unconditionally * Remove try/catch around resuming session * Move to login form on resume failure * Restructure code flow for easier reading --------- Co-authored-by: Eric Bailey <git@esb.lol>
* Don't clear toasts when changing users (#3843)dan2024-05-031-6/+1
| | | | | | | | | | | * Move ThemeProvider to the top * Move RootSiblingParent above the remounted part * Move ToastContainer outside the remounted part * Remove setTimeout around toasts * Consistently handle dropped session
* Improve account switcher pending state (#3827)dan2024-05-021-6/+16
| | | | | | | | | * Protect against races * Reduce UI jank when switching accounts * Add pending state to selected account * Disable presses while pending
* rename "MessagesList" to "Messages" (#3826)Samuel Newman2024-05-022-1/+4
|
* [Session] Extract selectAccount out (#3812)dan2024-05-021-5/+11
|
* Session fixes, pt. 1 (#3762)dan2024-04-301-5/+14
| | | | | | | | | | | | | | | | | * Update persisted schema for new source of truth, implement in existing session (cherry picked from commit b1e5f12baee932721d66c60dd51c981b46b0c274) * Improve toasts, log caught error, during switch account (cherry picked from commit fe0d1507063d2e532b7b1a447670b689292d1dc3) * Handle thrown errors from initSession during login (cherry picked from commit 2c85c045917e923901284b9ba310a82e28f37b5c) --------- Co-authored-by: Eric Bailey <git@esb.lol>
* [Clipclops] New routes with placeholder screens (#3725)Samuel Newman2024-04-271-1/+4
| | | | | | | | | | | * add new routes with placeholder screens * gate content * add filled envelope style * swap filled state * switch to `useAgent`
* properly close the switch account dialog (#3558)Hailey2024-04-221-14/+4
| | | | | | | | | | | | | | | | | | | * properly close the switch account dialog * use it for switch account as well * ensure dialog is closed on unmount Revert "properly check if the ref is null" This reverts commit 8f563808a5d39389b0bc47a31e73cd147d1e7e8b. properly check if the ref is null ensure dialog is closed on unmount * Revert "ensure dialog is closed on unmount" This reverts commit a48548fd8ed53ae3eb08a0e05bb89f641c112b95.
* remove gate from updates (#3646)Hailey2024-04-221-3/+1
|
* [Statsig] Make gate checks lazily (#3594)dan2024-04-181-2/+2
|
* Enable updates for `production` behind `receive_updates` gate (#3496)Hailey2024-04-122-34/+37
| | | | | | | | | | | * add gate type * gate the updates * enable updates in `production` * web placeholder for `useOTAUpdates()` * update comment
* migrate to `expo-application` (#3417)Hailey2024-04-041-2/+2
| | | | | * migrate to `expo-application` * replace additional usage
* Add OTA updates support for `testflight` channel (#3291)Hailey2024-04-031-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * some progress another adjustment, testing another adjustment, testing fix again fix again set default runtime version fix test this script test this script test this script add build numbers to the deployment url clean give script access to build number add `useBuildNumberEnv` without a bump new line fix missing async add channel name to deployment url add updates check on launch for testflight users ver bump init updates on launch for native add `testflight` as default in build submit add is_testflight check * disable inline predictions to prevent ios composer jank * temp bump * Revert "temp bump" This reverts commit 44c51134a35d817c73edb1e635495597c95117b3. * adjustments version bump adjust fixes test * cleanup and finalize drop check down to every 15 minutes adjustments change to 15 mins use jq to get version if necessary rm test on push figured it out remove nightly testflight releases test again again again again again AGAIN ONCE MORE test again again again again again AGAIN test again again again again again AGAIN test again again again again again test again again again again test again again again test again again test again test test test run deploy if necessary run deploy if necessary run deploy if necessary run deploy if necessary run deploy if necessary remove test message fix environment oops cleanup merge in changes * remove unnecessary `workflow_call` * remove changes that have been merged into main now * finalize android update git ignore rm test stuff from the bundle action remove test message test message fix test message test message few android fixes few android fixes fix jq add a test message fix slack webhook create android deployments test 2 create android deployments add `testflight-android` profile to eas.json more cleanup some more cleanup simplify some logic remove unnecessary channel rename to `useOTAUpdates` * rm test portion
* [Statsig] Track login/logout (#3286)dan2024-03-191-2/+6
| | | | | * [Statsig] Track login/logout * Fix missing attribution
* remove scrollbar gutter for Chrome when body scroll is lockedAlexander K2024-03-171-0/+2
|
* ALF confirmation dialogs (Dialogs Pt. 3) (#3143)Hailey2024-03-121-37/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve a11y on ios * Format * Remove android * Fix android * ALF confirmation dialog * Use ALF for Delete Post confirmation organize diff fix text minimize change copy alternative confirm prompt revert type changes add ButtonColor param * small adjustment to buttons in prompt * full width below gtmobile * update hide post dialog * space out dialogs * update dialogs for lists * add example * add to app passwords * Revert some changes * use sharedvalue for `importantForAccessibility` * add back `isOpen` * fix some more types * small adjustment to buttons in prompt * full width below gtmobile * update the rest of the prompts rm old confirm modal rm update prompt feed error prompt feed source card and profile block/unblock composer discard * Update src/view/screens/AppPasswords.tsx Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * lint * How about a default * Reverse reverse * Port over confirm dialogs * Add some comments * Remove unused file * complete merge * add testID where needed --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
* Dedupe navigation events (push, navigate, pop, etc) (#3179)Hailey2024-03-122-0/+97
|
* Adjust FlatList performance in main feeds (#3134)Hailey2024-03-061-0/+11
| | | | | | | | | * adjust flatlist perf settings * calculate initial num to render based on screen height * adjust window size * don't react to screen height changes
* Simplify intent path logic, ensure all variations work for bluesky://, ↵Hailey2024-03-011-9/+11
| | | | | | | bluesky:///, and https://bsky.app/ (#3045) * Simplify intent path logic, ensure all variations work * use startsWith
* close open dialogs when deep linking to composer (#3020)Hailey2024-02-281-1/+5
|
* Share Extension/Intents (#2587)Hailey2024-02-271-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add native ios code outside of ios project * helper script * going to be a lot of these commits to squash...backing up * save * start of an expo plugin * create info.plist * copy the view controller * maybe working * working * wait working now * working plugin * use current scheme * update intent path * use better params * support text in uri * build * use better encoding * handle images * cleanup ios plugin * android * move bash script to /scripts * handle cases where loaded data is uiimage rather than uri * remove unnecessary logic, allow more than 4 images and just take first 4 * android build plugin * limit images to four on android * use js for plugins, no need to build * revert changes to app config * use correct scheme on android * android readme * move ios extension to /modules * remove unnecessary event * revert typo * plugin readme * scripts readme * add configurable scheme to .env, default to `bluesky` * remove debug * revert .gitignore change * add comment about updating .env to app.config.js for those modifying scheme * modify .env * update android module to use the proper url * update ios extension * remove comment * parse and validate incoming image uris * fix types * rm oops * fix a few typos
* Intent handler (#2992)Hailey2024-02-271-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle URL params * Add resources * Add other params * refactor for scope * modify the pr to support intents rather than utm remove linebreak remove linebreak handle web adjust path check to work on web add a short delay for opening the composer setup compose intent, move to `intents` directory fix intent logic ignore incoming intents in the navigation router * refactor --------- Co-authored-by: Eric Bailey <git@esb.lol>
* fix web aux click on all browsers (#2633)Hailey2024-02-062-45/+0
|
* Clean up some sentry logs (#2630)Eric Bailey2024-01-251-1/+1
| | | | | | | * Change prop name for sentry ingestion * Fix test * Add default object
* New Web Layout (#2126)dan2024-01-223-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rip out virtualization on the web * Screw around with layout * onEndReached * scrollToOffset * Fix background * onScroll * Shell bars * More scroll * Fixes * position: sticky * Clean up 1 * Clean up 2 * Undo PagerWithHeader changes and fork it * Trim down both versions * Cleanup 3 * Memoize, lint * Don't scroll away modal or lightbox * Add content-visibility for rows * Fix composer * Fix types * Fix borked scroll animation * Fixes to layout * More FlatList parity * Layout fixes * Fix more layout * More layout * More layouts * Fix profile layout * Remove onScroll * Display: none inactive pages * Add an intermediate List component * Fix type * Add onScrolledDownChange * Port pager to use onScrolledDownChange * Fix on mobile * Don't pass down onScroll (replacement TBD) * Remove resetMainScroll * Replace onMainScroll with MainScrollProvider * Hook ScrollProvider to pager * Fix the remaining special case * Optimize a bit * Enforce that onScroll cannot be passed * Keep value updated even if no handler * Also memo it * Move the fork to List.web * Add scroll handler * Consolidate List props a bit * More stuff * Rm unused * Simplify * Make isScrolledDown work * Oops * Fixes * Hook up context scroll handlers * Scroll restore for tabs * Route scroll restoration POC * Fix some issues with restoration * Remove bad idea * Fix pager scroll restoration * Undo accidental locale changes * onContentSizeChange * Scroll to post * Better positioning * Layout fixes * Factor out navigation stuff * Cleanup * Oops * Cleanup * Fixes and types * Naming etc * Fix crash * Match FL semantics * Snap the header scroll on the web * Add body scroll lock * Scroll to top on search * Fix types * Typos * Fix Safari overflow * Fix search positioning * Add border * Patch react navigation * Revert "Patch react navigation" This reverts commit 62516ed9c20410d166e1582b43b656c819495ddc. * fixes * scroll * scrollbar * cleanup unrelated * undo unrel * flatter * Fix css * twk
* Bump react-native to 0.73.1, expo to 50 (#2214)Eric Bailey2023-12-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Bump to react-native@0.73, bump expo@next Includes bumps for all expo deps and dev dependencies. Updates react-native patch and others, and removes the babel-preset-expo patch. * Remove duplicate Splash ref * Bump more deps * Properly install expo-notifications * Bump webview dep * Bump packages according to expo fix; remove pager-view patch as it is no longer needed * Don't access expo-camera from Web * Fix crypto dep on web * Fix some type issues * Build esnext modules to support dynamic imports --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
* Make scroll handling contextual (#2200)dan2023-12-131-125/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add an intermediate List component * Fix type * Add onScrolledDownChange * Port pager to use onScrolledDownChange * Fix on mobile * Don't pass down onScroll (replacement TBD) * Remove resetMainScroll * Replace onMainScroll with MainScrollProvider * Hook ScrollProvider to pager * Fix the remaining special case * Optimize a bit * Enforce that onScroll cannot be passed * Keep value updated even if no handler * Also memo it
* Memoize usePalette (#2201)dan2023-12-131-34/+38
|
* Fix scroll on native (#2170)dan2023-12-112-42/+41
|
* Fix scroll on profile lists/feeds (#2168)dan2023-12-112-41/+42
|
* Fixes issue with (#2119)Ansh2023-12-071-3/+3
| | | | | | | | | | | * Allow going directly to password input screen when switching accounts and password is required * Revise state handling * Handle logged out states, enable clearing requestedAccount --------- Co-authored-by: Eric Bailey <git@esb.lol>
* Navigate Home on account switch (#2138)dan2023-12-071-12/+7
|