Compare commits

...

541 Commits

Author SHA1 Message Date
Aryan Goharzad f864570843 Adds image prefetch 2023-01-30 10:32:10 -05:00
Aryan Goharzad d2c2508043 Adds prefetching to images 2023-01-30 10:30:11 -05:00
Paul Frazee 759f022351 Bump podfile.lock 2023-01-26 09:51:05 -06:00
Paul Frazee 59b096196c Brand tuning: switch from "blueprint B" to "cloud imagery" (#96)
* Switch app icon to bluesky image

* Update splash screen to clouds

* Update login screen to use branding

* Lighten the shadows in the brand imagery
2023-01-25 19:01:16 -06:00
Paul Frazee f39a27ed66 Fix: dont dedup reposts that are in threads, as that can cause rendering issues (close #71) 2023-01-25 17:57:53 -06:00
Paul Frazee d0bca3c576 Add a sanity check to avoid bad references, close #77 2023-01-25 17:49:22 -06:00
Paul Frazee 03b44c0e45 Fix pagination and rendering of suggested follows (#95) 2023-01-25 17:46:14 -06:00
Aryan Goharzad 10c9b26475 Saves image on long press (#83)
* Saves image on long press

* Adds save on long press

* Forking lightbox

* move to wrapper only to the bottom sheet to reduce impact of this change

* lint

* lint

* lint

* Use official `share` API

* Clean up cache after download

* comment

* comment

* Reduce swipe close velocity

* Updates per feedback

* lint

* bugfix

* Adds delayed press-in for TouchableOpacity
2023-01-25 17:25:34 -06:00
Aryan Goharzad 3e6a6960d4 Adds darkmode support for "Liked by" screen (#94)
* Adds darkmode support for "Liked by" screen

* changes based on feedback

* variable naming
2023-01-25 16:54:22 -06:00
Paul Frazee 5635bde707 Push notification & session management cleanup (#92)
* Add some temporary logging to help suss out the session drop issue

* Fix to session resumption: copy session tokens during a resumeSession attempt

* Factor out notifee display into a lib and add to storybook

* Tune the bg notifications fetch to only get what is needed

* Fix: run account update inside a mobx action

* Remove debugging logs for sessions

* Fixes to bg notifications fetch
2023-01-25 11:31:09 -06:00
Paul Frazee 1a8c6ac71e Fix missing config for background fetch 2023-01-24 19:59:40 -06:00
Paul Frazee 3bb220f8be Initial pass at push notifications + some fixes to the session management (#91)
* Fix: test the session during resume to ensure it's valid

* Don't delete sessions for now

* Add notifee and request notif permissions on first login

* Set unread notifications badge on app icon

* Trigger a notifee card on new notifications

* Experimental: use react-native-background-fetch to check for notifications

* Add missing mocks

* Fix to resumeSession()
2023-01-24 19:32:24 -06:00
Paul Frazee 8187a07aee Add basic analytics (#89)
* Add basic analytics

* Fix: add mock for analytics
2023-01-24 13:58:35 -06:00
Paul Frazee d054a69bcf Resolve all remaining lint issues (#88)
* Rework 'navIdx' variables from number arrays to strings to avoid equality-check failures in react hooks

* Resolve all remaining lint issues

* Fix tests

* Use node v18 in gh action test
2023-01-24 13:00:11 -06:00
Aryan Goharzad 4b1fe49132 more prettier and lint cleanup (#82)
* more prettier and lint cleanup

* Fixes more lint issues

* lint

* ignore more files

* remove todos

* lint
2023-01-24 11:03:18 -06:00
Paul Frazee b2c139dbc0 Account switcher (#85)
* Update the account-create and signin views to use the design system.

Also:
- Add borderDark to the theme
- Start to an account selector in the signin flow

* Dark mode fixes in signin ui

* Track multiple active accounts and provide account-switching UI

* Add test tooling for an in-memory pds

* Add complete integration tests for login and the account switcher
2023-01-24 09:06:27 -06:00
Aryan Goharzad 02488f06d8 Removes white space from around images (#81)
* Removes white space from around images

* Add a subtle border
2023-01-23 20:17:37 -06:00
Aryan Goharzad b0d367a3b8 Lints some errors and warnings (#76) 2023-01-20 13:43:28 -06:00
Aryan Goharzad 19c9ffa352 Fixes embed links for twitter and tiktok (#74) 2023-01-20 12:54:30 -06:00
Paul Frazee cfc7d17db3 Only use cursors supplied by the server (ref #59) 2023-01-20 10:39:00 -06:00
Paul Frazee 71b24952c7 Sanity check selector swipes 2023-01-20 10:15:59 -06:00
Paul Frazee d7aed0b199 More layout fixes in notifications 2023-01-20 08:40:41 -06:00
Paul Frazee 2823524388 Spacing fix of expanded notifications 2023-01-20 08:36:15 -06:00
Paul Frazee fd8083350c Fix font color of expanded notifs 2023-01-20 08:35:35 -06:00
Paul Frazee 1411f33393 Fix text color in composer 2023-01-19 20:08:43 -06:00
Paul Frazee 8840293c92 Fix a case where the 'aborted' error message was getting through 2023-01-19 17:55:00 -06:00
Paul Frazee 83fa99a4fe Fix: taps on images in the composer now register even when input is focused 2023-01-19 17:46:45 -06:00
Paul Frazee 64473f5c98 Fix: new post doesnt open images selector 2023-01-19 17:37:24 -06:00
Paul Frazee a45424fdb1 Add the ability to paste images into the composer (#56) 2023-01-19 17:36:49 -06:00
Paul Frazee 14d3389a63 Fix error logs 2023-01-19 17:05:36 -06:00
Paul Frazee 311c7b52c8 Fixes to likes list 2023-01-19 16:54:30 -06:00
Paul Frazee a8fd747187 Fixes to reposted-by list 2023-01-19 16:50:16 -06:00
Paul Frazee 259610ab37 Fixes to follows listing 2023-01-19 16:39:40 -06:00
Paul Frazee 44b4ec22d7 Fixes to the followers list view 2023-01-19 16:38:12 -06:00
Paul Frazee f3dd6a89a1 Update podfile.lock 2023-01-19 16:37:21 -06:00
Paul Frazee a60473b93f Fix: ensure all views can scroll to the bottom 2023-01-19 15:21:06 -06:00
Paul Frazee c8c5ab05cd Update load latest to match sizing and aesthetic better 2023-01-19 15:10:15 -06:00
Paul Frazee 38219721c9 Fix html extraction tests 2023-01-19 14:30:33 -06:00
Paul Frazee 9d6e23b6e7 Visual tweaks to post prompts 2023-01-19 14:28:11 -06:00
Paul Frazee ce69d13ec4 Fix weird bar at top of composer in dark mode 2023-01-19 14:17:15 -06:00
Paul Frazee 4875c2edaf Fix bad ref 2023-01-19 14:17:00 -06:00
Paul Frazee e39759a9a4 Change post prompt to a set of buttons (#55) 2023-01-19 14:08:53 -06:00
Aryan Goharzad 547b663bb6 Fixes youtube embed issues (#50)
* fixes youtube embed

* move extractMetaHtml test to its own file

* tests cleanup

* Add fallback for youtube meta data

* lint

* Check for youtube in the url domain

* use hostname instead of full url to check for link domain

* checks only for domain
2023-01-19 12:53:11 -06:00
Paul Frazee 6ab5776f95 Improve link meta fetching for bsky links (#54)
* Add share dropdown item to profiles

* Temporary improvement for links to content on the network

* Enlarge text slightly on embed cards
2023-01-19 12:30:28 -06:00
Aryan Goharzad 9b40d4c8cc Adding action for linting (#51)
* Adding action for linting

* Configuring eslint

* Update lint.yml

* Update lint.yml

* Update lint.yml

* adds yarn jest to package.json

* test report

* debugging tests

* trying force exit

* force exit

* test1

* forceexit

* using another reporter

* jest debugging

* separated lints & tests

* test

* Cleanup

* Add  /src/third-party, /ios, and /android to ignore list
2023-01-19 12:28:52 -06:00
Paul Frazee a0a81da164 Clean up the settings page 2023-01-19 11:49:53 -06:00
Paul Frazee 0220adaefb Improve the 'expand avis' animation in the notifications 2023-01-19 11:41:24 -06:00
Paul Frazee 481dee52b1 Fix missing key in list 2023-01-19 11:35:37 -06:00
Paul Frazee 78d74a3d7c Add the ability to expand/collapse users in notifications 2023-01-19 11:34:07 -06:00
Paul Frazee 83ca9059fa Tune the empty state visuals 2023-01-19 10:50:21 -06:00
Paul Frazee 8da491cc3b Tweak compose prompt spacing 2023-01-19 10:40:55 -06:00
Paul Frazee 8d1b3adb6a Post layout tweaks (#53)
* Increase left margin on feed and embiggen avis

* Decrease feed margins a bit

* Tweak post bottom margin

* Update loading placeholder to match feed

* Update 'view full thread' positioning

* Update postthread to match feed layout

* Update notifications and individual post to match new layout

* Add missing aborted check
2023-01-19 10:35:57 -06:00
Paul Frazee 626f85651f Update composer to preview external link cards (#52)
* Fetch external link metadata during compose so the user can preview and remove the embed

* Add missing mocks

* Update tests to match recent changes
2023-01-18 18:14:46 -06:00
Paul Frazee 2acc7ed107 Enlarge avatars in the notifications 2023-01-18 17:06:17 -06:00
Paul Frazee 14a2be33af Remove log 2023-01-18 16:52:00 -06:00
Paul Frazee a642a3fe8f Handle post deletions by removing from active views (close #37) 2023-01-18 16:45:48 -06:00
Paul Frazee b90f7eaefb Fix image compression (close #41) 2023-01-18 14:54:55 -06:00
Paul Frazee 455515cae1 Keep the composer image selector open after choosing an image 2023-01-18 14:47:59 -06:00
Paul Frazee e3fc3b997a Hackfix around 'images too large' issue 2023-01-18 14:47:42 -06:00
Paul Frazee 3c529e743f Update compose prompt for isual balance and to include image button 2023-01-18 13:57:53 -06:00
Paul Frazee 9d7f968cdd Lighten the button gradients a bit 2023-01-18 13:30:50 -06:00
Paul Frazee b5769f9aed Fix to text consistency in composer 2023-01-18 13:22:34 -06:00
Paul Frazee ac98b322ca Focus the text input on tap during the composer 2023-01-18 13:21:23 -06:00
Paul Frazee c499f5f96a Remove all links from post meta to ensure taps are more consistent 2023-01-18 13:10:08 -06:00
Paul Frazee d719b502d3 Prettier profile headers (no standard header) 2023-01-18 12:56:53 -06:00
Paul Frazee 02e24c23a6 Move the grays from a red undertone to blue 2023-01-18 12:40:51 -06:00
Paul Frazee c57ae4cea4 Update gradients to use a more consistent blue theme 2023-01-18 12:32:48 -06:00
Paul Frazee 2536d6bf10 Rework all typography 2023-01-18 11:15:40 -06:00
Paul Frazee 060ce2c725 Merge branch 'improved-lightbox' into main 2023-01-17 21:18:25 -06:00
Paul Frazee a8d2935cf2 Fix an issue that caused the shelf menu to show up at random 2023-01-17 21:01:52 -06:00
Paul Frazee d6fb1528a0 Remove leftover code 2023-01-17 20:47:43 -06:00
Paul Frazee 2e3d170d1e Improve lightbox... and update to React Native 0.71.0 (#49)
* Switch to a better lightbox implementation (close #42)

* Upgrade to react-native 0.71.0

* Update (or remove low-value) tests
2023-01-17 20:40:02 -06:00
Paul Frazee 4690e28cde Update (or remove low-value) tests 2023-01-17 20:38:15 -06:00
Paul Frazee 66a754ad22 Upgrade to react-native 0.71.0 2023-01-17 20:21:11 -06:00
Paul Frazee 83a74f0f6e Switch to a better lightbox implementation (close #42) 2023-01-17 19:34:12 -06:00
Paul Frazee 811b8cfc4c Add images to the post in the right order 2023-01-17 18:35:48 -06:00
Paul Frazee a81d9cfca6 Give a more sensible default crop in the post image picker (related #39) 2023-01-17 18:35:37 -06:00
Paul Frazee c7ef5cd741 Add profile menuitem to main menu (close #47) 2023-01-17 16:55:43 -06:00
Paul Frazee 41f6afc528 Fix to extraneous home feed polling 2023-01-17 16:49:11 -06:00
Paul Frazee 37cb821d6b Visual improvements to post embeds for external links 2023-01-17 16:42:32 -06:00
Paul Frazee 203bfc4c7c Group together notifications more aggressively 2023-01-17 16:25:10 -06:00
Paul Frazee 779556f36d Fix left-alignment on notifications 2023-01-17 16:22:34 -06:00
Paul Frazee cf575cca68 Increase the profile bio line-count cutoff significantly to only catch very silly newline abuse (close #48) 2023-01-17 16:18:41 -06:00
Paul Frazee 97e6bdbe40 More adjustments to the repost icon 2023-01-17 13:25:04 -06:00
Paul Frazee 5f0101a360 Enlarge repost icon arrows 2023-01-17 13:21:11 -06:00
Paul Frazee a3bb305229 Rework repost icon to match line widths 2023-01-17 13:17:38 -06:00
Paul Frazee 808b33e7a7 Refer to upvotes as 'likes' in the UI (will change in the protocol soon) 2023-01-17 12:35:47 -06:00
Paul Frazee ac917ba829 Fix notification descriptions and render images for your own posts in notifs 2023-01-17 12:12:17 -06:00
Paul Frazee 6c3f2d3505 Lighten post controls a little in light-mode and add them to the theme 2023-01-17 11:20:07 -06:00
Paul Frazee 742a43658f Lighten borders slightly 2023-01-17 11:14:47 -06:00
Paul Frazee 0307e2e932 Fix an issue that caused the feed to rearrange on loadmore 2023-01-17 10:58:51 -06:00
Paul Frazee 7c1add25a1 Remove duplicate posts caused by reposts 2023-01-17 10:45:37 -06:00
Paul Frazee feeab9205b Add loading spinners to lightbox views (close #38) 2023-01-17 10:40:09 -06:00
Paul Frazee 1023653d97 Shrink the header back down but use bolder title text 2023-01-17 10:32:40 -06:00
Paul Frazee 077f2fe093 Remove scenes (#36)
* Remove scenes from the main menu

* Remove scenes from the profile view

* Remove 'scenes explainer' from onboarding flow

* Remove scene-related modals

* Remove member/membership code

* Remove all scenes-related items from notifications

* Remove scene-related code from posts feed

* Remove scene-related API helpers

* Update tests
2023-01-17 10:11:30 -06:00
João Ferreiro d636ec6339 Unit Testing (#35)
* add testing lib

* remove coverage folder from git

* finished basic test setup

* fix tests typescript and import paths

* add first snapshot

* testing utils

* rename test files; update script flags; ++tests

* testing utils functions

* testing downloadAndResize wip

* remove download test

* specify unwanted coverage paths;
remove update snapshots flag

* fix strings tests

* testing downloadAndResize method

* increasing testing

* fixing snapshots wip

* fixed shell mobile snapshot

* adding snapshots for the screens

* fix onboard snapshot

* fix typescript issues

* fix TabsSelector snapshot

* Account for testing device's locale in ago() tests

* Remove platform detection on regex

* mocking store state wip

* mocking store state

* increasing test coverage

* increasing test coverage

* increasing test coverage on src/screens

* src/screens (except for profile) above 80% cov

* testing profile screen wip

* increase coverage on Menu and TabsSelector

* mocking profile ui state wip

* mocking profile ui state wip

* fixing mobileshell tests wip

* snapshots using testing-library

* fixing profile tests wip

* removing mobile shell tests

* src/view/com tests wip

* remove unnecessary patch-package

* fixed profile test error

* clear mocks after every test

* fix base mocked store values (getters)

* fix base mocked store values
(hasLoaded, nonReplyFeed)

* profile screen above 80% coverage

* testing custom hooks

* improving composer coverage

* fix tests after merge

* finishing composer coverage

* improving src/com/discover coverage

* improve src/view/com/login coverage
fix SuggestedFollows tests
adding some comments

* fix SuggestedFollows tests

* improve src/view/com/profile coverage
extra minor fixes

* improve src/view/com/notifications coverage

* update coverage ignore patterns

* rename errorMessageTryAgainButton
increase SuggestedFollows converage

* improve src/view/com/posts coverage

* improve src/view/com/onboard coverage

* update snapshot

* improve src/view/com/post coverage

* improve src/view/com/post-thread coverage
rename ErrorMessage tests
test Debug and Log components

* init testing state

* testing root-store

* updating comments

* small fixes

* removed extra console logs

* improve src/state/models coverage
refactor rootStore
rename some spies

* adding cleanup method after tests

* improve src/state/models coverage

* improve src/state/models coverage

* improve src/state/models coverage

* improve src/state/models coverage

* test setInterval in setupState

* Clean up tests and update Home screen state management

* Remove some tests we dont need

* Remove snapshot tests

* Remove any tests that dont demonstrate clear value

* Cleanup

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2023-01-17 10:06:00 -06:00
Paul Frazee 98c9a6ad32 Remove the avi from the compose prompt 2023-01-16 17:37:18 -06:00
Paul Frazee 33a4d2cbe5 Enlarge the view header 2023-01-16 17:21:35 -06:00
Paul Frazee 8a5bc60819 Dark mode color fixes 2023-01-16 17:11:15 -06:00
Paul Frazee f492fd4d41 Readd the FAB for composing new posts 2023-01-16 17:07:33 -06:00
Paul Frazee ed7204ab71 Round the corners on single-image embeds a bit more 2023-01-16 16:58:30 -06:00
Paul Frazee 9aeaa38f3b More spacing and sizing tweaks, including larger post controls 2023-01-16 16:54:35 -06:00
Paul Frazee b3f9ed7981 Enlarge post text slightly 2023-01-16 16:42:07 -06:00
Paul Frazee b8ab064fcc More spacing fixes, especially for the repost info 2023-01-16 16:34:52 -06:00
Paul Frazee 58bf9cb8cd Spacing fixes 2023-01-16 16:30:05 -06:00
Paul Frazee 8a67e8d102 Fix visual consistency of 'reply to' in post and use display name 2023-01-16 16:24:16 -06:00
Paul Frazee 5d6fc56349 Fix missing metrics in post threads 2023-01-16 16:22:24 -06:00
Paul Frazee 77ed2129d3 Move menu controls into post footers and improve meta info rendering 2023-01-16 16:09:51 -06:00
Aryan Goharzad fcebe8e0b0 Readme Cleanup (#40)
* Readme Cleanup

Updates instructions for starting the dev/staging servers

* Update README.md

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2023-01-16 15:40:34 -06:00
Paul Frazee 6df617003a Fix: remove duplicates in the TL caused by rendering reply parents 2023-01-16 14:49:58 -06:00
Paul Frazee 6953bf9d22 Fix image compression for avis and banner images 2023-01-12 15:07:32 -06:00
Paul Frazee 9396595595 Add scrolling to menu 2023-01-03 14:35:33 -06:00
Paul Frazee cf13b5cd4c Bump deps to pull in some bugfixes 2023-01-03 14:31:12 -06:00
Paul Frazee e24ab48b73 Indicate images in notifications 2023-01-03 13:14:10 -06:00
Paul Frazee bbee08eb22 Implement validation and proper type detection 2023-01-03 13:08:56 -06:00
Paul Frazee c68f291128 Improve handling around connection failures during login 2023-01-03 12:17:07 -06:00
Paul Frazee 32b3575074 Add 'is 13' checkbox to account creation 2023-01-03 11:49:40 -06:00
Paul Frazee 11f972c640 Fix to feed update 2023-01-03 11:26:51 -06:00
Paul Frazee 61cf754fd5 Fix session hydration during load 2023-01-03 11:08:39 -06:00
Paul Frazee 00b50c71b5 Fix bug in error handling 2023-01-03 11:08:29 -06:00
Paul Frazee 66eb6f2888 Introduce error boundaries around all screens 2023-01-02 21:49:14 -06:00
Paul Frazee bc571ee998 Improve error logging 2023-01-02 21:39:15 -06:00
Paul Frazee c758996034 Bump api@0.0.5 and use the type guard helpers 2023-01-02 20:56:35 -06:00
Paul Frazee 1f26494c94 Implement logging system 2023-01-02 17:38:13 -06:00
Paul Frazee 74bfc10e36 Dont mute posts for a user when viewing their profile 2023-01-02 13:45:27 -06:00
Paul Frazee e194e5de91 Implement account muting 2023-01-02 13:40:14 -06:00
Paul Frazee 09f96da982 Fix to loading state 2022-12-30 15:58:28 -06:00
Paul Frazee 6e48d63dda Fix the status bar coloring 2022-12-30 15:56:54 -06:00
Paul Frazee eec636897c Add dark mode toggle 2022-12-30 15:48:34 -06:00
Paul Frazee 777f30562b Integrate composer into design system 2022-12-30 15:42:09 -06:00
Paul Frazee 16e4bc66bd Various small fixes 2022-12-30 15:32:07 -06:00
Paul Frazee 98c5312a29 Integrate search into suggested follows 2022-12-30 15:21:09 -06:00
Paul Frazee 9971f1f035 Dont autofocus the search input 2022-12-30 15:12:36 -06:00
Paul Frazee dec9d97171 Integrate settings into design system and some various fixes/tweaks 2022-12-30 15:11:47 -06:00
Paul Frazee 355749e605 Integrate menu into design system 2022-12-30 15:08:10 -06:00
Paul Frazee 6268736bfa Integrate notifications into the design system 2022-12-30 13:34:10 -06:00
Paul Frazee a270d750c8 Integrate profile listings into design system 2022-12-30 13:20:55 -06:00
Paul Frazee 0eb4c7495e Update profile header to use design system 2022-12-30 13:13:10 -06:00
Paul Frazee b438318b92 Integrate the shell into the design system 2022-12-30 12:49:07 -06:00
Paul Frazee 01aaa6123f Integrate ViewSelector into design system 2022-12-30 12:40:16 -06:00
Paul Frazee 486a1f082c Integrate composer prompt into design system 2022-12-30 12:35:37 -06:00
Paul Frazee f943cbd04a Integrate ViewHeader into the design system 2022-12-30 12:29:11 -06:00
Paul Frazee c54fa5b2e4 Update threads to use design system 2022-12-30 12:19:45 -06:00
Paul Frazee 54c0115181 Improve image layout 2022-12-30 11:55:25 -06:00
Paul Frazee bb3a2fddfc Tune post controls 2022-12-28 19:37:30 -06:00
Paul Frazee 5135a13812 Update posts in feed to use the theming system 2022-12-28 19:20:02 -06:00
Paul Frazee 059c3b362d Update notifications 2022-12-28 15:53:06 -06:00
Paul Frazee 090ceb4c53 Tighten up spacing and dividers 2022-12-28 15:50:28 -06:00
Paul Frazee 7796203c25 Fix letter spacing 2022-12-28 15:08:14 -06:00
Paul Frazee 44ae514d89 Add a design system (#34)
* Add theming system

* Add standard Button control and update RadioButtons

* Unify radiobutton with design system

* Update debug screen to have multiple views

* Add ToggleButton

* Update error controls to use design system

* Add typography to <Text> element

* Move DropdownButton into the design system

* Clean out old code

* Move Text into design system

* Add 'inverted' color palette

* Move LoadingPlaceholder into the design system
2022-12-28 14:06:01 -06:00
Paul Frazee 12d8e06a1e Increase image resolutions 2022-12-26 17:41:12 -06:00
Paul Frazee de65d9198a Start with highest quality compression and find a suitable size (#33) 2022-12-26 12:01:40 -06:00
Paul Frazee 41bf8e15cd Bump @atproto/api@0.0.3 2022-12-22 14:43:54 -06:00
João Ferreiro adeb1d5cec Unit testing (#32)
* add testing lib

* remove coverage folder from git

* finished basic test setup

* fix tests typescript and import paths

* add first snapshot

* testing utils

* rename test files; update script flags; ++tests

* testing utils functions

* testing downloadAndResize wip

* remove download test

* specify unwanted coverage paths;
remove update snapshots flag

* fix strings tests

* testing downloadAndResize method

* increasing testing

* fixing snapshots wip

* fixed shell mobile snapshot

* adding snapshots for the screens

* fix onboard snapshot

* fix typescript issues

* fix TabsSelector snapshot

* Account for testing device's locale in ago() tests

* Remove platform detection on regex

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2022-12-22 09:32:39 -06:00
Paul Frazee 61511d5161 Unvendor the api and switch to @atproto/api 2022-12-22 09:17:07 -06:00
Paul Frazee aee205b0ab Fix issue which caused parent posts to fail at mobx reactivity 2022-12-21 14:37:22 -06:00
Paul Frazee e59763b50a Update to use new getTimeline, getAuthorFeed, and getPostThread output models 2022-12-20 22:54:56 -06:00
Paul Frazee 5168d44926 Replace removed hasIndexes behavior 2022-12-20 16:32:04 -06:00
Paul Frazee def3156c33 Get the composer into a passable visual state on android when the keyboard is open 2022-12-20 14:55:50 -06:00
Paul Frazee a290891f70 Fix post-meta truncation on android 2022-12-20 14:50:04 -06:00
Paul Frazee a96562e89c Fixes to text input colors on android 2022-12-20 14:29:50 -06:00
Paul Frazee 279d41fcd1 Wrap all <Text> in a helper that ensures black color is applied by default 2022-12-20 12:49:44 -06:00
Paul Frazee 4932505c5e Use consistent rendering of avis and post metas in threads 2022-12-20 10:33:56 -06:00
Paul Frazee 629b7d8c9b Proper fix to the previous panic fix: put threads at the end when they should be there 2022-12-20 09:20:53 -06:00
Paul Frazee 5c71f8e32a Fix to error condition that breaks the feed 2022-12-20 09:02:38 -06:00
Paul Frazee 395a8838be A couple more android updates 2022-12-19 19:43:28 -06:00
João Ferreiro 17903b817d rn-fetch-blob android setup 2022-12-19 19:26:54 -06:00
João Ferreiro 54f05bfcf6 minor fix 2022-12-19 19:26:54 -06:00
João Ferreiro b1a058d098 fixing remaining text colors on android 2022-12-19 19:25:58 -06:00
João Ferreiro 27657541f2 fixing modal & keyboard interaction on android 2022-12-19 19:23:24 -06:00
João Ferreiro 73ea67f5c0 initial android fixes 2022-12-19 19:20:44 -06:00
João Ferreiro d065b62f52 fix camera permissions 2022-12-19 19:19:00 -06:00
João Ferreiro eb03170736 fix android runtime 2022-12-19 19:19:00 -06:00
João Ferreiro 6f734f7978 fix android build 2022-12-19 19:19:00 -06:00
Paul Frazee 9235d6c13b Remove prefetch of feed (it wasnt working) 2022-12-19 19:16:56 -06:00
Paul Frazee bc54c8d7c6 Tighten up the post control hit regions 2022-12-19 19:13:26 -06:00
Paul Frazee 3b8dbbff12 Tighten up the home feed 2022-12-19 19:12:43 -06:00
Paul Frazee e8bb545023 Enable image-only posts 2022-12-19 18:51:13 -06:00
Paul Frazee f0b30e26d4 Fix to thread ordering in the feed: correctly identify the starts of threads when adjacent 2022-12-19 13:22:18 -06:00
Paul Frazee cbfa9f62a4 Improve thread rendering 2022-12-18 18:54:05 -06:00
Paul Frazee fefd8cc8a0 Add WIP 'report account' modal 2022-12-18 17:45:23 -06:00
Paul Frazee 09765a5d36 Add WIP 'report post' modal 2022-12-18 17:28:28 -06:00
Paul Frazee e325b72c62 Reduce confusing visual feedback while scrolling 2022-12-18 16:43:18 -06:00
Paul Frazee 055a4d8e98 Add zooming to the lightbox 2022-12-16 16:32:54 -06:00
Paul Frazee 1e28ae6d2a Prefetch feed refreshes to speed up 'load more posts' 2022-12-16 15:37:13 -06:00
Paul Frazee 16343a2936 Fixes to the composer UX around images and scrolling 2022-12-16 14:48:37 -06:00
Paul Frazee 18cc2183cc Add swipe gestures to the lightbox 2022-12-16 11:57:45 -06:00
Paul Frazee 5e711c799b Implement 'forgot password' flow 2022-12-15 17:45:03 -06:00
Paul Frazee ca4b9d3a60 Split login screen into component files 2022-12-15 14:06:05 -06:00
Paul Frazee ebd03ffe2a Just do full renders of parent posts in the feed 2022-12-15 11:43:05 -06:00
Paul Frazee ee4f0673f1 Dont use ??= 2022-12-15 10:21:25 -06:00
Paul Frazee 33145f2e71 Improve handling of connection loss 2022-12-14 16:03:10 -06:00
Paul Frazee 721fd84a7e Fix state-tracking 2022-12-14 15:49:45 -06:00
Paul Frazee a06fd7dfd4 Reset feeds on login 2022-12-14 15:49:38 -06:00
Paul Frazee bd6bb4df06 Add haptic feedback to likes and reposts 2022-12-14 15:46:21 -06:00
Paul Frazee bb4dc3c3a5 Add post embeds (images and external links) 2022-12-14 15:35:15 -06:00
Paul Frazee 7b7fe7ccd8 Move posts feed to root store (me) and ensure new posts always update the feed 2022-12-13 15:52:18 -06:00
Paul Frazee 316679ae68 Fix: avoid dup keynames in posts feed 2022-12-13 15:51:54 -06:00
Paul Frazee b34cae6db4 Enlarge feed avis slightly 2022-12-13 15:40:55 -06:00
Paul Frazee 52e31394ab Ensure load more is always visible 2022-12-13 15:36:05 -06:00
Paul Frazee 84f18e03fa Use avatar in viewheader when cant go back 2022-12-13 15:35:45 -06:00
Paul Frazee 30761594ec Fix: avoid duplicate key names in notifications 2022-12-13 15:35:11 -06:00
Paul Frazee 87258a2439 Fix issue that caused repost & trend data to get lost on feed updates 2022-12-13 15:17:18 -06:00
Paul Frazee 6e31e928a9 Hide main menu drawer on click outside 2022-12-13 15:01:14 -06:00
Paul Frazee d0587c81f8 Use full available screen 2022-12-13 14:58:25 -06:00
Paul Frazee 29018f06b9 Fix: show avatars in all notifications 2022-12-13 14:53:00 -06:00
Paul Frazee 171cb6b3d3 Debug: disable feed reordering to isolate bugs 2022-12-13 11:15:32 -06:00
Paul Frazee 3e37c27310 Reposition 'load latest' based on minimal shell mode 2022-12-13 11:15:18 -06:00
Paul Frazee 06c3ebe2d4 Hide footer on scroll down (minimal shell mode) 2022-12-12 16:04:14 -06:00
Paul Frazee d336cd58b1 Improvements to service selection during login 2022-12-12 15:13:45 -06:00
Paul Frazee 684f67a8e0 Add profile image lightbox 2022-12-12 14:54:56 -06:00
Paul Frazee a7b23613d3 Improve session management 2022-12-12 14:39:02 -06:00
Paul Frazee a6db1a9ee3 Add banner image upload to profiles 2022-12-12 13:47:18 -06:00
Paul Frazee 0f065b2c27 Improvements to 'edit profile' error messages 2022-12-12 13:17:40 -06:00
Paul Frazee 7399e37bba Add 'loading more' spinner to feeds 2022-12-12 11:22:54 -06:00
Paul Frazee 7ce4c821e5 Tune the swipe gesture to detect more easily 2022-12-12 11:11:37 -06:00
Paul Frazee 68dd96128a More aesthetic and perf improvements to the menu drawer 2022-12-12 10:48:36 -06:00
Paul Frazee 6e55149281 Fix duplicate 'end of feed' issue 2022-12-12 09:56:19 -06:00
Paul Frazee 3aca890da6 Improve aesthetic of main menu swipeout (use screen mask) 2022-12-09 11:46:49 -06:00
Paul Frazee 4798d44110 Add main menu button 2022-12-09 11:22:19 -06:00
Paul Frazee 37b2b40aa1 Show 'processing' spinner in edit profile modal 2022-12-08 16:08:15 -06:00
Paul Frazee f9e287b12c Turn the main menu into a 'drawer' instead of a screen in the history 2022-12-08 15:34:22 -06:00
Paul Frazee 96dc9e398b Switch to temporary 'fixed tabs' model for default and notifications 2022-12-08 14:21:28 -06:00
Paul Frazee 2f0157dd33 Add avatar images and fix some type signatures 2022-12-08 13:45:23 -06:00
Paul Frazee f608712308 Replace reanimated for tabs selector 2022-12-07 17:08:49 -06:00
Paul Frazee 3807f216fe Cleanup 2022-12-07 16:59:10 -06:00
Paul Frazee 6b1a5374ae Replace navigational 'back swipe' gesture with new HorzSwipe util 2022-12-07 16:56:14 -06:00
Paul Frazee 71b7158ff9 Add HorzSwipe gesture and integrate it into the ViewSelector 2022-12-07 15:51:06 -06:00
Paul Frazee 26f06d768c Switch to react-native default animation tools for composer and post controls 2022-12-06 17:43:54 -06:00
Paul Frazee 383a40bc03 Fix mention-creation and implement mentions in notifications 2022-12-06 13:47:52 -06:00
Paul Frazee 8413fccdb5 Better empty state in profiles 2022-12-06 13:09:18 -06:00
Paul Frazee 3161703d8a Ensure all feed views can refresh 2022-12-06 13:04:40 -06:00
Paul Frazee 4c097d89c5 Add build version to menu 2022-12-06 12:40:40 -06:00
Paul Frazee 0b50ae3e61 Add context to replies when appearing in the feed 2022-12-06 12:29:13 -06:00
Paul Frazee 063583bb6f Implement terms-of-service and privacy-policy links in signup 2022-12-06 11:39:46 -06:00
Paul Frazee f2da9f2d0a Update API build 2022-12-06 11:39:30 -06:00
João Ferreiro fc7fa8a354 Upload profile image (#29)
* add editable button profile picture

* add editable button cover picture

* upload profile photos (save them locally)

* rollback pbxproj changes

* rollback podfile checksum (for git only)

* move edit photos onto edit profile modal

* adjust edit icon and image cropping size

* added temporary (react state) image

* added IMAGES_ENABLED flag

* minor lint fix

* save local photos on edit profile upload (wip)

* save profile photos on profile view state (wip)

* remove unecessary computed

* save photo in state before pushing it to viewmodel

* refactor profile pictures's state

* remove unnecessary isMe prop

* removing old comments

* tweak icon size & position

* A few styling tweaks and a fix to mobx state management

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2022-12-06 10:57:15 -06:00
Paul Frazee 709a970cdc Fix to unicode zero-width characters in expanded posts 2022-12-06 10:15:59 -06:00
Paul Frazee 5d7814897c Never allow undefined values in me model 2022-12-06 10:11:45 -06:00
Paul Frazee 1e2ee001a8 Rework the 'main menu' to be a screen that's always in history 2022-12-06 10:11:32 -06:00
Paul Frazee 11423fc25c Add missing usage descriptions for ios 2022-12-06 10:08:27 -06:00
Paul Frazee 160fc31b47 Enlarge the small emoji-only replies 2022-12-05 15:40:33 -06:00
Paul Frazee 3389e0dc4a Dismiss keyboard in search on scroll 2022-12-05 15:22:23 -06:00
Paul Frazee ae8162974e Add 'copy post text' tool 2022-12-05 15:03:42 -06:00
Paul Frazee b33269a535 Better sized and more informative character counter 2022-12-05 13:59:13 -06:00
Paul Frazee d8280b6ad9 Switch to System font to fix emoji rendering 2022-12-05 13:44:24 -06:00
Paul Frazee 935cc8f675 Fix: never attempt update on 0 items 2022-12-05 13:36:13 -06:00
Paul Frazee 3bd6e9c84c Increase touch-size of the 'load new posts' button 2022-12-05 13:33:31 -06:00
Paul Frazee f1b9114af0 Ensure the UI always renders, even in bad network conditions (close #6) 2022-12-05 13:25:04 -06:00
Paul Frazee 95e5b169c8 Merge branch 'upload-image' into main 2022-12-05 11:25:33 -06:00
Paul Frazee 09791a3b3c Remove loading-placeholder animation; according to some issues, animated linear-gradients may cause crashes 2022-12-05 10:50:46 -06:00
Paul Frazee c7a5642e48 Fix 'swipe back to nothing' bug 2022-12-05 10:39:34 -06:00
Paul Frazee 6c23972620 Make 'backswipe' a little easier to trigger 2022-12-05 10:25:53 -06:00
Paul Frazee 211af98aaf Enlarge click targets for post controls and view header 2022-12-05 10:18:38 -06:00
Paul Frazee bc404572cb Hide images behind a build flag until ready 2022-12-02 10:48:57 -06:00
João Ferreiro b824ac710b Upload image in composer (#27)
* upload images in composer v1

* fix android compile

* reafctor image carousel into new component;
fix photo overlapping text in composer

* revert android changes

* further refactoring code into different components

* move show carousel out of the component

* fixing add photo using camera

* fix typescript issue; force mediatype photo

* change post test with photo attached;
remove auto linking settings

* use runInAction in getPhotos model

* react-hooks/exhaustive-deps fixes

* crop every photo;
make use of useCallback

* moving placeholder condition

* Cleanup

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2022-12-02 10:41:01 -06:00
Paul Frazee 372cd80175 Cleanup 2022-12-02 10:40:22 -06:00
João Ferreiro d0c9f95c7e moving placeholder condition 2022-11-29 18:32:07 +00:00
João Ferreiro 91a06f2390 crop every photo;
make use of useCallback
2022-11-29 18:26:16 +00:00
João Ferreiro ffd333164b react-hooks/exhaustive-deps fixes 2022-11-29 17:51:06 +00:00
João Ferreiro a6e8bb39b8 use runInAction in getPhotos model 2022-11-29 17:46:55 +00:00
João Ferreiro 8d87fbd56a change post test with photo attached;
remove auto linking settings
2022-11-29 16:45:44 +00:00
João Ferreiro a129ddba27 Merge branch 'main' into upload-image 2022-11-29 16:19:38 +00:00
João Ferreiro 211b9fc2f2 fix typescript issue; force mediatype photo 2022-11-29 16:19:15 +00:00
João Ferreiro 8b6bb6999d fixing add photo using camera 2022-11-29 16:11:17 +00:00
Paul Frazee 524cb062a2 Improvements to link and mention detection regarding surrounding punctuation 2022-11-29 10:01:57 -06:00
João Ferreiro be71989e45 move show carousel out of the component 2022-11-29 16:00:21 +00:00
João Ferreiro edb5a8ddb2 Merge branch 'main' into upload-image 2022-11-29 15:36:26 +00:00
João Ferreiro fb461c0344 further refactoring code into different components 2022-11-29 15:35:49 +00:00
Paul Frazee a8608d0170 Relax the requirement that post entities match their value 2022-11-29 09:35:10 -06:00
Paul Frazee 628f69605c Decode html entities in link embeds 2022-11-29 09:29:57 -06:00
João Ferreiro 537770b39d revert android changes 2022-11-29 15:25:32 +00:00
João Ferreiro 44eca8a550 reafctor image carousel into new component;
fix photo overlapping text in composer
2022-11-29 10:59:32 +00:00
João Ferreiro 3a79e46a4a Merge branch 'main' into upload-image 2022-11-29 10:29:19 +00:00
Paul Frazee 6f56a8c539 Improve handling of deleted posts 2022-11-28 16:37:39 -06:00
Paul Frazee 2ac28aa2de Fixes to edit profile modal 2022-11-28 14:51:49 -06:00
Paul Frazee 53c55b2d7a Fix jank in notifications loading-state rendering 2022-11-28 14:22:19 -06:00
Paul Frazee 31e0fa898a Use a persistent notifications model to improve load times of the notifications view 2022-11-28 14:19:49 -06:00
Paul Frazee 1ec46a00e2 Improve unread notification styling 2022-11-28 13:56:05 -06:00
Paul Frazee d98fbbbe4d Batch notification loads to avoid layout reflows due to async 2022-11-28 13:45:49 -06:00
João Ferreiro ef02ec9ab1 fix android compile 2022-11-28 16:56:23 +00:00
João Ferreiro 72fe122005 Merge branch 'main' into upload-image 2022-11-28 16:56:05 +00:00
João Ferreiro 4b960bc320 upload images in composer v1 2022-11-28 16:46:58 +00:00
Paul Frazee 090ea1a3f4 Slow down and enlarge post-ctrl animations (close #11) 2022-11-28 10:40:25 -06:00
Paul Frazee 983f2349e0 Fix toast positioning (close #9) 2022-11-28 10:38:16 -06:00
Paul Frazee 8af98b4a52 Set a page-size on notifications 2022-11-28 10:22:52 -06:00
Paul Frazee d821803050 Fix a couple incorrect link detections ('e.g.' and 'foo.jpg') (close #13) 2022-11-28 10:22:08 -06:00
Paul Frazee 35ead0155e Remove the 'warning color' from the character counter 2022-11-28 09:58:40 -06:00
Paul Frazee 5b908f5358 Tune post-thread expanded view: add reply prompt, fix spacing and sizing 2022-11-28 09:49:41 -06:00
Paul Frazee 099fea6624 Enlarge the 'load more posts' prompt 2022-11-28 09:30:31 -06:00
Paul Frazee a2ef0b5a68 Enlarge the view header, left align the title, and add a compose button 2022-11-28 09:29:35 -06:00
Paul Frazee 38c17e06bb Update composer to shrink fonts and use more consistent visuals; also autofocus the input 2022-11-28 09:14:04 -06:00
Paul Frazee c7c0c04b66 Increase information density and enlarge some click targets 2022-11-28 09:13:37 -06:00
Paul Frazee bc7364acca Fix 'load more' showing up incorrectly 2022-11-28 08:30:34 -06:00
Paul Frazee 1e9d265403 Add link embeds to posts 2022-11-23 17:01:00 -06:00
Paul Frazee 02689c5533 Implement a link metadata fetching util function 2022-11-23 16:29:17 -06:00
Paul Frazee d0f6da2a51 Include reposts in no-replies view of feeds 2022-11-23 16:27:49 -06:00
Paul Frazee 2e9a858e3d Remove webcrypto polyfill, as it's no longer needed 2022-11-23 15:04:44 -06:00
Paul Frazee 8e46204617 Detect links in profile bios 2022-11-23 14:53:33 -06:00
Paul Frazee b844e479a1 Add replying-to context to threads 2022-11-23 14:22:40 -06:00
Paul Frazee f7ccf14211 Ensure threads group together posts by op 2022-11-23 13:45:50 -06:00
Paul Frazee 814ddb194a Disable landscape orientation in iPhones 2022-11-23 13:34:45 -06:00
Paul Frazee d7103412e5 Fix: Adjust home TL post dedup to ensure polling works correctly 2022-11-23 13:29:26 -06:00
Paul Frazee ad4c413ae4 Show parent post in composer when replying (close #3) 2022-11-23 13:28:29 -06:00
Paul Frazee f0ed5d7c28 Fix: dont detect double dots as urls 2022-11-23 13:15:38 -06:00
Paul Frazee e8304bb77d Fix keyboard issues in search 2022-11-23 13:12:29 -06:00
Paul Frazee 5ae10f17c5 Turn composer character counter into a countdown 2022-11-23 13:07:09 -06:00
Paul Frazee 4b8de11046 Handle bsky.app links natively 2022-11-23 10:51:20 -06:00
Paul Frazee 27f94052e9 Longer shortened URLs 2022-11-23 10:44:55 -06:00
Paul Frazee 8004d038ab Add threading to post feeds 2022-11-23 10:39:28 -06:00
Paul Frazee ff9d7346ec Fallback to display name in search results 2022-11-22 16:18:10 -06:00
Paul Frazee c0298dc7b7 Implement user search 2022-11-22 16:14:58 -06:00
Paul Frazee ab0f4f8288 Keep fetching suggestions to reach a full list 2022-11-22 15:53:23 -06:00
Paul Frazee 148fa29875 Farewell, todos.txt 2022-11-22 14:31:46 -06:00
Paul Frazee f13c42c078 Add support for links with no scheme in composer 2022-11-22 14:30:35 -06:00
Paul Frazee a079605049 Fix to tests 2022-11-22 14:30:13 -06:00
Paul Frazee 56d98abe64 Shorten rendered URLs in posts 2022-11-22 13:16:40 -06:00
Paul Frazee dab5a36a58 Fix to thread reply lines (fill full space) 2022-11-22 13:04:54 -06:00
Paul Frazee 65e80556e8 Add bottom padding to threads 2022-11-22 12:58:08 -06:00
Paul Frazee b60406f960 Scroll to highlighted post in threads 2022-11-22 12:56:56 -06:00
Paul Frazee 4d2c2c5f2a Add compose prompt to home feed empty state 2022-11-22 12:29:50 -06:00
Paul Frazee deb7c1bba7 Add 'posts & replies' view to profiles 2022-11-22 12:26:53 -06:00
Paul Frazee 8b1134dc75 Turn home button into a 'go back to start of nav history' 2022-11-22 12:19:38 -06:00
Paul Frazee a83da7367c Change post prompt to 'Whats up?' 2022-11-22 12:16:08 -06:00
Paul Frazee ec3ba2ebc8 Shrink and darken the post controls a little 2022-11-22 12:15:26 -06:00
Paul Frazee ab4f828865 Shrink the footer a bit 2022-11-22 12:02:45 -06:00
Paul Frazee c72e1b6635 Refactor: create src/lib to reflect actual sharing of that code 2022-11-22 12:02:31 -06:00
Paul Frazee 4e245f8471 Merge branch 'simplify' into main 2022-11-21 18:55:08 -06:00
Paul Frazee 652362b0c2 Track rotated auth tokens 2022-11-21 16:17:40 -06:00
Paul Frazee abd6ffdbf5 Add web linking and proper share controls 2022-11-21 16:07:26 -06:00
Paul Frazee 0dc1c904ed Adjust control alignment 2022-11-20 16:29:43 -06:00
Paul Frazee a8bdb4a288 Fix the pointy edges on the arrow icons 2022-11-20 16:24:44 -06:00
Paul Frazee 9ec2712728 Move search btn into the viewheader 2022-11-20 12:25:11 -06:00
Paul Frazee 64609575e7 Add build flags and disable tabs for now 2022-11-20 12:00:40 -06:00
Paul Frazee 09411967e8 Adjust post control sizing and alignment 2022-11-20 11:45:31 -06:00
Paul Frazee fbec25412b Remove downvotes from the UI 2022-11-20 11:32:13 -06:00
Paul Frazee ffe51591e8 Replace the FAB with a compose prompt at the top of the feed 2022-11-20 11:20:08 -06:00
Paul Frazee f11ef7ba0b Dont group notifications that are an hour apart 2022-11-18 15:38:20 -06:00
Paul Frazee 0439674aa9 Fix data loss on notifications-view update 2022-11-18 14:17:26 -06:00
Paul Frazee e609f8dadb Dedup posts in the home TL 2022-11-18 14:05:19 -06:00
Paul Frazee 6af2e1d162 Add support for web links 2022-11-18 13:59:17 -06:00
Paul Frazee 35e46a5b60 Fix rendering of mentions in composer 2022-11-18 11:55:05 -06:00
Paul Frazee 14ca7602e9 Add long press newtab to footer nav 2022-11-18 11:40:12 -06:00
Paul Frazee 7c719f3af8 Fix richtext link rendering 2022-11-18 11:37:25 -06:00
Paul Frazee 547965b528 Spacing and sizing fixes 2022-11-18 11:37:12 -06:00
Paul Frazee 85a425bf3e Dont autofocus composer to avoid a bug with keyboard avoiding views 2022-11-18 11:10:29 -06:00
Paul Frazee d9d9344fcc Small sizing and spacing tweaks 2022-11-18 11:10:19 -06:00
Paul Frazee 67fb6b23da Add min height to post text 2022-11-18 10:58:48 -06:00
Paul Frazee 2a4391af97 Fix avatar click target in posts 2022-11-18 10:48:18 -06:00
Paul Frazee fec3aa2e2f Fix post thread title 2022-11-17 16:26:00 -06:00
Paul Frazee 4fcc0accc7 Add padding to the bottom of the feed to ensure compose btn doesnt cover it 2022-11-17 16:07:38 -06:00
Paul Frazee 3da90128f0 Improve reliability of screen titles 2022-11-17 16:01:29 -06:00
Paul Frazee 038556cc58 Add new tab animation 2022-11-17 15:44:54 -06:00
Paul Frazee f42ff8e4cf Add live search to autocomplete and only highlight known handles 2022-11-17 14:35:12 -06:00
Paul Frazee d073049ed2 Fix loadLatest() on home feed 2022-11-17 13:17:08 -06:00
Paul Frazee b165d076f1 Fix: correctly set visible on screens 2022-11-17 13:15:04 -06:00
Paul Frazee c16e1b8fb1 Improve perf of post rendering 2022-11-17 13:02:53 -06:00
Paul Frazee a527c1086a Invalidate profiles cache on direct load 2022-11-17 13:01:57 -06:00
Paul Frazee 6be082e728 Clear session when auth fails 2022-11-17 12:33:59 -06:00
Paul Frazee f99cdba6dd Poll periodically for new posts 2022-11-17 12:33:19 -06:00
Paul Frazee 397ace5c11 Improve coffee 2022-11-17 11:29:35 -06:00
Paul Frazee 924c76f11b Add tabs explainer and fix 'black screen' during onboard 2022-11-17 11:21:04 -06:00
Paul Frazee d875933412 Lighten the post controls 2022-11-17 11:03:38 -06:00
Paul Frazee c5a81dcc71 Fix positioning with overflows in the post meta 2022-11-17 10:56:42 -06:00
Paul Frazee 28a9fe85d5 Include tab count and move btn to center 2022-11-17 10:37:30 -06:00
Paul Frazee 29d5cef912 Open in new tab on long press 2022-11-17 10:36:57 -06:00
Paul Frazee 0e935a50e7 Avoid overlap against phone header when tabs selector is open 2022-11-17 10:24:40 -06:00
Paul Frazee 61de9aaea6 Fix header spacing for when dark mode is active 2022-11-17 10:15:48 -06:00
Paul Frazee 83a533a0dc Show bold icons in footer based on state 2022-11-16 18:04:21 -06:00
Paul Frazee 2e7da95e5b Add a fancy 'drawer' animation to the tabs selector 2022-11-16 17:18:16 -06:00
Paul Frazee 93a7667c83 Add post deletion to highlighted post in threads 2022-11-16 16:18:15 -06:00
Paul Frazee 51f78cef9a Add post deletion 2022-11-16 16:16:43 -06:00
Paul Frazee bf7581e8e3 Clear notifications count optimistically 2022-11-16 14:36:16 -06:00
Paul Frazee aa7a5964f2 Fix composer positioning 2022-11-16 14:33:01 -06:00
Paul Frazee 30c0a5f4b1 Fix input positioning for small screens 2022-11-16 14:28:33 -06:00
Paul Frazee a3c3b1cd27 Fix sizing on smaller phones 2022-11-16 14:05:21 -06:00
Paul Frazee cc775dcdc0 Nicer loading state for profiles 2022-11-16 13:32:10 -06:00
Paul Frazee 5d9c21c2a5 Reduce jank in refreshes 2022-11-16 13:18:53 -06:00
Paul Frazee 9a19607f3f Add placeholder loading states 2022-11-16 13:05:36 -06:00
Paul Frazee 3d0eeb01f8 Improve reliability of modal close 2022-11-16 12:37:46 -06:00
Paul Frazee 310ec3a574 Fix up/down vote number changes 2022-11-16 11:02:36 -06:00
Paul Frazee 96d12df021 Add animations to post controls 2022-11-16 10:58:39 -06:00
Paul Frazee f382d6f3a5 Update prod service URL 2022-11-16 10:06:57 -06:00
Paul Frazee 6de99fd964 Better invite code error message 2022-11-15 15:13:55 -06:00
Paul Frazee bc76c7ffb8 Add a server instance selector and drop env vars 2022-11-15 15:09:50 -06:00
Paul Frazee 20ed8da853 Switch to using setVote() 2022-11-15 13:19:21 -06:00
Paul Frazee aaf10bfdbf Add current user profile to header and enlarge the header 2022-11-15 13:11:01 -06:00
Paul Frazee 36b9020f36 Add compose button to notifications, profile, and search 2022-11-15 13:00:00 -06:00
Paul Frazee 5ec8fcf350 Add missing dep 2022-11-15 12:54:15 -06:00
Paul Frazee 194c6dc0fd Improve connectivity-issue error message 2022-11-15 12:54:04 -06:00
Paul Frazee aadec58087 Better loading screens 2022-11-15 12:07:41 -06:00
Paul Frazee 1b1883aa30 Improve empty states 2022-11-15 10:54:43 -06:00
Paul Frazee 020a0bc882 Improve error messages 2022-11-15 10:46:12 -06:00
Paul Frazee f2bf75e85e Add profile info caching 2022-11-14 16:56:59 -06:00
Paul Frazee 957f42698e Disable storing nav state due to bugs 2022-11-14 16:56:40 -06:00
Paul Frazee fd436dcd9b Add more info to routing 2022-11-14 16:30:06 -06:00
Paul Frazee 9e32b64d57 Restore nav state hydration 2022-11-14 16:28:58 -06:00
Paul Frazee 7d39cb5f6b Improve not found page 2022-11-14 16:27:59 -06:00
Paul Frazee a8cd419b08 Use only alphabet in generated avatar 2022-11-14 15:58:21 -06:00
Paul Frazee c20d941a77 Update all state on profile change 2022-11-14 15:55:38 -06:00
Paul Frazee 93741ac50e Make 'back swiping' a little easier 2022-11-14 15:47:56 -06:00
Paul Frazee f83739fdb9 Enforce limits on create scene as well 2022-11-14 15:19:08 -06:00
Paul Frazee daf91112f5 Fix double-posting bug 2022-11-14 15:10:34 -06:00
Paul Frazee d406b3a5c2 Fix issue causing double-loads of notifications 2022-11-14 15:02:42 -06:00
Paul Frazee 09b8ae0fed Automatically add the domain to the handle during signin 2022-11-14 14:30:59 -06:00
Paul Frazee 683a456b5c Fix empty states for scene members and memberships 2022-11-14 14:24:23 -06:00
Paul Frazee 265af0d720 Fix: scroll all the way down on home feed 2022-11-14 14:18:42 -06:00
Paul Frazee 30f6636a95 Fix overflows in post meta info 2022-11-14 14:16:31 -06:00
Paul Frazee 03980afe98 Turn off autocorrect and auto-lowercase login handle 2022-11-14 14:01:01 -06:00
Paul Frazee a3f2c28c13 Add link behaviors to search screen suggestions 2022-11-14 13:52:23 -06:00
Paul Frazee 2850887c71 Dont suggest followed users and add empty state to suggestions 2022-11-14 13:48:57 -06:00
Paul Frazee 8a403407cb Dont include self in suggested follows 2022-11-14 13:42:53 -06:00
Paul Frazee 73f1f464d8 Always fallback from displayName to handle 2022-11-14 13:39:10 -06:00
Paul Frazee 16c06cd997 Turn 'include reason' on posts into a link 2022-11-14 13:36:09 -06:00
Paul Frazee 0f1a59641a Reposition to handle scene creation keyboard view 2022-11-14 13:32:04 -06:00
Paul Frazee bd62ab2f92 Change appid to xyz.blueskyweb.app 2022-11-14 13:13:08 -06:00
Paul Frazee 4727fb25ce Improvements to the feature explainer, including intro screen and screenshot of scenes 2022-11-14 13:12:29 -06:00
Paul Frazee 0947970514 Add staging env 2022-11-11 15:02:19 -06:00
Paul Frazee 04b081bbd7 Implement profile updates 2022-11-11 14:15:43 -06:00
Paul Frazee 3a6bb19cad Add UI to remove members from scenes 2022-11-11 13:28:23 -06:00
Paul Frazee 77650f328b Implement trending 2022-11-11 13:10:05 -06:00
Paul Frazee 424a08c4a0 Handle pending invites correctly 2022-11-11 12:49:53 -06:00
Paul Frazee 18d96ce0ce Disable scene discover btn for now 2022-11-11 10:17:23 -06:00
Paul Frazee 60f4d64af6 Only suggest users in invite suggestions 2022-11-11 10:17:14 -06:00
Paul Frazee 5664ecbd0c Fixes to onboarding 2022-11-10 17:19:45 -06:00
Paul Frazee 4fa74c0d38 Fixes to account creation 2022-11-10 17:05:26 -06:00
Paul Frazee 6b3780f6d1 Fix follows 2022-11-10 16:35:13 -06:00
Paul Frazee 7d90638188 Implement scene invitation and membership controls 2022-11-10 16:30:14 -06:00
Paul Frazee 28c2591e0b More informative empty state for scenes 2022-11-09 17:34:55 -06:00
Paul Frazee 2b58550d36 Add scene creator 2022-11-09 15:57:49 -06:00
Paul Frazee 22e619d0ea Add 'you are a member' line to scene headers and small other tweaks 2022-11-09 13:48:40 -06:00
Paul Frazee a32b067057 Add creator to scene profile header 2022-11-09 13:12:03 -06:00
Paul Frazee 482f848281 Implement scene member/memberships listings 2022-11-08 16:37:21 -06:00
Paul Frazee 6f97f8a84b Implement scenes listing in main menu 2022-11-08 15:56:22 -06:00
Paul Frazee 0168efd737 Finish the upvote/downvote implementation 2022-11-08 12:14:51 -06:00
Paul Frazee bb1d0ab0d9 Add search view; factor out SuggestedFollows component; add suggested follows to search 2022-11-07 16:24:06 -06:00
Paul Frazee 0fae45e8df Add onboarding (WIP) 2022-11-07 15:35:51 -06:00
Paul Frazee 34203fcbce Reuse service address 2022-11-07 11:45:26 -06:00
Paul Frazee e64fe9d36e Sizing and spacing fixes based on on-device testing 2022-11-05 16:12:06 -05:00
Paul Frazee 11c5000b5b Unify profile follow btn colors with the rest 2022-11-05 15:07:28 -05:00
Paul Frazee 1e5046c679 Set ios app icon 2022-11-05 14:55:41 -05:00
Paul Frazee 9344f7f20d Add splash screen to ios 2022-11-05 14:52:44 -05:00
Paul Frazee b724b0d3eb Rename to bsky.app 2022-11-05 13:56:22 -05:00
Paul Frazee 6703f0c068 Replace likes with votes on post UIs 2022-11-05 13:48:45 -05:00
Paul Frazee 88345d7cb5 More profile header tweaks 2022-11-05 13:02:21 -05:00
Paul Frazee 266cd69348 Tweak profile header 2022-11-05 12:43:21 -05:00
Paul Frazee 1ae5318af0 Switch to procedurally-generated banners 2022-11-05 12:33:59 -05:00
Paul Frazee 992b79384f Add actor types to the profiles and clean up the UI 2022-11-05 11:58:48 -05:00
Paul Frazee f9fa6229b2 Update to new textslice 2022-11-04 17:56:48 -05:00
Paul Frazee 2c5b988de0 Update to the latest APIs 2022-11-04 17:39:54 -05:00
Paul Frazee feac39e657 Rework the composer to a less buggy solution 2022-11-01 14:25:41 -05:00
Paul Frazee 1fa4419da1 Remove old tabs selector modal 2022-11-01 14:00:58 -05:00
Paul Frazee f49f8b6495 Add animation to the tabs selector 2022-11-01 13:46:07 -05:00
Paul Frazee c122f8a9d7 Replace notifications icon 2022-11-01 13:45:58 -05:00
Paul Frazee 91dd25f7b1 Replace footer-nav back and forward arrows with search and notifications 2022-11-01 11:53:30 -05:00
Paul Frazee 0d1cdb7a38 Add consistent view headers 2022-11-01 11:06:43 -05:00
Paul Frazee 9238504db9 Update scene items in mainmenu to use generated avatars 2022-11-01 10:06:24 -05:00
Paul Frazee 774a3a653e Improve animation jitter in main menu 2022-11-01 10:02:24 -05:00
Paul Frazee 497155b84c Fix typo 2022-10-31 17:24:58 -05:00
Paul Frazee b03cc5862b Switch to autogenerated avis for now 2022-10-31 17:23:47 -05:00
Paul Frazee b76a6109cf WIP scene UIs 2022-10-31 12:17:58 -05:00
Paul Frazee 97d8b7cf23 Fix some useEffect() cleanup issues 2022-10-26 14:48:15 -05:00
Paul Frazee 48158e05cb Update to latest APIs 2022-10-26 14:34:47 -05:00
Paul Frazee 20890227c9 Add contacts screen 2022-10-12 18:56:10 -05:00
Paul Frazee ed86125d87 Update api nsids 2022-10-12 15:18:46 -05:00
Paul Frazee 4b8795bfea Improve main menu (animation, aesthetics) 2022-10-11 15:16:46 -05:00
Paul Frazee 07a234e0f2 Home button scrolls to top when on home page 2022-10-11 09:37:01 -05:00
Paul Frazee bf42123576 Rearrange shell buttons to merge notifications into menu and bring back forward 2022-10-11 09:19:09 -05:00
Paul Frazee 37016ccf9f Remove the firehose view from home 2022-10-11 09:18:39 -05:00
Paul Frazee 47b8b93c2c Speed up shell nav button presses 2022-10-11 09:18:24 -05:00
Paul Frazee c5f744870f Rework footer controls 2022-10-10 21:13:25 -05:00
Paul Frazee 993a273d76 Rework profile header controls 2022-10-10 21:13:10 -05:00
Paul Frazee 6ee93cdbc4 Add firehose view to home screen 2022-10-04 14:22:20 -05:00
Paul Frazee 9a57f5de5e Update to new get*Feed xrpc methods 2022-10-04 12:55:25 -05:00
Paul Frazee 94f365f564 Update the view after a post is created 2022-10-04 11:33:32 -05:00
Paul Frazee 01515de17d Implement profile-update api 2022-10-04 11:10:24 -05:00
Paul Frazee f074d6017d Implement a couple missing bits 2022-10-04 10:53:08 -05:00
Paul Frazee 5b96be04b4 Fix to mention rendering 2022-10-04 10:26:33 -05:00
Paul Frazee de7951074a Choose mention candidates from follows 2022-10-04 10:18:35 -05:00
Paul Frazee 990b3c7084 Fixes to entity extraction 2022-10-04 10:15:35 -05:00
Paul Frazee 7de013f467 Implement mentions rendering 2022-10-03 16:02:03 -05:00
Paul Frazee ba417935f0 Fix to auth of mutation ops 2022-10-03 11:17:12 -05:00
Paul Frazee a77988a984 Implement notifications 2022-10-03 10:53:36 -05:00
Paul Frazee 5b8d0957b3 Remove debug time delays 2022-09-30 11:30:18 -05:00
Paul Frazee a913745b8f Fix thread view sizing 2022-09-29 15:17:31 -05:00
Paul Frazee 2f7e3da138 Clear all state on signout 2022-09-29 13:55:07 -05:00
Paul Frazee 13ce232455 Add settings page 2022-09-29 11:59:11 -05:00
Paul Frazee a67b4847ca Light icons 2022-09-29 10:40:05 -05:00
Paul Frazee 49beea6cc8 Add profile to tabs selector modal 2022-09-29 09:24:36 -05:00
Paul Frazee ee81540c64 More blue theming 2022-09-29 09:11:48 -05:00
Paul Frazee ccd3492e1e Beta banner 2022-09-29 09:05:47 -05:00
Paul Frazee 0a37c34704 Remove top bar in the shell 2022-09-29 09:05:40 -05:00
Paul Frazee 60c2805c01 Swap new tab and share buttons in tabs modal 2022-09-29 09:05:07 -05:00
Paul Frazee debfb16520 No visual feedback on FAB to reduce jank 2022-09-29 09:04:49 -05:00
Paul Frazee 76782b6ff1 Fix feed pagination on user profiles 2022-09-28 17:02:55 -05:00
Paul Frazee 1ccb0e8123 Add reply information to feed items 2022-09-28 15:36:25 -05:00
Paul Frazee d9cf32f0ac Improve thread rendering (show reply lines) 2022-09-28 15:03:16 -05:00
Paul Frazee 521e691138 Fix to session load 2022-09-28 15:03:02 -05:00
Paul Frazee be9d89e0cc Switch to one default avi 2022-09-28 14:00:40 -05:00
Paul Frazee b93b57c83e Update api 2022-09-28 13:59:57 -05:00
Paul Frazee 6bad17e353 Add account creation 2022-09-27 14:24:47 -05:00
Paul Frazee eaabfb8250 Remove old auth code 2022-09-27 10:13:12 -05:00
Paul Frazee 1001c5b4c4 Add logout and tweak signin screen 2022-09-27 08:59:15 -05:00
Paul Frazee 2441cbfde6 Implement signin flow 2022-09-26 21:03:07 -05:00
Paul Frazee b2b6df7a7e A few client fixes 2022-09-26 13:38:37 -05:00
Paul Frazee d954f6d905 Implement unfollow, unlike, unrepost 2022-09-23 09:47:21 -05:00
Paul Frazee 3269f048b3 Replace mock-api with real api 2022-09-22 19:28:25 -05:00
Paul Frazee 5c07a74c55 Add close animation to tabs selector 2022-09-09 16:45:37 -05:00
Paul Frazee 744a21ec57 Replace tabs selector with better solution, also fix some bugs with the modal state 2022-09-09 16:20:46 -05:00
Paul Frazee c55711a1d9 Reduce the frequency of accidental visual triggers of touchable items 2022-09-09 13:24:44 -05:00
Paul Frazee ddcc804518 Fix some jank in the navigation swipes 2022-09-09 13:11:30 -05:00
Paul Frazee 56f983fd4e Disable swipe gestures in view selector for now 2022-09-09 12:10:18 -05:00
Paul Frazee d85751caf0 Make view-selector swipes easier to trigger 2022-09-09 11:58:28 -05:00
Paul Frazee 79a5064072 Make nav swipes easier to trigger 2022-09-09 11:55:53 -05:00
Paul Frazee cb083f3836 Allow nav swipes to start from anywhere on the screen 2022-09-09 11:55:31 -05:00
Paul Frazee 3677f3be4b UI sizing fixes 2022-09-09 11:29:46 -05:00
Paul Frazee fc835be1e6 Rename mobile start-point index.js to avoid build issues 2022-09-09 11:29:22 -05:00
Paul Frazee 40fdd27698 Implement autocomplete UI in composer 2022-09-08 13:39:53 -05:00
Paul Frazee d46de5b819 Add EditProfile modal 2022-09-07 16:00:25 -05:00
Paul Frazee 9627e9981d Improve navigation gesture and fix caching issue 2022-09-07 14:43:00 -05:00
Paul Frazee 5852f17bed Refactor profile to use new ViewSelector element which is reusable and now supports swipe gestures 2022-09-06 22:34:31 -05:00
Paul Frazee 80c4566baf Add 'swipe to go back' gesture 2022-09-06 17:29:26 -05:00
Paul Frazee 8b286a2179 Rework profile page to include working view selector 2022-09-06 14:26:39 -05:00
Paul Frazee 9abeb86168 Rework profile header 2022-09-05 16:57:20 -05:00
Paul Frazee 0963e67325 Rewrite the post composer as a modal 2022-09-05 14:16:48 -05:00
Paul Frazee 8dba18b67c Add post dropdown menus 2022-09-02 15:43:10 -05:00
Paul Frazee 4e56f11d06 Move SharePost modal to new system 2022-09-02 12:17:33 -05:00
Paul Frazee 39f13f01bc Implement consistent Link component 2022-09-02 11:52:33 -05:00
Paul Frazee 2ed9ea85c6 Add more robust modals controller 2022-09-02 11:51:46 -05:00
Paul Frazee 61b5a0cbe9 Rename location-menu to location-navigator and add an actual location-menu 2022-09-02 09:55:52 -05:00
Paul Frazee c3831bd799 Add accounts menu to shell 2022-09-02 09:30:21 -05:00
Paul Frazee 53deb48e2d Add location 'menu' 2022-09-01 16:06:09 -05:00
Paul Frazee 2eac309f86 Fix bug in selection of screens to cache 2022-09-01 13:30:57 -05:00
Paul Frazee 558f8010eb Implement working screen-state management and remove extraneous loads 2022-09-01 12:00:08 -05:00
Paul Frazee 36e3697fd6 Fix screen-blanking bug 2022-09-01 10:58:29 -05:00
Paul Frazee 42f1c5d45d Update post thread aesthetics 2022-08-31 21:02:12 -05:00
Paul Frazee 00c4940352 Add avi and context menu to shell topbar 2022-08-31 20:43:36 -05:00
Paul Frazee 3075ded77f Add composer FAB to home page 2022-08-31 20:09:58 -05:00
Paul Frazee 94fd697148 Aesthetic improvements 2022-08-31 20:09:47 -05:00
Paul Frazee a3df278f7d Unify the color palette 2022-08-31 17:06:44 -05:00
Paul Frazee 135a0456a2 New navigation model (#1)
* Flatten all routing into a single stack

* Replace router with custom implementation

* Add shell header and titles

* Add tab selector

* Add back/forward history menus on longpress

* Fix: don't modify state during render

* Add refresh() to navigation and reroute navigations to the current location to refresh instead of add to history

* Cache screens during navigation to maintain scroll position and improve load-time for renders
2022-08-31 14:36:50 -05:00
345 changed files with 31338 additions and 20561 deletions
-1
View File
@@ -1 +0,0 @@
REACT_APP_AUTH_LOBBY = 'http://localhost:3001'
+8 -4
View File
@@ -2,14 +2,18 @@ module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
// plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint'],
ignorePatterns: [
'**/__mocks__/*.ts',
'src/third-party',
'ios',
'android',
'coverage',
],
overrides: [
{
files: ['*.js', '*.mjs', '*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': 'off',
'no-shadow': 'off',
'no-undef': 'off',
semi: [2, 'never'],
},
},
+38
View File
@@ -0,0 +1,38 @@
name: Lint
on:
pull_request:
branches:
- main
jobs:
linting:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Yarn install
run: yarn
- name: Lint Reporter
uses: wearerequired/lint-action@v2.2.0
with:
eslint: true
prettier: true
- name: Typescript & Lint check
run: yarn lint
testing:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Install node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Check out Git repository
uses: actions/checkout@v2
- name: Yarn install
run: yarn
- name: Run tests
run: |
yarn test --forceExit
+4
View File
@@ -59,3 +59,7 @@ buck-out/
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
# Testing
coverage/
junit.xml
+5
View File
@@ -0,0 +1,5 @@
ios
android
src/third-party
src/app.json
public
+1 -1
View File
@@ -1 +1 @@
2.7.4
2.7.6
+2 -2
View File
@@ -1,6 +1,6 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'
ruby File.read(File.join(__dir__, '.ruby-version')).strip
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
+4 -33
View File
@@ -10,19 +10,16 @@ Uses:
- [MobX](https://mobx.js.org/README.html)
- [Async Storage](https://github.com/react-native-async-storage/async-storage)
## TODOs
- Handle the "unauthed" state better than changing route definitions
- Currently it's possible to get a 404 if the auth state changes
## Build instructions
- Setup your environment [using the react native instructions](https://reactnative.dev/docs/environment-setup).
- After initial setup:
- `cd ios ; pod install`
- Start the dev servers
- `yarn dev-pds`
- `yarn dev-wallet`
- `git clone git@github.com:bluesky-social/atproto.git`
- `cd atproto`
- `yarn`
- `cd packages/dev-env && yarn start`
- Run the dev app
- iOS: `yarn ios`
- Android: `yarn android`
@@ -37,34 +34,8 @@ Uses:
## Various notes
### Env vars
Set using the `.env` file or using bash.
```
REACT_APP_AUTH_LOBBY = 'http://localhost:3001'
```
### Build behaviors
The `metro.config.js` file rewrites a couple of imports. This is partly to work around missing features in Metro, and partly to patch the bundle. Affected imports include:
- ucans
- one-webcrypto
### Cryptography
For native builds, we must provide a polyfill of `webcrypto`. We use a custom native module AppSecureRandom (based on [react-native-securerandom](https://github.com/robhogan/react-native-securerandom)) for the CRNG and [msrcrypto](https://github.com/microsoft/MSR-JavaScript-Crypto) for the cryptography.
**NOTE** Keys are not currently stored securely.
### Polyfills
`./platform/polyfills.*.ts` adds polyfills to the environment. Currently this includes:
- webcrypto
- TextEncoder / TextDecoder
### Auth flow
The auth flow is based on a browser app which is specified by the `REACT_APP_AUTH_LOBBY` env var. The app redirects to that location with the UCAN request, and then waits for a redirect back. In the native platforms with proper support, it will do this using an in-app browser. In native without in-app browser, or in the Web platform, it will handle this with redirects. The ucan is extracted from the hash fragment of the "return url" which is provided either by the in-app browser in response or detected during initial setup in the case of redirects.
+57
View File
@@ -0,0 +1,57 @@
import React from 'react'
import {View, ScrollView, Modal, FlatList, TextInput} from 'react-native'
const BottomSheetModalContext = React.createContext(null)
const BottomSheetModalProvider = (props: any) => {
return <BottomSheetModalContext.Provider {...props} value={{}} />
}
class BottomSheet extends React.Component {
snapToIndex() {}
snapToPosition() {}
expand() {}
collapse() {}
close() {
this.props.onClose?.()
}
forceClose() {}
render() {
return <View>{this.props.children}</View>
}
}
const BottomSheetModal = (props: any) => <Modal {...props} />
const BottomSheetBackdrop = (props: any) => <View {...props} />
const BottomSheetHandle = (props: any) => <View {...props} />
const BottomSheetFooter = (props: any) => <View {...props} />
const BottomSheetScrollView = (props: any) => <ScrollView {...props} />
const BottomSheetFlatList = (props: any) => <FlatList {...props} />
const BottomSheetTextInput = (props: any) => <TextInput {...props} />
const useBottomSheet = jest.fn()
const useBottomSheetModal = jest.fn()
const useBottomSheetSpringConfigs = jest.fn()
const useBottomSheetTimingConfigs = jest.fn()
const useBottomSheetInternal = jest.fn()
const useBottomSheetDynamicSnapPoints = jest.fn()
export {useBottomSheet}
export {useBottomSheetModal}
export {useBottomSheetSpringConfigs}
export {useBottomSheetTimingConfigs}
export {useBottomSheetInternal}
export {useBottomSheetDynamicSnapPoints}
export {
BottomSheetModalProvider,
BottomSheetBackdrop,
BottomSheetHandle,
BottomSheetModal,
BottomSheetFooter,
BottomSheetScrollView,
BottomSheetFlatList,
BottomSheetTextInput,
}
export default BottomSheet
+6
View File
@@ -0,0 +1,6 @@
export default {
requestPermission: jest.fn(),
onForegroundEvent: jest.fn(),
setBadgeCount: jest.fn(),
displayNotification: jest.fn(),
}
@@ -0,0 +1,9 @@
export const CameraRoll = {
getPhotos: jest.fn().mockResolvedValue({
edges: [
{node: {image: {uri: 'path/to/image1.jpg'}}},
{node: {image: {uri: 'path/to/image2.jpg'}}},
{node: {image: {uri: 'path/to/image3.jpg'}}},
],
}),
}
@@ -0,0 +1,4 @@
export default {
configure: jest.fn().mockResolvedValue(0),
finish: jest.fn(),
}
+1
View File
@@ -0,0 +1 @@
export default {}
+9
View File
@@ -0,0 +1,9 @@
export const openPicker = jest
.fn()
.mockImplementation(() => Promise.resolve({uri: ''}))
export const openCamera = jest
.fn()
.mockImplementation(() => Promise.resolve({uri: ''}))
export const openCropper = jest
.fn()
.mockImplementation(() => Promise.resolve({uri: ''}))
+10
View File
@@ -0,0 +1,10 @@
jest.mock('rn-fetch-blob', () => {
return {
__esModule: true,
default: {
fs: {
unlink: jest.fn(),
},
},
}
})
+937
View File
@@ -0,0 +1,937 @@
import {LogModel} from './../src/state/models/log'
import {LRUMap} from 'lru_map'
import {RootStoreModel} from './../src/state/models/root-store'
import {NavigationTabModel} from './../src/state/models/navigation'
import {SessionModel} from '../src/state/models/session'
import {NavigationModel} from '../src/state/models/navigation'
import {ShellUiModel} from '../src/state/models/shell-ui'
import {MeModel} from '../src/state/models/me'
import {OnboardModel} from '../src/state/models/onboard'
import {ProfilesViewModel} from '../src/state/models/profiles-view'
import {LinkMetasViewModel} from '../src/state/models/link-metas-view'
import {MembershipsViewModel} from '../src/state/models/memberships-view'
import {FeedModel} from '../src/state/models/feed-view'
import {NotificationsViewModel} from '../src/state/models/notifications-view'
import {ProfileViewModel} from '../src/state/models/profile-view'
import {MembersViewModel} from '../src/state/models/members-view'
import {ProfileUiModel, Sections} from '../src/state/models/profile-ui'
import {SessionServiceClient} from '@atproto/api'
import {UserAutocompleteViewModel} from '../src/state/models/user-autocomplete-view'
import {UserLocalPhotosModel} from '../src/state/models/user-local-photos'
import {SuggestedActorsViewModel} from '../src/state/models/suggested-actors-view'
import {UserFollowersViewModel} from '../src/state/models/user-followers-view'
import {UserFollowsViewModel} from '../src/state/models/user-follows-view'
import {NotificationsViewItemModel} from './../src/state/models/notifications-view'
import {
PostThreadViewModel,
PostThreadViewPostModel,
} from '../src/state/models/post-thread-view'
import {FeedItemModel} from '../src/state/models/feed-view'
import {RepostedByViewModel} from '../src/state/models/reposted-by-view'
import {VotesViewModel} from '../src/state/models/votes-view'
export const mockedProfileStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: true,
error: '',
params: {
actor: '',
},
did: 'test did',
handle: 'testhandle',
declaration: {
cid: '',
actorType: '',
},
creator: 'test did',
displayName: '',
description: '',
avatar: '',
banner: '',
followersCount: 0,
followsCount: 0,
membersCount: 0,
postsCount: 0,
myState: {
follow: '',
member: '',
},
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
isUser: true,
isScene: false,
setup: jest.fn().mockResolvedValue({aborted: false}),
refresh: jest.fn().mockResolvedValue({}),
toggleFollowing: jest.fn().mockResolvedValue({}),
updateProfile: jest.fn(),
// unknown required because of the missing private methods: _xLoading, _xIdle, _load, _replaceAll
} as unknown as ProfileViewModel
export const mockedMembersStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: true,
error: '',
params: {
actor: 'test actor',
},
subject: {
did: 'test did',
handle: '',
displayName: '',
declaration: {
cid: '',
actorType: '',
},
avatar: undefined,
},
members: [
{
did: 'test did2',
declaration: {
cid: '',
actorType: '',
},
handle: 'testhandle',
displayName: 'test name',
indexedAt: '',
},
],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
isMember: jest.fn(),
setup: jest.fn().mockResolvedValue({aborted: false}),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn(),
removeMember: jest.fn(),
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
} as unknown as MembersViewModel
export const mockedMembershipsStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: true,
error: '',
params: {
actor: '',
limit: 1,
before: '',
},
subject: {
did: 'test did',
handle: '',
displayName: '',
declaration: {cid: '', actorType: ''},
avatar: undefined,
},
memberships: [
{
did: 'test did',
declaration: {
cid: '',
actorType: 'app.bsky.system.actorUser',
},
handle: ',',
displayName: '',
createdAt: '',
indexedAt: '',
_reactKey: 'item-1',
},
],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
isMemberOf: jest.fn(),
setup: jest.fn().mockResolvedValue({aborted: false}),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn(),
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _replaceAll, _append
} as unknown as MembershipsViewModel
export const mockedFeedItemStore = {
_reactKey: 'item-1',
_isThreadParent: false,
_isThreadChildElided: false,
_isThreadChild: false,
post: {
uri: 'testuri',
cid: 'test cid',
author: {
did: 'test did',
handle: 'test.handle',
displayName: 'test name',
declaration: {cid: '', actorType: ''},
},
record: {
$type: 'app.bsky.feed.post',
createdAt: '2022-12-29T16:39:57.919Z',
text: 'Sup',
},
replyCount: 0,
repostCount: 0,
upvoteCount: 0,
downvoteCount: 0,
indexedAt: '2022-12-29T16:39:57.919Z',
viewer: {},
},
postRecord: {
$type: 'app.bsky.feed.post',
text: 'test text',
createdAt: '1',
reply: {
root: {
uri: 'testuri',
cid: 'tes cid',
},
parent: {
uri: 'testuri',
cid: 'tes cid',
},
},
},
rootStore: {} as RootStoreModel,
copy: jest.fn(),
toggleUpvote: jest.fn().mockResolvedValue({}),
toggleDownvote: jest.fn(),
toggleRepost: jest.fn().mockResolvedValue({}),
delete: jest.fn().mockResolvedValue({}),
reasonRepost: {
by: {
did: 'test did',
handle: 'test.handle',
declaration: {cid: '', actorType: ''},
},
indexedAt: '',
},
reasonTrend: {
by: {
did: 'test did',
handle: 'test.handle',
declaration: {cid: '', actorType: ''},
},
indexedAt: '',
},
reply: {
parent: {
author: {
did: 'test did',
handle: 'test.handle',
displayName: 'test name',
declaration: {cid: '', actorType: ''},
},
cid: '',
downvoteCount: 0,
indexedAt: '2023-01-10T11:17:46.945Z',
record: {},
replyCount: 1,
repostCount: 0,
upvoteCount: 0,
uri: 'testuri',
viewer: {},
},
root: {
author: {
did: 'test did',
handle: 'test.handle',
displayName: 'test name',
declaration: {cid: '', actorType: ''},
},
cid: '',
downvoteCount: 0,
indexedAt: '2023-01-10T11:17:46.739Z',
record: {},
replyCount: 1,
repostCount: 0,
upvoteCount: 1,
uri: 'testuri',
viewer: {},
},
},
} as FeedItemModel
export const mockedFeedStore = {
isLoading: false,
isRefreshing: false,
hasNewLatest: false,
hasLoaded: true,
error: '',
hasMore: true,
params: {
actor: '',
limit: 1,
before: '',
},
feed: [],
rootStore: {} as RootStoreModel,
feedType: 'home',
hasContent: true,
hasError: false,
isEmpty: false,
nonReplyFeed: [
{
_reactKey: 'item-1',
post: {
author: {
handle: 'handle.test',
displayName: 'test name',
avatar: '',
},
cid: 'bafyreihkwjoy2vbfqld2lp3tv4ce6yfr354sqgp32qoplrudso4gyyjiwe',
downvoteCount: 0,
indexedAt: '2022-12-29T16:35:55.270Z',
record: {
$type: 'app.bsky.feed.post',
createdAt: '2022-12-29T16:39:57.919Z',
text: 'Sup',
},
replyCount: 0,
repostCount: 0,
upvoteCount: 0,
uri: 'at://did:plc:wcizmlgv3rdslk64t6q4silu/app.bsky.feed.post/3jkzce5kfvn2h',
viewer: {
handle: 'handle.test',
displayName: 'test name',
avatar: '',
},
},
reason: undefined,
reply: undefined,
},
],
setHasNewLatest: jest.fn(),
setup: jest.fn().mockResolvedValue({}),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn().mockResolvedValue({}),
loadLatest: jest.fn(),
update: jest.fn(),
checkForLatest: jest.fn().mockRejectedValue('Error checking for latest'),
registerListeners: jest.fn().mockReturnValue(jest.fn()),
// unknown required because of the missing private methods: _xLoading, _xIdle, _pendingWork, _initialLoad, _loadLatest, _loadMore, _update, _replaceAll, _appendAll, _prependAll, _updateAll, _getFeed, loadMoreCursor, pollCursor, _loadPromise, _updatePromise, _loadLatestPromise, _loadMorePromise
} as unknown as FeedModel
export const mockedPostThreadViewPostStore = {
_reactKey: 'item-1',
_depth: 0,
_isHighlightedPost: false,
_hasMore: false,
postRecord: {
text: 'test text',
createdAt: '',
reply: {
root: {
uri: 'testuri',
cid: 'tes cid',
},
parent: {
uri: 'testuri',
cid: 'tes cid',
},
},
},
post: {
uri: 'testuri',
cid: 'testcid',
record: {},
author: {
did: 'test did',
handle: 'test.handle',
declaration: {cid: '', actorType: ''},
viewer: {
muted: true,
},
},
replyCount: 0,
repostCount: 0,
upvoteCount: 0,
downvoteCount: 0,
indexedAt: '',
viewer: {
repost: '',
upvote: '',
downvote: '',
},
},
rootStore: {} as RootStoreModel,
assignTreeModels: jest.fn(),
toggleRepost: jest.fn().mockRejectedValue({}),
toggleUpvote: jest.fn().mockRejectedValue({}),
toggleDownvote: jest.fn(),
delete: jest.fn(),
} as PostThreadViewPostModel
export const mockedPostThreadViewStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
notFound: false,
resolvedUri: 'testuri',
params: {
uri: 'testuri',
},
thread: mockedPostThreadViewPostStore,
hasContent: true,
hasError: false,
setup: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
update: jest.fn(),
// unknown required because of the missing private methods: _xLoading, _xIdle, _resolveUri, _load, _replaceAll
} as unknown as PostThreadViewModel
export const mockedNotificationsViewItemStore = {
_reactKey: 'item-1',
uri: 'testuri',
cid: '',
author: {
did: 'test did',
handle: 'test.handle',
declaration: {cid: '', actorType: ''},
},
rootStore: {} as RootStoreModel,
copy: jest.fn(),
reason: 'test reason',
isRead: true,
indexedAt: '',
isUpvote: true,
isRepost: false,
isTrend: false,
isMention: false,
isReply: false,
isFollow: false,
isAssertion: false,
needsAdditionalData: false,
isInvite: false,
subjectUri: 'testuri',
toSupportedRecord: jest.fn().mockReturnValue({
text: 'test text',
createdAt: '',
}),
fetchAdditionalData: jest.fn(),
toNotifeeOpts: jest.fn(),
} as NotificationsViewItemModel
export const mockedNotificationsStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: true,
error: '',
params: {
limit: 1,
before: '',
},
hasMore: true,
notifications: [mockedNotificationsViewItemStore],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
setup: jest.fn().mockResolvedValue({aborted: false}),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn().mockResolvedValue({}),
update: jest.fn().mockResolvedValue(null),
updateReadState: jest.fn(),
// unknown required because of the missing private methods: _xLoading, _xIdle, _pendingWork, _initialLoad, _loadMore, _update, _replaceAll, _appendAll, _updateAll, loadMoreCursor, _loadPromise, _updatePromise, _loadLatestPromise, _loadMorePromise
} as unknown as NotificationsViewModel
export const mockedSessionStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
data: {
service: '',
refreshJwt: '',
accessJwt: '',
handle: '',
did: 'test did',
},
online: false,
attemptingConnect: false,
rootStore: {} as RootStoreModel,
hasSession: true,
clear: jest.fn(),
setState: jest.fn(),
setOnline: jest.fn(),
updateAuthTokens: jest.fn(),
connect: jest.fn(),
describeService: jest.fn().mockResolvedValue({
availableUserDomains: ['test'],
links: {
termsOfService: 'https://testTermsOfService',
privacyPolicy: 'https://testPrivacyPolicy',
},
}),
login: jest.fn(),
createAccount: jest.fn(),
logout: jest.fn(),
// unknown required because of the missing private methods: _connectPromise, configureApi & _connect
} as unknown as SessionModel
export const mockedNavigationTabStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
id: 0,
history: [
{
url: '',
ts: 0,
title: '',
id: 0,
},
],
index: 0,
isNewTab: false,
current: {
url: '',
ts: 0,
title: '',
id: 0,
},
canGoBack: false,
canGoForward: false,
backTen: [
{
url: '',
title: '',
index: 0,
id: 0,
},
],
forwardTen: [
{
url: '',
title: '',
index: 0,
id: 0,
},
],
navigate: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
goBack: jest.fn(),
fixedTabReset: jest.fn(),
goForward: jest.fn(),
goToIndex: jest.fn(),
setTitle: jest.fn(),
setIsNewTab: jest.fn(),
fixedTabPurpose: 0,
getBackList: () => [
{
url: '/',
title: '',
index: 1,
id: 1,
},
],
getForwardList: jest.fn(),
} as NavigationTabModel
export const mockedNavigationStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
tabs: [mockedNavigationTabStore],
tabIndex: 0,
clear: jest.fn(),
tab: mockedNavigationTabStore,
tabCount: 1,
isCurrentScreen: jest.fn(),
navigate: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
setTitle: jest.fn(),
handleLink: jest.fn(),
switchTo: jest.fn(),
setActiveTab: jest.fn(),
closeTab: jest.fn(),
newTab: jest.fn(),
} as NavigationModel
export const mockedShellStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
minimalShellMode: false,
isMainMenuOpen: false,
isModalActive: false,
activeModal: undefined,
isLightboxActive: false,
activeLightbox: undefined,
isComposerActive: false,
composerOpts: undefined,
darkMode: false,
setDarkMode: jest.fn(),
setMainMenuOpen: jest.fn(),
setMinimalShellMode: jest.fn(),
openModal: jest.fn(),
closeModal: jest.fn(),
closeComposer: jest.fn(),
closeLightbox: jest.fn(),
openComposer: jest.fn(),
openLightbox: jest.fn(),
} as ShellUiModel
export const mockedMeStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
did: 'test did',
handle: 'test',
displayName: 'test',
description: 'test',
avatar: '',
notificationCount: 0,
rootStore: {} as RootStoreModel,
memberships: mockedMembershipsStore,
mainFeed: mockedFeedStore,
notifications: mockedNotificationsStore,
clear: jest.fn(),
load: jest.fn(),
clearNotificationCount: jest.fn(),
fetchNotifications: jest.fn(),
refreshMemberships: jest.fn(),
} as MeModel
export const mockedOnboardStore = {
serialize: jest.fn(),
hydrate: jest.fn(),
isOnboarding: false,
stage: '',
start: jest.fn(),
stop: jest.fn(),
next: jest.fn(),
} as OnboardModel
export const mockedProfilesStore = {
hydrate: jest.fn(),
serialize: jest.fn(),
cache: new LRUMap(100),
rootStore: {} as RootStoreModel,
getProfile: jest.fn().mockResolvedValue({data: {}}),
overwrite: jest.fn(),
} as ProfilesViewModel
export const mockedLinkMetasStore = {
hydrate: jest.fn(),
serialize: jest.fn(),
cache: new LRUMap(100),
rootStore: {} as RootStoreModel,
getLinkMeta: jest.fn(),
} as LinkMetasViewModel
export const mockedLogStore = {
entries: [],
serialize: jest.fn(),
hydrate: jest.fn(),
debug: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
// unknown required because of the missing private methods: add
} as unknown as LogModel
export const mockedRootStore = {
api: {
com: {},
app: {
bsky: {
actor: {
searchTypeahead: jest.fn().mockResolvedValue({data: {users: []}}),
},
graph: {
getFollows: jest.fn().mockResolvedValue({data: {follows: []}}),
getFollowers: jest.fn().mockResolvedValue({}),
getMembers: jest.fn().mockResolvedValue({}),
},
},
},
} as unknown as SessionServiceClient,
resolveName: jest.fn(),
serialize: jest.fn(),
hydrate: jest.fn(),
fetchStateUpdate: jest.fn(),
clearAll: jest.fn(),
session: mockedSessionStore,
nav: mockedNavigationStore,
shell: mockedShellStore,
me: mockedMeStore,
onboard: mockedOnboardStore,
profiles: mockedProfilesStore,
linkMetas: mockedLinkMetasStore,
log: mockedLogStore,
} as RootStoreModel
export const mockedProfileUiStore = {
profile: mockedProfileStore,
feed: mockedFeedStore,
memberships: mockedMembershipsStore,
members: mockedMembersStore,
selectedViewIndex: 0,
rootStore: mockedRootStore,
params: {
user: 'test user',
},
currentView: mockedFeedStore,
isInitialLoading: false,
isRefreshing: false,
isUser: true,
isScene: false,
selectorItems: [Sections.Posts, Sections.PostsWithReplies, Sections.Scenes],
selectedView: Sections.Posts,
setSelectedViewIndex: jest.fn(),
setup: jest.fn().mockResolvedValue({aborted: false}),
update: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn(),
} as ProfileUiModel
export const mockedAutocompleteViewStore = {
isLoading: false,
isActive: true,
prefix: '',
follows: [
{
did: 'test did',
declaration: {
cid: '',
actorType: 'app.bsky.system.actorUser',
},
handle: '',
displayName: '',
createdAt: '',
indexedAt: '',
},
],
searchRes: [
{
did: 'test did',
declaration: {
cid: '',
actorType: 'app.bsky.system.actorUser',
},
handle: '',
displayName: '',
},
],
knownHandles: new Set<string>(),
suggestions: [
{
handle: 'handle.test',
displayName: 'Test Display',
},
{
handle: 'handle2.test',
displayName: 'Test Display 2',
},
],
rootStore: {} as RootStoreModel,
setup: jest.fn(),
setActive: jest.fn(),
setPrefix: jest.fn(),
// unknown required because of the missing private methods: _searchPromise, _getFollows , _search
} as unknown as UserAutocompleteViewModel
export const mockedLocalPhotosStore = {
photos: {
node: {
type: '',
group_name: '',
image: {
filename: '',
extension: '',
uri: '',
height: 1000,
width: 1000,
fileSize: null,
playableDuration: 0,
},
timestamp: 1672847197,
location: null,
},
},
rootStore: {} as RootStoreModel,
setup: jest.fn(),
// unknown required because of the missing private methods: _getPhotos
} as unknown as UserLocalPhotosModel
export const mockedSuggestedActorsStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
suggestions: [
{
did: '1',
declaration: {
cid: '',
actorType: 'app.bsky.system.actorUser',
},
handle: 'handle1.test',
displayName: 'test name 1',
description: 'desc',
indexedAt: '',
_reactKey: '1',
},
{
did: '2',
declaration: {
cid: '',
actorType: 'app.bsky.system.actorUser',
},
handle: '',
displayName: 'handle2.test',
description: 'desc',
indexedAt: '',
_reactKey: '2',
},
],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
setup: jest.fn().mockResolvedValue(null),
refresh: jest.fn().mockResolvedValue({}),
// unknown required because of the missing private methods: _xLoading, _xIdle, _fetch, _appendAll, _append
} as unknown as SuggestedActorsViewModel
export const mockedUserFollowersStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
params: {
user: 'test user',
},
subject: {
did: 'test did',
handle: '',
declaration: {cid: '', actorType: ''},
},
followers: [
{
did: 'test did',
declaration: {cid: '', actorType: ''},
handle: 'testhandle',
displayName: 'test name',
indexedAt: '',
_reactKey: '1',
},
{
did: 'test did2',
declaration: {cid: '', actorType: ''},
handle: 'testhandle2',
displayName: 'test name 2',
indexedAt: '',
_reactKey: '2',
},
],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
setup: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn(),
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
} as unknown as UserFollowersViewModel
export const mockedUserFollowsStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
params: {
user: 'test user',
},
subject: {
did: 'test did',
handle: '',
declaration: {cid: '', actorType: ''},
},
follows: [
{
did: 'test did',
declaration: {cid: '', actorType: ''},
handle: 'testhandle',
displayName: 'test name',
indexedAt: '',
_reactKey: '1',
},
{
did: 'test did2',
declaration: {cid: '', actorType: ''},
handle: 'testhandle2',
displayName: 'test name 2',
indexedAt: '',
_reactKey: '2',
},
],
rootStore: {} as RootStoreModel,
hasContent: true,
hasError: false,
isEmpty: false,
setup: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn(),
// unknown required because of the missing private methods: _xIdle, _xLoading, _fetch, _replaceAll, _append
} as unknown as UserFollowsViewModel
export const mockedRepostedByViewStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
resolvedUri: '',
params: {
uri: 'testuri',
},
uri: '',
repostedBy: [
{
_reactKey: '',
did: '',
handle: '',
displayName: '',
declaration: {cid: '', actorType: ''},
indexedAt: '',
},
],
hasContent: false,
hasError: false,
isEmpty: false,
setup: jest.fn().mockResolvedValue({}),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn().mockResolvedValue({}),
// unknown required because of the missing private methods: _xIdle, _xLoading, _resolveUri, _fetch, _refresh, _replaceAll, _append
} as unknown as RepostedByViewModel
export const mockedVotesViewStore = {
isLoading: false,
isRefreshing: false,
hasLoaded: false,
error: '',
resolvedUri: '',
params: {
uri: 'testuri',
},
uri: '',
votes: [
{
_reactKey: '',
direction: 'up',
indexedAt: '',
createdAt: '',
actor: {
did: '',
handle: '',
declaration: {cid: '', actorType: ''},
},
},
],
hasContent: false,
hasError: false,
isEmpty: false,
setup: jest.fn(),
refresh: jest.fn().mockResolvedValue({}),
loadMore: jest.fn().mockResolvedValue({}),
// unknown required because of the missing private methods: _xIdle, _xLoading, _resolveUri, _fetch, _replaceAll, _append
} as unknown as VotesViewModel
-16
View File
@@ -1,16 +0,0 @@
/**
* @format
*/
import 'react-native'
import React from 'react'
import App from '../src/App'
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer'
it('renders correctly', () => {
renderer.act(() => {
renderer.create(<App />)
})
})
+241
View File
@@ -0,0 +1,241 @@
import React from 'react'
import {MobileShell} from '../src/view/shell/mobile'
import {cleanup, fireEvent, render, waitFor} from '../jest/test-utils'
import {createServer, TestPDS} from '../jest/test-pds'
import {RootStoreModel, setupState} from '../src/state'
const WAIT_OPTS = {timeout: 5e3}
describe('Account flows', () => {
let pds: TestPDS | undefined
let rootStore: RootStoreModel | undefined
beforeAll(async () => {
jest.useFakeTimers()
pds = await createServer()
rootStore = await setupState(pds.pdsUrl)
})
afterAll(async () => {
jest.clearAllMocks()
cleanup()
await pds?.close()
})
it('renders initial screen', () => {
const {getByTestId} = render(<MobileShell />, rootStore)
const signUpScreen = getByTestId('signinOrCreateAccount')
expect(signUpScreen).toBeTruthy()
})
it('completes signin to the server', async () => {
const {getByTestId} = render(<MobileShell />, rootStore)
// move to signin view
fireEvent.press(getByTestId('signInButton'))
expect(getByTestId('signIn')).toBeTruthy()
expect(getByTestId('loginForm')).toBeTruthy()
// input the target server
expect(getByTestId('loginSelectServiceButton')).toBeTruthy()
fireEvent.press(getByTestId('loginSelectServiceButton'))
expect(getByTestId('serverInputModal')).toBeTruthy()
fireEvent.changeText(
getByTestId('customServerTextInput'),
pds?.pdsUrl || '',
)
fireEvent.press(getByTestId('customServerSelectBtn'))
await waitFor(() => {
expect(getByTestId('loginUsernameInput')).toBeTruthy()
}, WAIT_OPTS)
// enter username & pass
fireEvent.changeText(getByTestId('loginUsernameInput'), 'alice')
fireEvent.changeText(getByTestId('loginPasswordInput'), 'hunter2')
await waitFor(() => {
expect(getByTestId('loginNextButton')).toBeTruthy()
}, WAIT_OPTS)
fireEvent.press(getByTestId('loginNextButton'))
// signed in
await waitFor(() => {
expect(getByTestId('homeFeed')).toBeTruthy()
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(1)
}, WAIT_OPTS)
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(1)
})
it('opens the login screen when "add account" is pressed', async () => {
const {getByTestId, getAllByTestId} = render(<MobileShell />, rootStore)
await waitFor(() => expect(getByTestId('homeFeed')).toBeTruthy(), WAIT_OPTS)
// open side menu
fireEvent.press(getAllByTestId('viewHeaderBackOrMenuBtn')[0])
await waitFor(() => expect(getByTestId('menuView')).toBeTruthy(), WAIT_OPTS)
// nav to settings
fireEvent.press(getByTestId('menuItemButton-Settings'))
await waitFor(
() => expect(getByTestId('settingsScreen')).toBeTruthy(),
WAIT_OPTS,
)
// press '+ new account' in switcher
fireEvent.press(getByTestId('switchToNewAccountBtn'))
await waitFor(
() => expect(getByTestId('signinOrCreateAccount')).toBeTruthy(),
WAIT_OPTS,
)
})
it('shows the "choose account" form when a previous session has been created', async () => {
const {getByTestId} = render(<MobileShell />, rootStore)
// move to signin view
fireEvent.press(getByTestId('signInButton'))
expect(getByTestId('signIn')).toBeTruthy()
expect(getByTestId('chooseAccountForm')).toBeTruthy()
})
it('logs directly into the account due to still possessing session tokens', async () => {
const {getByTestId} = render(<MobileShell />, rootStore)
// move to signin view
fireEvent.press(getByTestId('signInButton'))
expect(getByTestId('signIn')).toBeTruthy()
expect(getByTestId('chooseAccountForm')).toBeTruthy()
// select the previous account
fireEvent.press(getByTestId('chooseAccountBtn-alice.test'))
// signs in immediately
await waitFor(() => {
expect(getByTestId('homeFeed')).toBeTruthy()
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(1)
}, WAIT_OPTS)
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(1)
})
it('logs into a second account via the switcher', async () => {
const {getByTestId, getAllByTestId} = render(<MobileShell />, rootStore)
await waitFor(() => expect(getByTestId('homeFeed')).toBeTruthy(), WAIT_OPTS)
// open side menu
fireEvent.press(getAllByTestId('viewHeaderBackOrMenuBtn')[0])
await waitFor(() => expect(getByTestId('menuView')).toBeTruthy(), WAIT_OPTS)
// nav to settings
fireEvent.press(getByTestId('menuItemButton-Settings'))
await waitFor(
() => expect(getByTestId('settingsScreen')).toBeTruthy(),
WAIT_OPTS,
)
// press '+ new account' in switcher
fireEvent.press(getByTestId('switchToNewAccountBtn'))
await waitFor(
() => expect(getByTestId('signinOrCreateAccount')).toBeTruthy(),
WAIT_OPTS,
)
// move to signin view
fireEvent.press(getByTestId('signInButton'))
expect(getByTestId('signIn')).toBeTruthy()
expect(getByTestId('chooseAccountForm')).toBeTruthy()
// select a new account
fireEvent.press(getByTestId('chooseNewAccountBtn'))
expect(getByTestId('loginForm')).toBeTruthy()
// input the target server
expect(getByTestId('loginSelectServiceButton')).toBeTruthy()
fireEvent.press(getByTestId('loginSelectServiceButton'))
expect(getByTestId('serverInputModal')).toBeTruthy()
fireEvent.changeText(
getByTestId('customServerTextInput'),
pds?.pdsUrl || '',
)
fireEvent.press(getByTestId('customServerSelectBtn'))
await waitFor(
() => expect(getByTestId('loginUsernameInput')).toBeTruthy(),
WAIT_OPTS,
)
// enter username & pass
fireEvent.changeText(getByTestId('loginUsernameInput'), 'bob')
fireEvent.changeText(getByTestId('loginPasswordInput'), 'hunter2')
await waitFor(
() => expect(getByTestId('loginNextButton')).toBeTruthy(),
WAIT_OPTS,
)
fireEvent.press(getByTestId('loginNextButton'))
// signed in
await waitFor(() => {
expect(getByTestId('settingsScreen')).toBeTruthy() // we go back to settings in this situation
expect(rootStore?.me?.displayName).toBe('Bob')
expect(rootStore?.me?.handle).toBe('bob.test')
expect(rootStore?.session.accounts.length).toBe(2)
}, WAIT_OPTS)
expect(rootStore?.me?.displayName).toBe('Bob')
expect(rootStore?.me?.handle).toBe('bob.test')
expect(rootStore?.session.accounts.length).toBe(2)
})
it('can instantly switch between accounts', async () => {
const {getByTestId} = render(<MobileShell />, rootStore)
await waitFor(
() => expect(getByTestId('settingsScreen')).toBeTruthy(),
WAIT_OPTS,
)
// select the alice account
fireEvent.press(getByTestId('switchToAccountBtn-alice.test'))
// swapped account
await waitFor(() => {
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(2)
}, WAIT_OPTS)
expect(rootStore?.me?.displayName).toBe('Alice')
expect(rootStore?.me?.handle).toBe('alice.test')
expect(rootStore?.session.accounts.length).toBe(2)
})
it('will prompt for a password if you sign out', async () => {
const {getByTestId} = render(<MobileShell />, rootStore)
await waitFor(
() => expect(getByTestId('settingsScreen')).toBeTruthy(),
WAIT_OPTS,
)
// press the sign out button
fireEvent.press(getByTestId('signOutBtn'))
// in the logged out state
await waitFor(
() => expect(getByTestId('signinOrCreateAccount')).toBeTruthy(),
WAIT_OPTS,
)
// move to signin view
fireEvent.press(getByTestId('signInButton'))
expect(getByTestId('signIn')).toBeTruthy()
expect(getByTestId('chooseAccountForm')).toBeTruthy()
// select an existing account
fireEvent.press(getByTestId('chooseAccountBtn-alice.test'))
// goes to login screen instead of straight back to settings
expect(getByTestId('loginForm')).toBeTruthy()
})
})
+47
View File
@@ -0,0 +1,47 @@
export const exampleComHtml = `<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta name="description" content="An example website">
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>`
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+19
View File
@@ -0,0 +1,19 @@
import {isNetworkError} from '../../src/lib/errors'
describe('isNetworkError', () => {
const inputs = [
'TypeError: Network request failed',
'Uncaught TypeError: Cannot read property x of undefined',
'Uncaught RangeError',
'Error: Aborted',
]
const outputs = [true, false, false, true]
it('correctly distinguishes network errors', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = isNetworkError(input)
expect(result).toEqual(outputs[i])
}
})
})
+116
View File
@@ -0,0 +1,116 @@
import {extractHtmlMeta} from '../../src/lib/extractHtmlMeta'
import {exampleComHtml} from './__mocks__/exampleComHtml'
import {youtubeHTML} from './__mocks__/youtubeHtml'
import {tiktokHtml} from './__mocks__/tiktokHtml'
describe('extractHtmlMeta', () => {
const cases = [
['', {}],
['nothing', {}],
['<title>title</title>', {title: 'title'}],
['<title> aSd!@#AC </title>', {title: 'aSd!@#AC'}],
['<title>\n title\n </title>', {title: 'title'}],
['<meta name="title" content="meta title">', {title: 'meta title'}],
[
'<meta name="description" content="meta description">',
{description: 'meta description'},
],
['<meta property="og:title" content="og title">', {title: 'og title'}],
[
'<meta property="og:description" content="og description">',
{description: 'og description'},
],
[
'<meta property="og:image" content="https://ogimage.com/foo.png">',
{image: 'https://ogimage.com/foo.png'},
],
[
'<meta property="twitter:title" content="twitter title">',
{title: 'twitter title'},
],
[
'<meta property="twitter:description" content="twitter description">',
{description: 'twitter description'},
],
[
'<meta property="twitter:image" content="https://twitterimage.com/foo.png">',
{image: 'https://twitterimage.com/foo.png'},
],
['<meta\n name="title"\n content="meta title"\n>', {title: 'meta title'}],
]
it.each(cases)(
'given the html tag %p, returns %p',
(input, expectedResult) => {
const output = extractHtmlMeta({html: input as string, hostname: ''})
expect(output).toEqual(expectedResult)
},
)
it('extracts title and description from a generic HTML page', () => {
const input = exampleComHtml
const expectedOutput = {
title: 'Example Domain',
description: 'An example website',
}
const output = extractHtmlMeta({html: input, hostname: 'example.com'})
expect(output).toEqual(expectedOutput)
})
it('extracts title and description from a Tiktok HTML page', () => {
const input = tiktokHtml
const expectedOutput = {
title:
'Coca-Cola and Mentos! Super Reaction! #cocacola #mentos #reaction #bal... | TikTok',
description:
'5.5M Likes, 20.8K Comments. TikTok video from Power Vision Tests (@_powervision_): &quot;Coca-Cola and Mentos! Super Reaction! #cocacola #mentos #reaction #balloon #sciencemoment #scienceexperiment #experiment #test #amazing #pvexp&quot;. оригинальный звук - Power Vision Tests.',
}
const output = extractHtmlMeta({html: input, hostname: 'tiktok.com'})
expect(output).toEqual(expectedOutput)
})
it('extracts title and description from a generic youtube page', () => {
const input = youtubeHTML
const expectedOutput = {
title: 'HD Video (1080p) with Relaxing Music of Native American Shamans',
description:
'Stunning HD Video ( 1080p ) of Patagonian Nature with Relaxing Native American Shamanic Music. HD footage used from ',
image: 'https://i.ytimg.com/vi/x6UITRjhijI/sddefault.jpg',
}
const output = extractHtmlMeta({html: input, hostname: 'youtube.com'})
expect(output).toEqual(expectedOutput)
})
it('extracts username from the url a twitter profile page', () => {
const expectedOutput = {
title: '@bluesky on Twitter',
}
const output = extractHtmlMeta({
hostname: 'twitter.com',
pathname: '/bluesky',
})
expect(output).toEqual(expectedOutput)
})
it('extracts username from the url a tweet', () => {
const expectedOutput = {
title: 'Tweet by @bluesky',
}
const output = extractHtmlMeta({
hostname: 'twitter.com',
pathname: '/bluesky/status/1582437529969917953',
})
expect(output).toEqual(expectedOutput)
})
it("does not extract username from the url when it's not a tweet or profile page", () => {
const expectedOutput = {
title: 'Twitter',
}
const output = extractHtmlMeta({
hostname: 'twitter.com',
pathname: '/i/articles/follows/-1675653703?time_window=24',
})
expect(output).toEqual(expectedOutput)
})
})
+93
View File
@@ -0,0 +1,93 @@
import {downloadAndResize, DownloadAndResizeOpts} from '../../src/lib/images'
import ImageResizer from '@bam.tech/react-native-image-resizer'
import RNFetchBlob from 'rn-fetch-blob'
describe('downloadAndResize', () => {
const errorSpy = jest.spyOn(global.console, 'error')
const mockResizedImage = {
path: jest.fn().mockReturnValue('file://resized-image.jpg'),
size: 100,
width: 50,
height: 50,
mime: 'image/jpeg',
}
beforeEach(() => {
const mockedCreateResizedImage =
ImageResizer.createResizedImage as jest.Mock
mockedCreateResizedImage.mockResolvedValue(mockResizedImage)
})
afterEach(() => {
jest.clearAllMocks()
})
it('should return resized image for valid URI and options', async () => {
const mockedFetch = RNFetchBlob.fetch as jest.Mock
mockedFetch.mockResolvedValueOnce({
path: jest.fn().mockReturnValue('file://downloaded-image.jpg'),
flush: jest.fn(),
})
const opts: DownloadAndResizeOpts = {
uri: 'https://example.com/image.jpg',
width: 100,
height: 100,
maxSize: 500000,
mode: 'cover',
timeout: 10000,
}
const result = await downloadAndResize(opts)
expect(result).toEqual(mockResizedImage)
expect(RNFetchBlob.config).toHaveBeenCalledWith({
fileCache: true,
appendExt: 'jpeg',
})
expect(RNFetchBlob.fetch).toHaveBeenCalledWith(
'GET',
'https://example.com/image.jpg',
)
expect(ImageResizer.createResizedImage).toHaveBeenCalledWith(
'file://downloaded-image.jpg',
100,
100,
'JPEG',
100,
undefined,
undefined,
undefined,
{mode: 'cover'},
)
})
it('should return undefined for invalid URI', async () => {
const opts: DownloadAndResizeOpts = {
uri: 'invalid-uri',
width: 100,
height: 100,
maxSize: 500000,
mode: 'cover',
timeout: 10000,
}
const result = await downloadAndResize(opts)
expect(errorSpy).toHaveBeenCalled()
expect(result).toBeUndefined()
})
it('should return undefined for unsupported file type', async () => {
const opts: DownloadAndResizeOpts = {
uri: 'https://example.com/image.bmp',
width: 100,
height: 100,
maxSize: 500000,
mode: 'cover',
timeout: 10000,
}
const result = await downloadAndResize(opts)
expect(result).toBeUndefined()
})
})
+107
View File
@@ -0,0 +1,107 @@
import {LikelyType, getLinkMeta, getLikelyType} from '../../src/lib/link-meta'
import {exampleComHtml} from './__mocks__/exampleComHtml'
import {mockedRootStore} from '../../__mocks__/state-mock'
describe('getLinkMeta', () => {
const inputs = [
'',
'httpbadurl',
'https://example.com',
'https://example.com/index.html',
'https://example.com/image.png',
'https://example.com/video.avi',
'https://example.com/audio.ogg',
'https://example.com/text.txt',
'https://example.com/javascript.js',
'https://bsky.app/',
'https://bsky.app/index.html',
]
const outputs = [
{
error: 'Invalid URL',
likelyType: LikelyType.Other,
url: '',
},
{
error: 'Invalid URL',
likelyType: LikelyType.Other,
url: 'httpbadurl',
},
{
likelyType: LikelyType.HTML,
url: 'https://example.com',
title: 'Example Domain',
description: 'An example website',
},
{
likelyType: LikelyType.HTML,
url: 'https://example.com/index.html',
title: 'Example Domain',
description: 'An example website',
},
{
likelyType: LikelyType.Image,
url: 'https://example.com/image.png',
},
{
likelyType: LikelyType.Video,
url: 'https://example.com/video.avi',
},
{
likelyType: LikelyType.Audio,
url: 'https://example.com/audio.ogg',
},
{
likelyType: LikelyType.Text,
url: 'https://example.com/text.txt',
},
{
likelyType: LikelyType.Other,
url: 'https://example.com/javascript.js',
},
{
likelyType: LikelyType.AtpData,
url: '/',
title: 'Bluesky',
description: 'A new kind of social network',
},
{
likelyType: LikelyType.AtpData,
url: '/index.html',
title: 'Not found',
},
{
likelyType: LikelyType.Other,
url: '',
title: '',
},
]
it('correctly handles a set of text inputs', async () => {
for (let i = 0; i < inputs.length; i++) {
global.fetch = jest.fn().mockImplementationOnce(() => {
return new Promise((resolve, _reject) => {
resolve({
ok: true,
status: 200,
text: () => exampleComHtml,
})
})
})
const input = inputs[i]
const output = await getLinkMeta(mockedRootStore, input)
expect(output).toEqual(outputs[i])
}
})
})
describe('getLikelyType', () => {
it('correctly handles non-parsed url', async () => {
const output = await getLikelyType('https://example.com')
expect(output).toEqual(LikelyType.HTML)
})
it('handles non-string urls without crashing', async () => {
const output = await getLikelyType('123')
expect(output).toEqual(LikelyType.Other)
})
})
+24
View File
@@ -0,0 +1,24 @@
import {clamp} from '../../src/lib/numbers'
describe('clamp', () => {
const inputs: [number, number, number][] = [
[100, 0, 200],
[100, 0, 100],
[0, 0, 100],
[100, 0, -1],
[4, 1, 1],
[100, -100, 0],
[400, 100, -100],
[70, -1, 1],
[Infinity, Infinity, Infinity],
]
const outputs = [100, 100, 0, -1, 1, 0, -100, 1, Infinity]
it('correctly clamps any given number and range', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = clamp(...input)
expect(result).toEqual(outputs[i])
}
})
})
+489
View File
@@ -0,0 +1,489 @@
import {
extractEntities,
detectLinkables,
pluralize,
makeRecordUri,
ago,
makeValidHandle,
createFullHandle,
enforceLen,
cleanError,
toNiceDomain,
toShortUrl,
toShareUrl,
} from '../../src/lib/strings'
describe('extractEntities', () => {
const knownHandles = new Set(['handle.com', 'full123.test-of-chars'])
const inputs = [
'no mention',
'@handle.com middle end',
'start @handle.com end',
'start middle @handle.com',
'@handle.com @handle.com @handle.com',
'@full123.test-of-chars',
'not@right',
'@handle.com!@#$chars',
'@handle.com\n@handle.com',
'parenthetical (@handle.com)',
'start https://middle.com end',
'start https://middle.com/foo/bar end',
'start https://middle.com/foo/bar?baz=bux end',
'start https://middle.com/foo/bar?baz=bux#hash end',
'https://start.com/foo/bar?baz=bux#hash middle end',
'start middle https://end.com/foo/bar?baz=bux#hash',
'https://newline1.com\nhttps://newline2.com',
'start middle.com end',
'start middle.com/foo/bar end',
'start middle.com/foo/bar?baz=bux end',
'start middle.com/foo/bar?baz=bux#hash end',
'start.com/foo/bar?baz=bux#hash middle end',
'start middle end.com/foo/bar?baz=bux#hash',
'newline1.com\nnewline2.com',
'not.. a..url ..here',
'e.g.',
'something-cool.jpg',
'website.com.jpg',
'e.g./foo',
'website.com.jpg/foo',
'Classic article https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
'Classic article https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/ ',
'https://foo.com https://bar.com/whatever https://baz.com',
'punctuation https://foo.com, https://bar.com/whatever; https://baz.com.',
'parenthentical (https://foo.com)',
'except for https://foo.com/thing_(cool)',
]
interface Output {
type: string
value: string
noScheme?: boolean
}
const outputs: Output[][] = [
[],
[{type: 'mention', value: 'handle.com'}],
[{type: 'mention', value: 'handle.com'}],
[{type: 'mention', value: 'handle.com'}],
[
{type: 'mention', value: 'handle.com'},
{type: 'mention', value: 'handle.com'},
{type: 'mention', value: 'handle.com'},
],
[
{
type: 'mention',
value: 'full123.test-of-chars',
},
],
[],
[{type: 'mention', value: 'handle.com'}],
[
{type: 'mention', value: 'handle.com'},
{type: 'mention', value: 'handle.com'},
],
[{type: 'mention', value: 'handle.com'}],
[{type: 'link', value: 'https://middle.com'}],
[{type: 'link', value: 'https://middle.com/foo/bar'}],
[{type: 'link', value: 'https://middle.com/foo/bar?baz=bux'}],
[{type: 'link', value: 'https://middle.com/foo/bar?baz=bux#hash'}],
[{type: 'link', value: 'https://start.com/foo/bar?baz=bux#hash'}],
[{type: 'link', value: 'https://end.com/foo/bar?baz=bux#hash'}],
[
{type: 'link', value: 'https://newline1.com'},
{type: 'link', value: 'https://newline2.com'},
],
[{type: 'link', value: 'middle.com', noScheme: true}],
[{type: 'link', value: 'middle.com/foo/bar', noScheme: true}],
[{type: 'link', value: 'middle.com/foo/bar?baz=bux', noScheme: true}],
[{type: 'link', value: 'middle.com/foo/bar?baz=bux#hash', noScheme: true}],
[{type: 'link', value: 'start.com/foo/bar?baz=bux#hash', noScheme: true}],
[{type: 'link', value: 'end.com/foo/bar?baz=bux#hash', noScheme: true}],
[
{type: 'link', value: 'newline1.com', noScheme: true},
{type: 'link', value: 'newline2.com', noScheme: true},
],
[],
[],
[],
[],
[],
[],
[
{
type: 'link',
value:
'https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
},
],
[
{
type: 'link',
value:
'https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
},
],
[
{type: 'link', value: 'https://foo.com'},
{type: 'link', value: 'https://bar.com/whatever'},
{type: 'link', value: 'https://baz.com'},
],
[
{type: 'link', value: 'https://foo.com'},
{type: 'link', value: 'https://bar.com/whatever'},
{type: 'link', value: 'https://baz.com'},
],
[{type: 'link', value: 'https://foo.com'}],
[{type: 'link', value: 'https://foo.com/thing_(cool)'}],
]
it('correctly handles a set of text inputs', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = extractEntities(input, knownHandles)
if (!outputs[i].length) {
expect(result).toBeFalsy()
} else if (outputs[i].length && !result) {
expect(result).toBeTruthy()
} else if (result) {
expect(result.length).toBe(outputs[i].length)
for (let j = 0; j < outputs[i].length; j++) {
expect(result[j].type).toEqual(outputs[i][j].type)
if (outputs[i][j].noScheme) {
expect(result[j].value).toEqual(`https://${outputs[i][j].value}`)
} else {
expect(result[j].value).toEqual(outputs[i][j].value)
}
if (outputs[i]?.[j].type === 'mention') {
expect(
input.slice(result[j].index.start, result[j].index.end),
).toBe(`@${result[j].value}`)
} else {
if (!outputs[i]?.[j].noScheme) {
expect(
input.slice(result[j].index.start, result[j].index.end),
).toBe(result[j].value)
} else {
expect(
input.slice(result[j].index.start, result[j].index.end),
).toBe(result[j].value.slice('https://'.length))
}
}
}
}
}
})
})
describe('detectLinkables', () => {
const inputs = [
'no linkable',
'@start middle end',
'start @middle end',
'start middle @end',
'@start @middle @end',
'@full123.test-of-chars',
'not@right',
'@bad!@#$chars',
'@newline1\n@newline2',
'parenthetical (@handle)',
'start https://middle.com end',
'start https://middle.com/foo/bar end',
'start https://middle.com/foo/bar?baz=bux end',
'start https://middle.com/foo/bar?baz=bux#hash end',
'https://start.com/foo/bar?baz=bux#hash middle end',
'start middle https://end.com/foo/bar?baz=bux#hash',
'https://newline1.com\nhttps://newline2.com',
'start middle.com end',
'start middle.com/foo/bar end',
'start middle.com/foo/bar?baz=bux end',
'start middle.com/foo/bar?baz=bux#hash end',
'start.com/foo/bar?baz=bux#hash middle end',
'start middle end.com/foo/bar?baz=bux#hash',
'newline1.com\nnewline2.com',
'not.. a..url ..here',
'e.g.',
'e.g. real.com fake.notreal',
'something-cool.jpg',
'website.com.jpg',
'e.g./foo',
'website.com.jpg/foo',
'Classic article https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
'Classic article https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/ ',
'https://foo.com https://bar.com/whatever https://baz.com',
'punctuation https://foo.com, https://bar.com/whatever; https://baz.com.',
'parenthentical (https://foo.com)',
'except for https://foo.com/thing_(cool)',
]
const outputs = [
['no linkable'],
[{link: '@start'}, ' middle end'],
['start ', {link: '@middle'}, ' end'],
['start middle ', {link: '@end'}],
[{link: '@start'}, ' ', {link: '@middle'}, ' ', {link: '@end'}],
[{link: '@full123.test-of-chars'}],
['not@right'],
[{link: '@bad'}, '!@#$chars'],
[{link: '@newline1'}, '\n', {link: '@newline2'}],
['parenthetical (', {link: '@handle'}, ')'],
['start ', {link: 'https://middle.com'}, ' end'],
['start ', {link: 'https://middle.com/foo/bar'}, ' end'],
['start ', {link: 'https://middle.com/foo/bar?baz=bux'}, ' end'],
['start ', {link: 'https://middle.com/foo/bar?baz=bux#hash'}, ' end'],
[{link: 'https://start.com/foo/bar?baz=bux#hash'}, ' middle end'],
['start middle ', {link: 'https://end.com/foo/bar?baz=bux#hash'}],
[{link: 'https://newline1.com'}, '\n', {link: 'https://newline2.com'}],
['start ', {link: 'middle.com'}, ' end'],
['start ', {link: 'middle.com/foo/bar'}, ' end'],
['start ', {link: 'middle.com/foo/bar?baz=bux'}, ' end'],
['start ', {link: 'middle.com/foo/bar?baz=bux#hash'}, ' end'],
[{link: 'start.com/foo/bar?baz=bux#hash'}, ' middle end'],
['start middle ', {link: 'end.com/foo/bar?baz=bux#hash'}],
[{link: 'newline1.com'}, '\n', {link: 'newline2.com'}],
['not.. a..url ..here'],
['e.g.'],
['e.g. ', {link: 'real.com'}, ' fake.notreal'],
['something-cool.jpg'],
['website.com.jpg'],
['e.g./foo'],
['website.com.jpg/foo'],
[
'Classic article ',
{
link: 'https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
},
],
[
'Classic article ',
{
link: 'https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/',
},
' ',
],
[
{link: 'https://foo.com'},
' ',
{link: 'https://bar.com/whatever'},
' ',
{link: 'https://baz.com'},
],
[
'punctuation ',
{link: 'https://foo.com'},
', ',
{link: 'https://bar.com/whatever'},
'; ',
{link: 'https://baz.com'},
'.',
],
['parenthentical (', {link: 'https://foo.com'}, ')'],
['except for ', {link: 'https://foo.com/thing_(cool)'}],
]
it('correctly handles a set of text inputs', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const output = detectLinkables(input)
expect(output).toEqual(outputs[i])
}
})
})
describe('pluralize', () => {
const inputs: [number, string, string?][] = [
[1, 'follower'],
[1, 'member'],
[100, 'post'],
[1000, 'repost'],
[10000, 'upvote'],
[100000, 'other'],
[2, 'man', 'men'],
]
const outputs = [
'follower',
'member',
'posts',
'reposts',
'upvotes',
'others',
'men',
]
it('correctly pluralizes a set of words', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const output = pluralize(...input)
expect(output).toEqual(outputs[i])
}
})
})
describe('makeRecordUri', () => {
const inputs: [string, string, string][] = [
['alice.test', 'app.bsky.feed.post', '3jk7x4irgv52r'],
]
const outputs = ['at://alice.test/app.bsky.feed.post/3jk7x4irgv52r']
it('correctly builds a record URI', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = makeRecordUri(...input)
expect(result).toEqual(outputs[i])
}
})
})
describe('ago', () => {
const inputs = [
1671461038,
'04 Dec 1995 00:12:00 GMT',
new Date(),
new Date().setMinutes(new Date().getMinutes() - 10),
new Date().setHours(new Date().getHours() - 1),
new Date().setDate(new Date().getDate() - 1),
new Date().setMonth(new Date().getMonth() - 1),
]
const outputs = [
new Date(1671461038).toLocaleDateString(),
new Date('04 Dec 1995 00:12:00 GMT').toLocaleDateString(),
'0s',
'10m',
'1h',
'1d',
'1mo',
]
it('correctly calculates how much time passed, in a string', () => {
for (let i = 0; i < inputs.length; i++) {
const result = ago(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
describe('makeValidHandle', () => {
const inputs = [
'test-handle-123',
'test!"#$%&/()=?_',
'this-handle-should-be-too-big',
]
const outputs = ['test-handle-123', 'test', 'this-handle-should-b']
it('correctly parses and corrects handles', () => {
for (let i = 0; i < inputs.length; i++) {
const result = makeValidHandle(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
describe('createFullHandle', () => {
const inputs: [string, string][] = [
['test-handle-123', 'test'],
['.test.handle', 'test.test.'],
['test.handle.', '.test.test'],
]
const outputs = [
'test-handle-123.test',
'.test.handle.test.test.',
'test.handle.test.test',
]
it('correctly parses and corrects handles', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = createFullHandle(...input)
expect(result).toEqual(outputs[i])
}
})
})
describe('enforceLen', () => {
const inputs: [string, number][] = [
['Hello World!', 5],
['Hello World!', 20],
['', 5],
]
const outputs = ['Hello', 'Hello World!', '']
it('correctly enforces defined length on a given string', () => {
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i]
const result = enforceLen(...input)
expect(result).toEqual(outputs[i])
}
})
})
describe('cleanError', () => {
const inputs = [
'TypeError: Network request failed',
'Error: Aborted',
'Error: TypeError "x" is not a function',
'Error: SyntaxError unexpected token "export"',
'Some other error',
]
const outputs = [
'Unable to connect. Please check your internet connection and try again.',
'Unable to connect. Please check your internet connection and try again.',
'TypeError "x" is not a function',
'SyntaxError unexpected token "export"',
'Some other error',
]
it('removes extra content from error message', () => {
for (let i = 0; i < inputs.length; i++) {
const result = cleanError(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
describe('toNiceDomain', () => {
const inputs = [
'https://example.com/index.html',
'https://bsky.app',
'https://bsky.social',
'#123123123',
]
const outputs = ['example.com', 'bsky.app', 'Bluesky Social', '#123123123']
it("displays the url's host in a easily readable manner", () => {
for (let i = 0; i < inputs.length; i++) {
const result = toNiceDomain(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
describe('toShortUrl', () => {
const inputs = [
'https://bsky.app',
'https://bsky.app/3jk7x4irgv52r',
'https://bsky.app/3jk7x4irgv52r2313y182h9',
]
const outputs = [
'bsky.app',
'bsky.app/3jk7x4irgv52r',
'bsky.app/3jk7x4irgv52r2313y...',
]
it('shortens the url', () => {
for (let i = 0; i < inputs.length; i++) {
const result = toShortUrl(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
describe('toShareUrl', () => {
const inputs = ['https://bsky.app', '/3jk7x4irgv52r', 'item/test/123']
const outputs = [
'https://bsky.app',
'https://bsky.app/3jk7x4irgv52r',
'https://bsky.app/item/test/123',
]
it('appends https, when not present', () => {
for (let i = 0; i < inputs.length; i++) {
const result = toShareUrl(inputs[i])
expect(result).toEqual(outputs[i])
}
})
})
@@ -0,0 +1,72 @@
import {RootStoreModel} from '../../../src/state/models/root-store'
import {LinkMetasViewModel} from '../../../src/state/models/link-metas-view'
import * as LinkMetaLib from '../../../src/lib/link-meta'
import {LikelyType} from './../../../src/lib/link-meta'
import {sessionClient, SessionServiceClient} from '@atproto/api'
import {DEFAULT_SERVICE} from '../../../src/state'
describe('LinkMetasViewModel', () => {
let viewModel: LinkMetasViewModel
let rootStore: RootStoreModel
const getLinkMetaMockSpy = jest.spyOn(LinkMetaLib, 'getLinkMeta')
const mockedMeta = {
title: 'Test Title',
url: 'testurl',
likelyType: LikelyType.Other,
}
beforeEach(() => {
const api = sessionClient.service(DEFAULT_SERVICE) as SessionServiceClient
rootStore = new RootStoreModel(api)
viewModel = new LinkMetasViewModel(rootStore)
})
afterAll(() => {
jest.clearAllMocks()
})
describe('getLinkMeta', () => {
it('should return link meta if it is cached', async () => {
const url = 'http://example.com'
viewModel.cache.set(url, mockedMeta)
const result = await viewModel.getLinkMeta(url)
expect(getLinkMetaMockSpy).not.toHaveBeenCalled()
expect(result).toEqual(mockedMeta)
})
it('should return link meta if it is not cached', async () => {
getLinkMetaMockSpy.mockResolvedValueOnce(mockedMeta)
const result = await viewModel.getLinkMeta(mockedMeta.url)
expect(getLinkMetaMockSpy).toHaveBeenCalledWith(rootStore, mockedMeta.url)
expect(result).toEqual(mockedMeta)
})
it('should cache the link meta if it is successfully returned', async () => {
getLinkMetaMockSpy.mockResolvedValueOnce(mockedMeta)
await viewModel.getLinkMeta(mockedMeta.url)
expect(viewModel.cache.get(mockedMeta.url)).toEqual(mockedMeta)
})
it('should not cache the link meta if it fails to return', async () => {
const url = 'http://example.com'
const error = new Error('Failed to fetch link meta')
getLinkMetaMockSpy.mockRejectedValueOnce(error)
try {
await viewModel.getLinkMeta(url)
fail('Error was not thrown')
} catch (e) {
expect(e).toEqual(error)
expect(viewModel.cache.get(url)).toBeUndefined()
}
})
})
})
+153
View File
@@ -0,0 +1,153 @@
import {LogModel} from '../../../src/state/models/log'
describe('LogModel', () => {
let logModel: LogModel
beforeEach(() => {
logModel = new LogModel()
jest.spyOn(console, 'debug')
})
afterAll(() => {
jest.clearAllMocks()
})
it('should call a log method and add a log entry to the entries array', () => {
logModel.debug('Test log')
expect(logModel.entries.length).toEqual(1)
expect(logModel.entries[0]).toEqual({
id: logModel.entries[0].id,
type: 'debug',
summary: 'Test log',
details: undefined,
ts: logModel.entries[0].ts,
})
logModel.warn('Test log')
expect(logModel.entries.length).toEqual(2)
expect(logModel.entries[1]).toEqual({
id: logModel.entries[1].id,
type: 'warn',
summary: 'Test log',
details: undefined,
ts: logModel.entries[1].ts,
})
logModel.error('Test log')
expect(logModel.entries.length).toEqual(3)
expect(logModel.entries[2]).toEqual({
id: logModel.entries[2].id,
type: 'error',
summary: 'Test log',
details: undefined,
ts: logModel.entries[2].ts,
})
})
it('should call the console.debug after calling the debug method', () => {
logModel.debug('Test log')
expect(console.debug).toHaveBeenCalledWith('Test log', '')
})
it('should call the serialize method', () => {
logModel.debug('Test log')
expect(logModel.serialize()).toEqual({
entries: [
{
id: logModel.entries[0].id,
type: 'debug',
summary: 'Test log',
details: undefined,
ts: logModel.entries[0].ts,
},
],
})
})
it('should call the hydrate method with valid properties', () => {
logModel.hydrate({
entries: [
{
id: '123',
type: 'debug',
summary: 'Test log',
details: undefined,
ts: 123,
},
],
})
expect(logModel.entries).toEqual([
{
id: '123',
type: 'debug',
summary: 'Test log',
details: undefined,
ts: 123,
},
])
})
it('should call the hydrate method with invalid properties', () => {
logModel.hydrate({
entries: [
{
id: '123',
type: 'debug',
summary: 'Test log',
details: undefined,
ts: 123,
},
{
summary: 'Invalid entry',
},
],
})
expect(logModel.entries).toEqual([
{
id: '123',
type: 'debug',
summary: 'Test log',
details: undefined,
ts: 123,
},
])
})
it('should stringify the details if it is not a string', () => {
logModel.debug('Test log', {details: 'test'})
expect(logModel.entries[0].details).toEqual('{\n "details": "test"\n}')
})
it('should stringify the details object if it is of a specific error', () => {
class TestError extends Error {
constructor() {
super()
this.name = 'TestError'
}
}
const error = new TestError()
logModel.error('Test error log', error)
expect(logModel.entries[0].details).toEqual('TestError')
class XRPCInvalidResponseErrorMock {
validationError = {toString: () => 'validationError'}
lexiconNsid = 'test'
}
const xrpcInvalidResponseError = new XRPCInvalidResponseErrorMock()
logModel.error('Test error log', xrpcInvalidResponseError)
expect(logModel.entries[1].details).toEqual(
'{\n "validationError": {},\n "lexiconNsid": "test"\n}',
)
class XRPCErrorMock {
status = 'status'
error = 'error'
message = 'message'
}
const xrpcError = new XRPCErrorMock()
logModel.error('Test error log', xrpcError)
expect(logModel.entries[2].details).toEqual(
'{\n "status": "status",\n "error": "error",\n "message": "message"\n}',
)
})
})
+180
View File
@@ -0,0 +1,180 @@
import {RootStoreModel} from '../../../src/state/models/root-store'
import {MeModel} from '../../../src/state/models/me'
import {NotificationsViewModel} from './../../../src/state/models/notifications-view'
import {sessionClient, SessionServiceClient} from '@atproto/api'
import {DEFAULT_SERVICE} from './../../../src/state/index'
describe('MeModel', () => {
let rootStore: RootStoreModel
let meModel: MeModel
beforeEach(() => {
const api = sessionClient.service(DEFAULT_SERVICE) as SessionServiceClient
rootStore = new RootStoreModel(api)
meModel = new MeModel(rootStore)
})
afterAll(() => {
jest.clearAllMocks()
})
it('should clear() correctly', () => {
meModel.did = '123'
meModel.handle = 'handle'
meModel.displayName = 'John Doe'
meModel.description = 'description'
meModel.avatar = 'avatar'
meModel.notificationCount = 1
meModel.clear()
expect(meModel.did).toEqual('')
expect(meModel.handle).toEqual('')
expect(meModel.displayName).toEqual('')
expect(meModel.description).toEqual('')
expect(meModel.avatar).toEqual('')
expect(meModel.notificationCount).toEqual(0)
})
it('should hydrate() successfully with valid properties', () => {
meModel.hydrate({
did: '123',
handle: 'handle',
displayName: 'John Doe',
description: 'description',
avatar: 'avatar',
})
expect(meModel.did).toEqual('123')
expect(meModel.handle).toEqual('handle')
expect(meModel.displayName).toEqual('John Doe')
expect(meModel.description).toEqual('description')
expect(meModel.avatar).toEqual('avatar')
})
it('should not hydrate() with invalid properties', () => {
meModel.hydrate({
did: '',
handle: 'handle',
displayName: 'John Doe',
description: 'description',
avatar: 'avatar',
})
expect(meModel.did).toEqual('')
expect(meModel.handle).toEqual('')
expect(meModel.displayName).toEqual('')
expect(meModel.description).toEqual('')
expect(meModel.avatar).toEqual('')
meModel.hydrate({
did: '123',
displayName: 'John Doe',
description: 'description',
avatar: 'avatar',
})
expect(meModel.did).toEqual('')
expect(meModel.handle).toEqual('')
expect(meModel.displayName).toEqual('')
expect(meModel.description).toEqual('')
expect(meModel.avatar).toEqual('')
})
it('should load() successfully', async () => {
jest
.spyOn(rootStore.api.app.bsky.actor, 'getProfile')
.mockImplementationOnce((): Promise<any> => {
return Promise.resolve({
data: {
displayName: 'John Doe',
description: 'description',
avatar: 'avatar',
},
})
})
rootStore.session.data = {
did: '123',
handle: 'handle',
service: 'test service',
accessJwt: 'test token',
refreshJwt: 'test token',
}
await meModel.load()
expect(meModel.did).toEqual('123')
expect(meModel.handle).toEqual('handle')
expect(meModel.displayName).toEqual('John Doe')
expect(meModel.description).toEqual('description')
expect(meModel.avatar).toEqual('avatar')
})
it('should load() successfully without profile data', async () => {
jest
.spyOn(rootStore.api.app.bsky.actor, 'getProfile')
.mockImplementationOnce((): Promise<any> => {
return Promise.resolve({
data: null,
})
})
rootStore.session.data = {
did: '123',
handle: 'handle',
service: 'test service',
accessJwt: 'test token',
refreshJwt: 'test token',
}
await meModel.load()
expect(meModel.did).toEqual('123')
expect(meModel.handle).toEqual('handle')
expect(meModel.displayName).toEqual('')
expect(meModel.description).toEqual('')
expect(meModel.avatar).toEqual('')
})
it('should load() to nothing when no session', async () => {
rootStore.session.data = null
await meModel.load()
expect(meModel.did).toEqual('')
expect(meModel.handle).toEqual('')
expect(meModel.displayName).toEqual('')
expect(meModel.description).toEqual('')
expect(meModel.avatar).toEqual('')
expect(meModel.notificationCount).toEqual(0)
})
it('should serialize() key information', () => {
meModel.did = '123'
meModel.handle = 'handle'
meModel.displayName = 'John Doe'
meModel.description = 'description'
meModel.avatar = 'avatar'
expect(meModel.serialize()).toEqual({
did: '123',
handle: 'handle',
displayName: 'John Doe',
description: 'description',
avatar: 'avatar',
})
})
it('should clearNotificationCount() successfully', () => {
meModel.clearNotificationCount()
expect(meModel.notificationCount).toBe(0)
})
it('should update notifs count with fetchStateUpdate()', async () => {
meModel.notifications = {
refresh: jest.fn().mockResolvedValue({}),
} as unknown as NotificationsViewModel
jest
.spyOn(rootStore.api.app.bsky.notification, 'getCount')
.mockImplementationOnce((): Promise<any> => {
return Promise.resolve({
data: {
count: 1,
},
})
})
await meModel.fetchNotifications()
expect(meModel.notificationCount).toBe(1)
expect(meModel.notifications.refresh).toHaveBeenCalled()
})
})
+151
View File
@@ -0,0 +1,151 @@
import {NavigationModel} from './../../../src/state/models/navigation'
import * as flags from '../../../src/build-flags'
describe('NavigationModel', () => {
let model: NavigationModel
beforeEach(() => {
model = new NavigationModel()
model.setTitle('0-0', 'title')
})
afterAll(() => {
jest.clearAllMocks()
})
it('should clear() to the correct base state', async () => {
await model.clear()
expect(model.tabCount).toBe(2)
expect(model.tab).toEqual({
fixedTabPurpose: 0,
history: [
{
id: expect.anything(),
ts: expect.anything(),
url: '/',
},
],
id: expect.anything(),
index: 0,
isNewTab: false,
})
})
it('should call the navigate method', async () => {
const navigateSpy = jest.spyOn(model.tab, 'navigate')
await model.navigate('testurl', 'teststring')
expect(navigateSpy).toHaveBeenCalledWith('testurl', 'teststring')
})
it('should call the refresh method', async () => {
const refreshSpy = jest.spyOn(model.tab, 'refresh')
await model.refresh()
expect(refreshSpy).toHaveBeenCalled()
})
it('should call the isCurrentScreen method', () => {
expect(model.isCurrentScreen('11', 0)).toEqual(false)
})
it('should call the tab getter', () => {
expect(model.tab).toEqual({
fixedTabPurpose: 0,
history: [
{
id: expect.anything(),
ts: expect.anything(),
url: '/',
},
],
id: expect.anything(),
index: 0,
isNewTab: false,
})
})
it('should call the tabCount getter', () => {
expect(model.tabCount).toBe(2)
})
describe('tabs not enabled', () => {
jest.mock('../../../src/build-flags', () => ({
TABS_ENABLED: false,
}))
afterAll(() => {
jest.clearAllMocks()
})
it('should not create new tabs', () => {
// @ts-expect-error
flags.TABS_ENABLED = false
model.newTab('testurl')
expect(model.tab.isNewTab).toBe(false)
expect(model.tabIndex).toBe(0)
})
it('should not change the active tab', () => {
// @ts-expect-error
flags.TABS_ENABLED = false
model.setActiveTab(2)
expect(model.tabIndex).toBe(0)
})
it('should note close tabs', () => {
// @ts-expect-error
flags.TABS_ENABLED = false
model.closeTab(0)
expect(model.tabCount).toBe(2)
})
})
describe('tabs enabled', () => {
jest.mock('../../../src/build-flags', () => ({
TABS_ENABLED: true,
}))
afterAll(() => {
jest.clearAllMocks()
})
it('should create new tabs', () => {
// @ts-expect-error
flags.TABS_ENABLED = true
model.newTab('testurl', 'title')
expect(model.tab.isNewTab).toBe(true)
expect(model.tabIndex).toBe(2)
})
it('should change the current tab', () => {
// @ts-expect-error
flags.TABS_ENABLED = true
model.setActiveTab(0)
expect(model.tabIndex).toBe(0)
})
it('should close tabs', () => {
// @ts-expect-error
flags.TABS_ENABLED = true
model.closeTab(0)
expect(model.tabs).toEqual([
{
fixedTabPurpose: 1,
history: [
{
id: expect.anything(),
ts: expect.anything(),
url: '/notifications',
},
],
id: expect.anything(),
index: 0,
isNewTab: false,
},
])
expect(model.tabIndex).toBe(0)
})
})
})
+46
View File
@@ -0,0 +1,46 @@
import {
OnboardModel,
OnboardStageOrder,
} from '../../../src/state/models/onboard'
describe('OnboardModel', () => {
let onboardModel: OnboardModel
beforeEach(() => {
onboardModel = new OnboardModel()
})
afterAll(() => {
jest.clearAllMocks()
})
it('should start/stop correctly', () => {
onboardModel.start()
expect(onboardModel.isOnboarding).toBe(true)
onboardModel.stop()
expect(onboardModel.isOnboarding).toBe(false)
})
it('should call the next method until it has no more stages', () => {
onboardModel.start()
onboardModel.next()
expect(onboardModel.stage).toBe(OnboardStageOrder[1])
onboardModel.next()
expect(onboardModel.isOnboarding).toBe(false)
expect(onboardModel.stage).toBe(OnboardStageOrder[0])
})
it('serialize and hydrate', () => {
const serialized = onboardModel.serialize()
const newModel = new OnboardModel()
newModel.hydrate(serialized)
expect(newModel).toEqual(onboardModel)
onboardModel.start()
onboardModel.next()
const serialized2 = onboardModel.serialize()
newModel.hydrate(serialized2)
expect(newModel).toEqual(onboardModel)
})
})
+59
View File
@@ -0,0 +1,59 @@
import {RootStoreModel} from '../../../src/state/models/root-store'
import {setupState} from '../../../src/state'
describe('rootStore', () => {
let rootStore: RootStoreModel
beforeAll(() => {
jest.useFakeTimers()
})
beforeEach(async () => {
rootStore = await setupState()
})
afterAll(() => {
jest.clearAllMocks()
})
it('should call the clearAll() resets state correctly', () => {
rootStore.clearAll()
expect(rootStore.session.data).toEqual(null)
expect(rootStore.nav.tabs).toEqual([
{
fixedTabPurpose: 0,
history: [
{
id: expect.anything(),
ts: expect.anything(),
url: '/',
},
],
id: expect.anything(),
index: 0,
isNewTab: false,
},
{
fixedTabPurpose: 1,
history: [
{
id: expect.anything(),
ts: expect.anything(),
url: '/notifications',
},
],
id: expect.anything(),
index: 0,
isNewTab: false,
},
])
expect(rootStore.nav.tabIndex).toEqual(0)
expect(rootStore.me.did).toEqual('')
expect(rootStore.me.handle).toEqual('')
expect(rootStore.me.displayName).toEqual('')
expect(rootStore.me.description).toEqual('')
expect(rootStore.me.avatar).toEqual('')
expect(rootStore.me.notificationCount).toEqual(0)
})
})
+61
View File
@@ -0,0 +1,61 @@
import {
ConfirmModal,
ImagesLightbox,
ShellUiModel,
} from './../../../src/state/models/shell-ui'
describe('ShellUiModel', () => {
let model: ShellUiModel
beforeEach(() => {
model = new ShellUiModel()
})
afterAll(() => {
jest.clearAllMocks()
})
it('should call the openModal & closeModal method', () => {
const m = new ConfirmModal('Test Modal', 'Look good?', () => {})
model.openModal(m)
expect(model.isModalActive).toEqual(true)
expect(model.activeModal).toEqual(m)
model.closeModal()
expect(model.isModalActive).toEqual(false)
expect(model.activeModal).toBeUndefined()
})
it('should call the openLightbox & closeLightbox method', () => {
const lt = new ImagesLightbox(['uri'], 0)
model.openLightbox(lt)
expect(model.isLightboxActive).toEqual(true)
expect(model.activeLightbox).toEqual(lt)
model.closeLightbox()
expect(model.isLightboxActive).toEqual(false)
expect(model.activeLightbox).toBeUndefined()
})
it('should call the openComposer & closeComposer method', () => {
const composer = {
replyTo: {
uri: 'uri',
cid: 'cid',
text: 'text',
author: {
handle: 'handle',
displayName: 'name',
},
},
onPost: jest.fn(),
}
model.openComposer(composer)
expect(model.isComposerActive).toEqual(true)
expect(model.composerOpts).toEqual(composer)
model.closeComposer()
expect(model.isComposerActive).toEqual(false)
expect(model.composerOpts).toBeUndefined()
})
})
@@ -0,0 +1,43 @@
import React from 'react'
import {Autocomplete} from '../../../../src/view/com/composer/Autocomplete'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
describe('Autocomplete', () => {
const onSelectMock = jest.fn()
const mockedProps = {
active: true,
items: [
{
handle: 'handle.test',
displayName: 'Test Display',
},
{
handle: 'handle2.test',
displayName: 'Test Display 2',
},
],
onSelect: onSelectMock,
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders a button for each user', async () => {
const {findAllByTestId} = render(<Autocomplete {...mockedProps} />)
const autocompleteButton = await findAllByTestId('autocompleteButton')
expect(autocompleteButton.length).toBe(2)
})
it('triggers onSelect by pressing the button', async () => {
const {findAllByTestId} = render(<Autocomplete {...mockedProps} />)
const autocompleteButton = await findAllByTestId('autocompleteButton')
fireEvent.press(autocompleteButton[0])
expect(onSelectMock).toHaveBeenCalledWith('handle.test')
fireEvent.press(autocompleteButton[1])
expect(onSelectMock).toHaveBeenCalledWith('handle2.test')
})
})
@@ -0,0 +1,118 @@
import React from 'react'
import {ComposePost} from '../../../../src/view/com/composer/ComposePost'
import {cleanup, fireEvent, render, waitFor} from '../../../../jest/test-utils'
import * as apilib from '../../../../src/state/lib/api'
import {
mockedAutocompleteViewStore,
mockedRootStore,
} from '../../../../__mocks__/state-mock'
import Toast from 'react-native-root-toast'
describe('ComposePost', () => {
const mockedProps = {
replyTo: {
uri: 'testUri',
cid: 'testCid',
text: 'testText',
author: {
handle: 'test.handle',
displayName: 'test name',
avatar: '',
},
},
onPost: jest.fn(),
onClose: jest.fn(),
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders post composer', async () => {
const {findByTestId} = render(<ComposePost {...mockedProps} />)
const composePostView = await findByTestId('composePostView')
expect(composePostView).toBeTruthy()
})
it('closes composer', async () => {
const {findByTestId} = render(<ComposePost {...mockedProps} />)
const composerCancelButton = await findByTestId('composerCancelButton')
fireEvent.press(composerCancelButton)
expect(mockedProps.onClose).toHaveBeenCalled()
})
it('changes text and publishes post', async () => {
const postSpy = jest.spyOn(apilib, 'post').mockResolvedValue({
uri: '',
cid: '',
})
const toastSpy = jest.spyOn(Toast, 'show')
const wrapper = render(<ComposePost {...mockedProps} />)
const composerTextInput = await wrapper.findByTestId('composerTextInput')
fireEvent.changeText(composerTextInput, 'testing publish')
const composerPublishButton = await wrapper.findByTestId(
'composerPublishButton',
)
fireEvent.press(composerPublishButton)
expect(postSpy).toHaveBeenCalledWith(
mockedRootStore,
'testing publish',
'testUri',
undefined,
[],
new Set<string>(),
expect.anything(),
)
// Waits for request to be resolved
await waitFor(() => {
expect(mockedProps.onPost).toHaveBeenCalled()
expect(mockedProps.onClose).toHaveBeenCalled()
expect(toastSpy).toHaveBeenCalledWith('Your reply has been published', {
animation: true,
duration: 3500,
hideOnPress: true,
position: 50,
shadow: true,
})
})
})
it('selects autocomplete item', async () => {
jest
.spyOn(React, 'useMemo')
.mockReturnValueOnce(mockedAutocompleteViewStore)
const {findAllByTestId} = render(<ComposePost {...mockedProps} />)
const autocompleteButton = await findAllByTestId('autocompleteButton')
fireEvent.press(autocompleteButton[0])
expect(mockedAutocompleteViewStore.setActive).toHaveBeenCalledWith(false)
})
it('selects photos', async () => {
const {findByTestId, queryByTestId} = render(
<ComposePost {...mockedProps} />,
)
let photoCarouselPickerView = queryByTestId('photoCarouselPickerView')
expect(photoCarouselPickerView).toBeFalsy()
const composerSelectPhotosButton = await findByTestId(
'composerSelectPhotosButton',
)
fireEvent.press(composerSelectPhotosButton)
photoCarouselPickerView = await findByTestId('photoCarouselPickerView')
expect(photoCarouselPickerView).toBeTruthy()
fireEvent.press(composerSelectPhotosButton)
photoCarouselPickerView = queryByTestId('photoCarouselPickerView')
expect(photoCarouselPickerView).toBeFalsy()
})
})
@@ -0,0 +1,70 @@
import React from 'react'
import {SelectedPhoto} from '../../../../src/view/com/composer/SelectedPhoto'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
describe('SelectedPhoto', () => {
const mockedProps = {
selectedPhotos: ['mock-uri', 'mock-uri-2'],
onSelectPhotos: jest.fn(),
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('has no photos to render', () => {
const {queryByTestId} = render(
<SelectedPhoto selectedPhotos={[]} onSelectPhotos={jest.fn()} />,
)
const selectedPhotosView = queryByTestId('selectedPhotosView')
expect(selectedPhotosView).toBeNull()
const selectedPhotoImage = queryByTestId('selectedPhotoImage')
expect(selectedPhotoImage).toBeNull()
})
it('has 1 photos to render', async () => {
const {findByTestId} = render(
<SelectedPhoto
selectedPhotos={['mock-uri']}
onSelectPhotos={jest.fn()}
/>,
)
const selectedPhotosView = await findByTestId('selectedPhotosView')
expect(selectedPhotosView).toBeTruthy()
const selectedPhotoImage = await findByTestId('selectedPhotoImage')
expect(selectedPhotoImage).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage).toHaveStyle({width: 250})
})
it('has 2 photos to render', async () => {
const {findAllByTestId} = render(<SelectedPhoto {...mockedProps} />)
const selectedPhotoImage = await findAllByTestId('selectedPhotoImage')
expect(selectedPhotoImage[0]).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage[0]).toHaveStyle({width: 175})
})
it('has 3 photos to render', async () => {
const {findAllByTestId} = render(
<SelectedPhoto
selectedPhotos={['mock-uri', 'mock-uri-2', 'mock-uri-3']}
onSelectPhotos={jest.fn()}
/>,
)
const selectedPhotoImage = await findAllByTestId('selectedPhotoImage')
expect(selectedPhotoImage[0]).toBeTruthy()
// @ts-expect-error
expect(selectedPhotoImage[0]).toHaveStyle({width: 85})
})
it('removes a photo', async () => {
const {findAllByTestId} = render(<SelectedPhoto {...mockedProps} />)
const removePhotoButton = await findAllByTestId('removePhotoButton')
fireEvent.press(removePhotoButton[0])
expect(mockedProps.onSelectPhotos).toHaveBeenCalledWith(['mock-uri-2'])
})
})
@@ -0,0 +1,58 @@
import React from 'react'
import {Keyboard} from 'react-native'
import {CreateAccount} from '../../../../src/view/com/login/CreateAccount'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
import {
mockedSessionStore,
mockedShellStore,
} from '../../../../__mocks__/state-mock'
describe('CreateAccount', () => {
const mockedProps = {
onPressBack: jest.fn(),
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders form and creates new account', async () => {
const {findByTestId} = render(<CreateAccount {...mockedProps} />)
const registerEmailInput = await findByTestId('registerEmailInput')
expect(registerEmailInput).toBeTruthy()
fireEvent.changeText(registerEmailInput, 'test@email.com')
const registerHandleInput = await findByTestId('registerHandleInput')
expect(registerHandleInput).toBeTruthy()
fireEvent.changeText(registerHandleInput, 'test.handle')
const registerPasswordInput = await findByTestId('registerPasswordInput')
expect(registerPasswordInput).toBeTruthy()
fireEvent.changeText(registerPasswordInput, 'testpass')
const registerIs13Input = await findByTestId('registerIs13Input')
expect(registerIs13Input).toBeTruthy()
fireEvent.press(registerIs13Input)
const createAccountButton = await findByTestId('createAccountButton')
expect(createAccountButton).toBeTruthy()
fireEvent.press(createAccountButton)
expect(mockedSessionStore.createAccount).toHaveBeenCalled()
})
it('renders and selects service', async () => {
const keyboardSpy = jest.spyOn(Keyboard, 'dismiss')
const {findByTestId} = render(<CreateAccount {...mockedProps} />)
const registerSelectServiceButton = await findByTestId(
'registerSelectServiceButton',
)
expect(registerSelectServiceButton).toBeTruthy()
fireEvent.press(registerSelectServiceButton)
expect(mockedShellStore.openModal).toHaveBeenCalled()
expect(keyboardSpy).toHaveBeenCalled()
})
})
@@ -0,0 +1,110 @@
import React from 'react'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
import {ProfileViewModel} from '../../../../src/state/models/profile-view'
import {ProfileHeader} from '../../../../src/view/com/profile/ProfileHeader'
import {
mockedNavigationStore,
mockedProfileStore,
mockedShellStore,
} from '../../../../__mocks__/state-mock'
describe('ProfileHeader', () => {
const mockedProps = {
view: mockedProfileStore,
onRefreshAll: jest.fn(),
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders ErrorMessage on error', async () => {
const {findByTestId} = render(
<ProfileHeader
{...{
view: {
...mockedProfileStore,
hasError: true,
} as ProfileViewModel,
onRefreshAll: jest.fn(),
}}
/>,
)
const profileHeaderHasError = await findByTestId('profileHeaderHasError')
expect(profileHeaderHasError).toBeTruthy()
})
it('presses and opens edit profile', async () => {
const {findByTestId} = render(<ProfileHeader {...mockedProps} />)
const profileHeaderEditProfileButton = await findByTestId(
'profileHeaderEditProfileButton',
)
expect(profileHeaderEditProfileButton).toBeTruthy()
fireEvent.press(profileHeaderEditProfileButton)
expect(mockedShellStore.openModal).toHaveBeenCalled()
})
it('presses and opens followers page', async () => {
const {findByTestId} = render(<ProfileHeader {...mockedProps} />)
const profileHeaderFollowersButton = await findByTestId(
'profileHeaderFollowersButton',
)
expect(profileHeaderFollowersButton).toBeTruthy()
fireEvent.press(profileHeaderFollowersButton)
expect(mockedNavigationStore.navigate).toHaveBeenCalledWith(
'/profile/testhandle/followers',
)
})
// TODO - this will only pass if the profile has an avatar image set
// it('presses and opens avatar modal', async () => {
// const {findByTestId} = render(<ProfileHeader {...mockedProps} />)
// const profileHeaderAviButton = await findByTestId('profileHeaderAviButton')
// expect(profileHeaderAviButton).toBeTruthy()
// fireEvent.press(profileHeaderAviButton)
// expect(mockedShellStore.openLightbox).toHaveBeenCalled()
// })
it('presses and opens follows page', async () => {
const {findByTestId} = render(<ProfileHeader {...mockedProps} />)
const profileHeaderFollowsButton = await findByTestId(
'profileHeaderFollowsButton',
)
expect(profileHeaderFollowsButton).toBeTruthy()
fireEvent.press(profileHeaderFollowsButton)
expect(mockedNavigationStore.navigate).toHaveBeenCalledWith(
'/profile/testhandle/follows',
)
})
it('toggles following', async () => {
const {findByTestId} = render(
<ProfileHeader
{...{
view: {
...mockedProfileStore,
did: 'test did 2',
} as ProfileViewModel,
onRefreshAll: jest.fn(),
}}
/>,
)
const profileHeaderToggleFollowButton = await findByTestId(
'profileHeaderToggleFollowButton',
)
expect(profileHeaderToggleFollowButton).toBeTruthy()
fireEvent.press(profileHeaderToggleFollowButton)
expect(mockedProps.view.toggleFollowing).toHaveBeenCalled()
})
})
@@ -0,0 +1,17 @@
import {renderHook} from '../../../jest/test-utils'
import {useAnimatedValue} from '../../../src/view/lib/hooks/useAnimatedValue'
describe('useAnimatedValue', () => {
it('creates an Animated.Value with the initial value passed to the hook', () => {
const {result} = renderHook(() => useAnimatedValue(10))
// @ts-expect-error
expect(result.current.__getValue()).toEqual(10)
})
it('returns the same Animated.Value instance on subsequent renders', () => {
const {result, rerender} = renderHook(() => useAnimatedValue(10))
const firstValue = result.current
rerender({})
expect(result.current).toBe(firstValue)
})
})
@@ -0,0 +1,49 @@
import React from 'react'
import {fireEvent, render} from '../../../jest/test-utils'
import {Home} from '../../../src/view/screens/Home'
import {mockedRootStore, mockedShellStore} from '../../../__mocks__/state-mock'
describe('useOnMainScroll', () => {
const mockedProps = {
navIdx: [0, 0] as [number, number],
params: {},
visible: true,
}
it('toggles minimalShellMode to true', () => {
jest.useFakeTimers()
const {getByTestId} = render(<Home {...mockedProps} />)
fireEvent.scroll(getByTestId('homeFeed'), {
nativeEvent: {
contentOffset: {y: 20},
contentSize: {height: 100},
layoutMeasurement: {height: 50},
},
})
expect(mockedRootStore.shell.setMinimalShellMode).toHaveBeenCalledWith(true)
})
it('toggles minimalShellMode to false', () => {
jest.useFakeTimers()
const {getByTestId} = render(<Home {...mockedProps} />, {
...mockedRootStore,
shell: {
...mockedShellStore,
minimalShellMode: true,
},
})
fireEvent.scroll(getByTestId('homeFeed'), {
nativeEvent: {
contentOffset: {y: 0},
contentSize: {height: 100},
layoutMeasurement: {height: 50},
},
})
expect(mockedRootStore.shell.setMinimalShellMode).toHaveBeenCalledWith(
false,
)
})
})
+37
View File
@@ -0,0 +1,37 @@
import React from 'react'
import {Login} from '../../../src/view/screens/Login'
import {cleanup, fireEvent, render} from '../../../jest/test-utils'
describe('Login', () => {
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders initial screen', () => {
const {getByTestId} = render(<Login />)
const signUpScreen = getByTestId('signinOrCreateAccount')
expect(signUpScreen).toBeTruthy()
})
it('renders Signin screen', () => {
const {getByTestId} = render(<Login />)
const signInButton = getByTestId('signInButton')
fireEvent.press(signInButton)
const signInScreen = getByTestId('signIn')
expect(signInScreen).toBeTruthy()
})
it('renders CreateAccount screen', () => {
const {getByTestId} = render(<Login />)
const createAccountButton = getByTestId('createAccountButton')
fireEvent.press(createAccountButton)
const createAccountScreen = getByTestId('createAccount')
expect(createAccountScreen).toBeTruthy()
})
})
+21
View File
@@ -0,0 +1,21 @@
import React from 'react'
import {NotFound} from '../../../src/view/screens/NotFound'
import {cleanup, fireEvent, render} from '../../../jest/test-utils'
import {mockedNavigationStore} from '../../../__mocks__/state-mock'
describe('NotFound', () => {
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('navigates home', async () => {
const navigationSpy = jest.spyOn(mockedNavigationStore, 'navigate')
const {getByTestId} = render(<NotFound />)
const navigateHomeButton = getByTestId('navigateHomeButton')
fireEvent.press(navigateHomeButton)
expect(navigationSpy).toHaveBeenCalledWith('/')
})
})
+30
View File
@@ -0,0 +1,30 @@
import React from 'react'
import {Search} from '../../../src/view/screens/Search'
import {cleanup, fireEvent, render} from '../../../jest/test-utils'
describe('Search', () => {
jest.useFakeTimers()
const mockedProps = {
navIdx: [0, 0] as [number, number],
params: {
name: 'test name',
},
visible: true,
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders with query', async () => {
const {findByTestId} = render(<Search {...mockedProps} />)
const searchTextInput = await findByTestId('searchTextInput')
expect(searchTextInput).toBeTruthy()
fireEvent.changeText(searchTextInput, 'test')
const searchScrollView = await findByTestId('searchScrollView')
expect(searchScrollView).toBeTruthy()
})
})
+57
View File
@@ -0,0 +1,57 @@
import React from 'react'
import {Menu} from '../../../../src/view/shell/mobile/Menu'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
import {mockedNavigationStore} from '../../../../__mocks__/state-mock'
describe('Menu', () => {
const onCloseMock = jest.fn()
const mockedProps = {
visible: true,
onClose: onCloseMock,
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders menu', () => {
const {getByTestId} = render(<Menu {...mockedProps} />)
const menuView = getByTestId('menuView')
expect(menuView).toBeTruthy()
})
it('presses profile card button', () => {
const {getByTestId} = render(<Menu {...mockedProps} />)
const profileCardButton = getByTestId('profileCardButton')
fireEvent.press(profileCardButton)
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.switchTo).toHaveBeenCalledWith(0, true)
})
it('presses search button', () => {
const {getByTestId} = render(<Menu {...mockedProps} />)
const searchBtn = getByTestId('searchBtn')
fireEvent.press(searchBtn)
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.switchTo).toHaveBeenCalledWith(0, true)
expect(mockedNavigationStore.navigate).toHaveBeenCalledWith('/search')
})
it("presses notifications menu item' button", () => {
const {getByTestId} = render(<Menu {...mockedProps} />)
const menuItemButton = getByTestId('menuItemButton-Notifications')
fireEvent.press(menuItemButton)
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.switchTo).toHaveBeenCalledWith(1, true)
})
})
@@ -0,0 +1,100 @@
import React from 'react'
import {Animated} from 'react-native'
import {TabsSelector} from '../../../../src/view/shell/mobile/TabsSelector'
import {cleanup, fireEvent, render} from '../../../../jest/test-utils'
import {mockedNavigationStore} from '../../../../__mocks__/state-mock'
describe('TabsSelector', () => {
const onCloseMock = jest.fn()
const mockedProps = {
active: true,
tabMenuInterp: new Animated.Value(0),
onClose: onCloseMock,
}
afterAll(() => {
jest.clearAllMocks()
cleanup()
})
it('renders tabs selector', () => {
const {getByTestId} = render(<TabsSelector {...mockedProps} />)
const tabsSelectorView = getByTestId('tabsSelectorView')
expect(tabsSelectorView).toBeTruthy()
})
it('renders nothing if inactive', () => {
const {getByTestId} = render(
<TabsSelector {...{...mockedProps, active: false}} />,
)
const emptyView = getByTestId('emptyView')
expect(emptyView).toBeTruthy()
})
// TODO - this throws currently, but the tabs selector isnt being used atm so I just disabled -prf
// it('presses share button', () => {
// const shareSpy = jest.spyOn(Share, 'share')
// const {getByTestId} = render(<TabsSelector {...mockedProps} />)
// const shareButton = getByTestId('shareButton')
// fireEvent.press(shareButton)
// expect(onCloseMock).toHaveBeenCalled()
// expect(shareSpy).toHaveBeenCalledWith({url: 'https://bsky.app/'})
// })
it('presses clone button', () => {
const {getByTestId} = render(<TabsSelector {...mockedProps} />)
const cloneButton = getByTestId('cloneButton')
fireEvent.press(cloneButton)
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.newTab).toHaveBeenCalled()
})
it('presses new tab button', () => {
const {getByTestId} = render(<TabsSelector {...mockedProps} />)
const newTabButton = getByTestId('newTabButton')
fireEvent.press(newTabButton)
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.newTab).toHaveBeenCalledWith('/')
})
it('presses change tab button', () => {
const {getAllByTestId} = render(<TabsSelector {...mockedProps} />)
const changeTabButton = getAllByTestId('changeTabButton')
fireEvent.press(changeTabButton[0])
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.newTab).toHaveBeenCalledWith('/')
})
it('presses close tab button', () => {
const {getAllByTestId} = render(<TabsSelector {...mockedProps} />)
const closeTabButton = getAllByTestId('closeTabButton')
fireEvent.press(closeTabButton[0])
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.setActiveTab).toHaveBeenCalledWith(0)
})
it('presses swipes to close the tab', () => {
const {getByTestId} = render(<TabsSelector {...mockedProps} />)
const tabsSwipable = getByTestId('tabsSwipable')
fireEvent(tabsSwipable, 'swipeableRightOpen')
expect(onCloseMock).toHaveBeenCalled()
expect(mockedNavigationStore.setActiveTab).toHaveBeenCalledWith(0)
})
})
-55
View File
@@ -1,55 +0,0 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
lib_deps = []
create_aar_targets(glob(["libs/*.aar"]))
create_jar_targets(glob(["libs/*.jar"]))
android_library(
name = "all-libs",
exported_deps = lib_deps,
)
android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)
android_build_config(
name = "build_config",
package = "xyz.blueskyweb.pubsq",
)
android_resource(
name = "res",
package = "xyz.blueskyweb.pubsq",
res = "src/main/res",
)
android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
+65 -214
View File
@@ -1,128 +1,86 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node-modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node-modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and that value will be read here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for.
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
@@ -134,84 +92,13 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "xyz.blueskyweb.app"
defaultConfig {
applicationId "xyz.blueskyweb.pubsq"
applicationId "xyz.blueskyweb.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-21",
"APP_STL=c++_shared",
"NDK_TOOLCHAIN_VERSION=clang",
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "app_appmodules"
// Fix for windows limit on number of character in file paths and in command lines
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
arguments "NDK_APP_SHORT_COMMANDS=true"
}
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
abiFilters (*reactNativeArchitectures())
}
}
}
}
if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
path "$projectDir/src/main/jni/Android.mk"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
// If you wish to add a custom TurboModule or component locally,
// you should uncomment this line.
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureNdkBuild* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureNdkBuildRelease.dependsOn(preReleaseBuild)
configureNdkBuildDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
}
splits {
@@ -261,60 +148,24 @@ android {
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation project(':rn-fetch-blob')
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
}
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
-19
View File
@@ -1,19 +0,0 @@
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
@@ -25,13 +25,16 @@ import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
/**
* Class responsible of loading Flipper inside your React Native application. This is the debug
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
+9 -6
View File
@@ -1,7 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xyz.blueskyweb.pubsq">
package="xyz.blueskyweb.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".MainApplication"
@@ -15,7 +18,7 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:windowSoftInputMode="adjustPan"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -26,17 +29,17 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- debug host: https://pubsq.pfrazee.com -->
<!-- debug host: https://bsky.pfrazee.com -->
<data android:scheme="https" />
<data android:host="pubsq.pfrazee.com" />
<data android:host="bsky.pfrazee.com" />
</intent-filter>
<!-- deep linking via custom links -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- debug scheme: pubsq://app -->
<data android:scheme="pubsq" />
<!-- debug scheme: bsky://app -->
<data android:scheme="bsky" />
<data android:host="app" />
</intent-filter>
</activity>
@@ -1,28 +0,0 @@
package xyz.blueskyweb.pubsq;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;
import java.security.SecureRandom;
import android.util.Base64;
public class AppSecureRandomModule extends ReactContextBaseJavaModule {
public AppSecureRandomModule(ReactApplicationContext context) {
super(context);
}
@ReactMethod
public void generateSecureRandomAsBase64(int length, Promise promise) {
SecureRandom secureRandom = new SecureRandom();
byte[] buffer = new byte[length];
secureRandom.nextBytes(buffer);
promise.resolve(Base64.encodeToString(buffer, Base64.NO_WRAP));
}
@Override
public String getName() {
return "AppSecureRandomModule";
}
}
@@ -1,26 +0,0 @@
package xyz.blueskyweb.pubsq;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class AppSecureRandomPackage implements ReactPackage {
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new AppSecureRandomModule(reactContext));
return modules;
}
}
@@ -1,8 +1,9 @@
package xyz.blueskyweb.pubsq;
package xyz.blueskyweb.app;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;
import android.os.Bundle;
public class MainActivity extends ReactActivity {
@@ -13,34 +14,23 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "xyz.blueskyweb.pubsq";
return "xyz.blueskyweb.app";
}
/**
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
* you can specify the rendered you wish to use (Fabric or the older renderer).
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
* (aka React 18) with two boolean flags.
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
}
public static class MainActivityDelegate extends ReactActivityDelegate {
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
super(activity, mainComponentName);
}
@Override
protected ReactRootView createRootView() {
ReactRootView reactRootView = new ReactRootView(getContext());
return new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
);
}
}
@@ -1,22 +1,21 @@
package xyz.blueskyweb.pubsq;
package xyz.blueskyweb.app;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import xyz.blueskyweb.pubsq.newarchitecture.MainApplicationReactNativeHost;
import xyz.blueskyweb.app.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
@@ -28,7 +27,6 @@ public class MainApplication extends Application implements ReactApplication {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new AppSecureRandomPackage());
return packages;
}
@@ -36,18 +34,20 @@ public class MainApplication extends Application implements ReactApplication {
protected String getJSMainModuleName() {
return "index";
}
};
private final ReactNativeHost mNewArchitectureNativeHost =
new MainApplicationReactNativeHost(this);
@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
@Override
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
};
@Override
public ReactNativeHost getReactNativeHost() {
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
return mNewArchitectureNativeHost;
} else {
return mReactNativeHost;
}
return mReactNativeHost;
}
@Override
@@ -56,37 +56,10 @@ public class MainApplication extends Application implements ReactApplication {
// If you opted-in for the New Architecture, we enable the TurboModule system
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.app.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
}
@@ -1,116 +0,0 @@
package xyz.blueskyweb.pubsq.newarchitecture;
import android.app.Application;
import androidx.annotation.NonNull;
import com.facebook.react.PackageList;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.react.bridge.JSIModuleProvider;
import com.facebook.react.bridge.JSIModuleSpec;
import com.facebook.react.bridge.JSIModuleType;
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.EmptyReactNativeConfig;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.uimanager.ViewManagerRegistry;
import xyz.blueskyweb.pubsq.BuildConfig;
import xyz.blueskyweb.pubsq.newarchitecture.components.MainComponentsRegistry;
import xyz.blueskyweb.pubsq.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import java.util.ArrayList;
import java.util.List;
/**
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
* TurboModule delegates and the Fabric Renderer.
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationReactNativeHost extends ReactNativeHost {
public MainApplicationReactNativeHost(Application application) {
super(application);
}
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
// packages.add(new TurboReactPackage() { ... });
// If you have custom Fabric Components, their ViewManagers should also be loaded here
// inside a ReactPackage.
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@NonNull
@Override
protected ReactPackageTurboModuleManagerDelegate.Builder
getReactPackageTurboModuleManagerDelegateBuilder() {
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
// for the new architecture and to use TurboModules correctly.
return new MainApplicationTurboModuleManagerDelegate.Builder();
}
@Override
protected JSIModulePackage getJSIModulePackage() {
return new JSIModulePackage() {
@Override
public List<JSIModuleSpec> getJSIModules(
final ReactApplicationContext reactApplicationContext,
final JavaScriptContextHolder jsContext) {
final List<JSIModuleSpec> specs = new ArrayList<>();
// Here we provide a new JSIModuleSpec that will be responsible of providing the
// custom Fabric Components.
specs.add(
new JSIModuleSpec() {
@Override
public JSIModuleType getJSIModuleType() {
return JSIModuleType.UIManager;
}
@Override
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
final ComponentFactory componentFactory = new ComponentFactory();
CoreComponentsRegistry.register(componentFactory);
// Here we register a Components Registry.
// The one that is generated with the template contains no components
// and just provides you the one from React Native core.
MainComponentsRegistry.register(componentFactory);
final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
ViewManagerRegistry viewManagerRegistry =
new ViewManagerRegistry(
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
new EmptyReactNativeConfig(),
viewManagerRegistry);
}
});
return specs;
}
};
}
}
@@ -1,36 +0,0 @@
package xyz.blueskyweb.pubsq.newarchitecture.components;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.soloader.SoLoader;
/**
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
@DoNotStrip
public class MainComponentsRegistry {
static {
SoLoader.loadLibrary("fabricjni");
}
@DoNotStrip private final HybridData mHybridData;
@DoNotStrip
private native HybridData initHybrid(ComponentFactory componentFactory);
@DoNotStrip
private MainComponentsRegistry(ComponentFactory componentFactory) {
mHybridData = initHybrid(componentFactory);
}
@DoNotStrip
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
return new MainComponentsRegistry(componentFactory);
}
}
@@ -1,48 +0,0 @@
package xyz.blueskyweb.pubsq.newarchitecture.modules;
import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.soloader.SoLoader;
import java.util.List;
/**
* Class responsible to load the TurboModules. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationTurboModuleManagerDelegate
extends ReactPackageTurboModuleManagerDelegate {
private static volatile boolean sIsSoLibraryLoaded;
protected MainApplicationTurboModuleManagerDelegate(
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
super(reactApplicationContext, packages);
}
protected native HybridData initHybrid();
native boolean canCreateTurboModule(String moduleName);
public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
protected MainApplicationTurboModuleManagerDelegate build(
ReactApplicationContext context, List<ReactPackage> packages) {
return new MainApplicationTurboModuleManagerDelegate(context, packages);
}
}
@Override
protected synchronized void maybeLoadOtherSoLibraries() {
if (!sIsSoLibraryLoaded) {
// If you change the name of your application .so file in the Android.mk file,
// make sure you update the name here as well.
SoLoader.loadLibrary("app_appmodules");
sIsSoLibraryLoaded = true;
}
}
}
@@ -1,24 +0,0 @@
#include "MainApplicationModuleProvider.h"
#include <rncore.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string moduleName,
const JavaTurboModule::InitParams &params) {
// Here you can provide your own module provider for TurboModules coming from
// either your application or from external libraries. The approach to follow
// is similar to the following (for a library called `samplelibrary`:
//
// auto module = samplelibrary_ModuleProvider(moduleName, params);
// if (module != nullptr) {
// return module;
// }
// return rncore_ModuleProvider(moduleName, params);
return rncore_ModuleProvider(moduleName, params);
}
} // namespace react
} // namespace facebook
@@ -1,16 +0,0 @@
#pragma once
#include <memory>
#include <string>
#include <ReactCommon/JavaTurboModule.h>
namespace facebook {
namespace react {
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string moduleName,
const JavaTurboModule::InitParams &params);
} // namespace react
} // namespace facebook
@@ -1,45 +0,0 @@
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainApplicationModuleProvider.h"
namespace facebook {
namespace react {
jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
MainApplicationTurboModuleManagerDelegate::initHybrid(
jni::alias_ref<jhybridobject>) {
return makeCxxInstance();
}
void MainApplicationTurboModuleManagerDelegate::registerNatives() {
registerHybrid({
makeNativeMethod(
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
makeNativeMethod(
"canCreateTurboModule",
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
});
}
std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string name,
const std::shared_ptr<CallInvoker> jsInvoker) {
// Not implemented yet: provide pure-C++ NativeModules here.
return nullptr;
}
std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string name,
const JavaTurboModule::InitParams &params) {
return MainApplicationModuleProvider(name, params);
}
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
std::string name) {
return getTurboModule(name, nullptr) != nullptr ||
getTurboModule(name, {.moduleName = name}) != nullptr;
}
} // namespace react
} // namespace facebook
@@ -1,38 +0,0 @@
#include <memory>
#include <string>
#include <ReactCommon/TurboModuleManagerDelegate.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
class MainApplicationTurboModuleManagerDelegate
: public jni::HybridClass<
MainApplicationTurboModuleManagerDelegate,
TurboModuleManagerDelegate> {
public:
// Adapt it to the package you used for your Java class.
static constexpr auto kJavaDescriptor =
"Lcom/app/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);
static void registerNatives();
std::shared_ptr<TurboModule> getTurboModule(
const std::string name,
const std::shared_ptr<CallInvoker> jsInvoker) override;
std::shared_ptr<TurboModule> getTurboModule(
const std::string name,
const JavaTurboModule::InitParams &params) override;
/**
* Test-only method. Allows user to verify whether a TurboModule can be
* created by instances of this class.
*/
bool canCreateTurboModule(std::string name);
};
} // namespace react
} // namespace facebook
@@ -1,61 +0,0 @@
#include "MainComponentsRegistry.h"
#include <CoreComponentsRegistry.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/rncore/ComponentDescriptors.h>
namespace facebook {
namespace react {
MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
std::shared_ptr<ComponentDescriptorProviderRegistry const>
MainComponentsRegistry::sharedProviderRegistry() {
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
// Custom Fabric Components go here. You can register custom
// components coming from your App or from 3rd party libraries here.
//
// providerRegistry->add(concreteComponentDescriptorProvider<
// AocViewerComponentDescriptor>());
return providerRegistry;
}
jni::local_ref<MainComponentsRegistry::jhybriddata>
MainComponentsRegistry::initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate) {
auto instance = makeCxxInstance(delegate);
auto buildRegistryFunction =
[](EventDispatcher::Weak const &eventDispatcher,
ContextContainer::Shared const &contextContainer)
-> ComponentDescriptorRegistry::Shared {
auto registry = MainComponentsRegistry::sharedProviderRegistry()
->createComponentDescriptorRegistry(
{eventDispatcher, contextContainer});
auto mutableRegistry =
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);
mutableRegistry->setFallbackComponentDescriptor(
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
ComponentDescriptorParameters{
eventDispatcher, contextContainer, nullptr}));
return registry;
};
delegate->buildRegistryFunction = buildRegistryFunction;
return instance;
}
void MainComponentsRegistry::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
});
}
} // namespace react
} // namespace facebook
@@ -1,32 +0,0 @@
#pragma once
#include <ComponentFactory.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
namespace facebook {
namespace react {
class MainComponentsRegistry
: public facebook::jni::HybridClass<MainComponentsRegistry> {
public:
// Adapt it to the package you used for your Java class.
constexpr static auto kJavaDescriptor =
"Lcom/app/newarchitecture/components/MainComponentsRegistry;";
static void registerNatives();
MainComponentsRegistry(ComponentFactory *delegate);
private:
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
sharedProviderRegistry();
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate);
};
} // namespace react
} // namespace facebook
-11
View File
@@ -1,11 +0,0 @@
#include <fbjni/fbjni.h>
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainComponentsRegistry.h"
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
facebook::react::MainApplicationTurboModuleManagerDelegate::
registerNatives();
facebook::react::MainComponentsRegistry::registerNatives();
});
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

+1 -1
View File
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">pubsq</string>
<string name="app_name">bsky</string>
</resources>
@@ -0,0 +1,18 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package xyz.blueskyweb.app;
import android.content.Context;
import com.facebook.react.ReactInstanceManager;
/**
* Class responsible of loading Flipper inside your React Native application. This is the release
* flavor of it so it's empty as we don't want to load Flipper.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// Do nothing as we don't want to initialize Flipper on Release.
}
}
+6 -36
View File
@@ -4,50 +4,20 @@ import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
ext {
buildToolsVersion = "31.0.0"
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.2.1')
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
+4
View File
@@ -38,3 +38,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+2 -5
View File
@@ -2,8 +2,5 @@ rootProject.name = 'app'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
}
include ':rn-fetch-blob'
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android')
+1 -1
View File
@@ -4,7 +4,7 @@ module.exports = {
[
'module:react-native-dotenv',
{
// envName: 'APP_ENV',
envName: 'APP_ENV',
moduleName: '@env',
path: '.env',
blocklist: null,
View File
+10
View File
@@ -0,0 +1,10 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
-5
View File
@@ -1,5 +0,0 @@
#import <React/RCTBridgeModule.h>
@interface AppSecureRandomModule : NSObject <RCTBridgeModule>
@end
-27
View File
@@ -1,27 +0,0 @@
#import "AppSecureRandomModule.h"
@implementation AppSecureRandomModule
RCT_EXPORT_MODULE();
+ (BOOL)requiresMainQueueSetup
{
return NO;
}
RCT_REMAP_METHOD(generateSecureRandomAsBase64,
withLength:(int)length
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
NSMutableData* bytes = [NSMutableData dataWithLength:length];
int result = SecRandomCopyBytes(kSecRandomDefault,length, [bytes mutableBytes]);
if (result == errSecSuccess) {
resolve([bytes base64EncodedStringWithOptions:0]);
} else {
NSError *error = [NSError errorWithDomain:@"RNSecureRandom" code:result userInfo: nil];
reject(@"randombytes_error", @"Error generating random bytes", error);
}
}
@end
+43
View File
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" image="LaunchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="Ppr-Vi-7AA">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Ppr-Vi-7AA" secondAttribute="trailing" id="8NR-sO-ZhN"/>
<constraint firstItem="Ppr-Vi-7AA" firstAttribute="top" secondItem="5EZ-qb-Rvc" secondAttribute="top" id="Od5-pK-zM2"/>
<constraint firstItem="Ppr-Vi-7AA" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" id="Ww6-nx-IYo"/>
<constraint firstAttribute="bottom" secondItem="Ppr-Vi-7AA" secondAttribute="bottom" id="vTP-N3-Ihm"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="119.84732824427481" y="4.9295774647887329"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreen" width="600" height="900"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
+24 -10
View File
@@ -1,8 +1,16 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
platform :ios, min_ios_version_supported
prepare_react_native_project!
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'app' do
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
@@ -13,9 +21,16 @@ target 'app' do
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
@@ -25,14 +40,13 @@ target 'app' do
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#use_flipper!()
post_install do |installer|
react_native_post_install(installer)
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# iOS fix
+475 -315
View File
@@ -1,303 +1,374 @@
PODS:
- boost (1.76.0)
- BVLinearGradient (2.6.2):
- React-Core
- DoubleConversion (1.1.6)
- FBLazyVector (0.68.2)
- FBReactNativeSpec (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.68.2)
- RCTTypeSafety (= 0.68.2)
- React-Core (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- FBLazyVector (0.71.0)
- FBReactNativeSpec (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTRequired (= 0.71.0)
- RCTTypeSafety (= 0.71.0)
- React-Core (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- fmt (6.2.1)
- glog (0.3.5)
- RCT-Folly (2021.06.28.00-v2):
- hermes-engine (0.71.0):
- hermes-engine/Pre-built (= 0.71.0)
- hermes-engine/Pre-built (0.71.0)
- libevent (2.1.12)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Default (= 2021.06.28.00-v2)
- RCT-Folly/Default (2021.06.28.00-v2):
- RCT-Folly/Default (= 2021.07.22.00)
- RCT-Folly/Default (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCTRequired (0.68.2)
- RCTTypeSafety (0.68.2):
- FBLazyVector (= 0.68.2)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.68.2)
- React-Core (= 0.68.2)
- React (0.68.2):
- React-Core (= 0.68.2)
- React-Core/DevSupport (= 0.68.2)
- React-Core/RCTWebSocket (= 0.68.2)
- React-RCTActionSheet (= 0.68.2)
- React-RCTAnimation (= 0.68.2)
- React-RCTBlob (= 0.68.2)
- React-RCTImage (= 0.68.2)
- React-RCTLinking (= 0.68.2)
- React-RCTNetwork (= 0.68.2)
- React-RCTSettings (= 0.68.2)
- React-RCTText (= 0.68.2)
- React-RCTVibration (= 0.68.2)
- React-callinvoker (0.68.2)
- React-Codegen (0.68.2):
- FBReactNativeSpec (= 0.68.2)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.68.2)
- RCTTypeSafety (= 0.68.2)
- React-Core (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-Core (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.68.2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/CoreModulesHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/Default (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/DevSupport (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.68.2)
- React-Core/RCTWebSocket (= 0.68.2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-jsinspector (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTActionSheetHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTAnimationHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTBlobHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTImageHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTLinkingHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTNetworkHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTSettingsHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTTextHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTVibrationHeaders (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-Core/RCTWebSocket (0.68.2):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.68.2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsiexecutor (= 0.68.2)
- React-perflogger (= 0.68.2)
- Yoga
- React-CoreModules (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.68.2)
- React-Codegen (= 0.68.2)
- React-Core/CoreModulesHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- React-RCTImage (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-cxxreact (0.68.2):
- boost (= 1.76.0)
- RCT-Folly/Futures (2021.07.22.00):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-callinvoker (= 0.68.2)
- React-jsi (= 0.68.2)
- React-jsinspector (= 0.68.2)
- React-logger (= 0.68.2)
- React-perflogger (= 0.68.2)
- React-runtimeexecutor (= 0.68.2)
- React-jsi (0.68.2):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsi/Default (= 0.68.2)
- React-jsi/Default (0.68.2):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsiexecutor (0.68.2):
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-perflogger (= 0.68.2)
- React-jsinspector (0.68.2)
- React-logger (0.68.2):
- glog
- react-native-safe-area-context (4.3.1):
- libevent
- RCTRequired (0.71.0)
- RCTTypeSafety (0.71.0):
- FBLazyVector (= 0.71.0)
- RCTRequired (= 0.71.0)
- React-Core (= 0.71.0)
- React (0.71.0):
- React-Core (= 0.71.0)
- React-Core/DevSupport (= 0.71.0)
- React-Core/RCTWebSocket (= 0.71.0)
- React-RCTActionSheet (= 0.71.0)
- React-RCTAnimation (= 0.71.0)
- React-RCTBlob (= 0.71.0)
- React-RCTImage (= 0.71.0)
- React-RCTLinking (= 0.71.0)
- React-RCTNetwork (= 0.71.0)
- React-RCTSettings (= 0.71.0)
- React-RCTText (= 0.71.0)
- React-RCTVibration (= 0.71.0)
- React-callinvoker (0.71.0)
- React-Codegen (0.71.0):
- FBReactNativeSpec
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React
- React-Core
- React-jsi
- React-jsiexecutor
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- React-perflogger (0.68.2)
- React-RCTActionSheet (0.68.2):
- React-Core/RCTActionSheetHeaders (= 0.68.2)
- React-RCTAnimation (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.68.2)
- React-Codegen (= 0.68.2)
- React-Core/RCTAnimationHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTBlob (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- React-Codegen (= 0.68.2)
- React-Core/RCTBlobHeaders (= 0.68.2)
- React-Core/RCTWebSocket (= 0.68.2)
- React-jsi (= 0.68.2)
- React-RCTNetwork (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTImage (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.68.2)
- React-Codegen (= 0.68.2)
- React-Core/RCTImageHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- React-RCTNetwork (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTLinking (0.68.2):
- React-Codegen (= 0.68.2)
- React-Core/RCTLinkingHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTNetwork (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.68.2)
- React-Codegen (= 0.68.2)
- React-Core/RCTNetworkHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTSettings (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.68.2)
- React-Codegen (= 0.68.2)
- React-Core/RCTSettingsHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-RCTText (0.68.2):
- React-Core/RCTTextHeaders (= 0.68.2)
- React-RCTVibration (0.68.2):
- RCT-Folly (= 2021.06.28.00-v2)
- React-Codegen (= 0.68.2)
- React-Core/RCTVibrationHeaders (= 0.68.2)
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (= 0.68.2)
- React-runtimeexecutor (0.68.2):
- React-jsi (= 0.68.2)
- ReactCommon/turbomodule/core (0.68.2):
- React-Core (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.0)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/CoreModulesHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/Default (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/DevSupport (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.0)
- React-Core/RCTWebSocket (= 0.71.0)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-jsinspector (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTActionSheetHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTAnimationHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTBlobHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTImageHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTLinkingHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTNetworkHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTSettingsHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTTextHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTVibrationHeaders (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-Core/RCTWebSocket (0.71.0):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.0)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-perflogger (= 0.71.0)
- Yoga
- React-CoreModules (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.0)
- React-Codegen (= 0.71.0)
- React-Core/CoreModulesHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- React-RCTImage (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-cxxreact (0.71.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-callinvoker (= 0.68.2)
- React-Core (= 0.68.2)
- React-cxxreact (= 0.68.2)
- React-jsi (= 0.68.2)
- React-logger (= 0.68.2)
- React-perflogger (= 0.68.2)
- RNCAsyncStorage (1.17.6):
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.0)
- React-jsi (= 0.71.0)
- React-jsinspector (= 0.71.0)
- React-logger (= 0.71.0)
- React-perflogger (= 0.71.0)
- React-runtimeexecutor (= 0.71.0)
- React-hermes (0.71.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- RCT-Folly/Futures (= 2021.07.22.00)
- React-cxxreact (= 0.71.0)
- React-jsiexecutor (= 0.71.0)
- React-jsinspector (= 0.71.0)
- React-perflogger (= 0.71.0)
- React-jsi (0.71.0):
- boost (= 1.76.0)
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.07.22.00)
- React-jsiexecutor (0.71.0):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-perflogger (= 0.71.0)
- React-jsinspector (0.71.0)
- React-logger (0.71.0):
- glog
- react-native-blur (4.3.0):
- React-Core
- RNCClipboard (1.10.0):
- react-native-cameraroll (5.2.2):
- React-Core
- RNGestureHandler (2.5.0):
- react-native-image-resizer (3.0.4):
- React-Core
- RNInAppBrowser (3.6.3):
- react-native-pager-view (6.1.2):
- React-Core
- RNReanimated (2.9.1):
- react-native-paste-input (0.6.0):
- React-Core
- Swime (= 3.0.6)
- react-native-safe-area-context (4.4.1):
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- ReactCommon/turbomodule/core
- react-native-splash-screen (3.3.0):
- React-Core
- react-native-version-number (0.3.6):
- React
- React-perflogger (0.71.0)
- React-RCTActionSheet (0.71.0):
- React-Core/RCTActionSheetHeaders (= 0.71.0)
- React-RCTAnimation (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.0)
- React-Codegen (= 0.71.0)
- React-Core/RCTAnimationHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTAppDelegate (0.71.0):
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- ReactCommon/turbomodule/core
- React-RCTBlob (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.0)
- React-Core/RCTBlobHeaders (= 0.71.0)
- React-Core/RCTWebSocket (= 0.71.0)
- React-jsi (= 0.71.0)
- React-RCTNetwork (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTImage (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.0)
- React-Codegen (= 0.71.0)
- React-Core/RCTImageHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- React-RCTNetwork (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTLinking (0.71.0):
- React-Codegen (= 0.71.0)
- React-Core/RCTLinkingHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTNetwork (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.0)
- React-Codegen (= 0.71.0)
- React-Core/RCTNetworkHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTSettings (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.0)
- React-Codegen (= 0.71.0)
- React-Core/RCTSettingsHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-RCTText (0.71.0):
- React-Core/RCTTextHeaders (= 0.71.0)
- React-RCTVibration (0.71.0):
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.0)
- React-Core/RCTVibrationHeaders (= 0.71.0)
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/core (= 0.71.0)
- React-runtimeexecutor (0.71.0):
- React-jsi (= 0.71.0)
- ReactCommon/turbomodule/bridging (0.71.0):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.0)
- React-Core (= 0.71.0)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-logger (= 0.71.0)
- React-perflogger (= 0.71.0)
- ReactCommon/turbomodule/core (0.71.0):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.0)
- React-Core (= 0.71.0)
- React-cxxreact (= 0.71.0)
- React-jsi (= 0.71.0)
- React-logger (= 0.71.0)
- React-perflogger (= 0.71.0)
- rn-fetch-blob (0.12.0):
- React-Core
- RNBackgroundFetch (4.1.8):
- React-Core
- RNCAsyncStorage (1.17.11):
- React-Core
- RNCClipboard (1.11.1):
- React-Core
- RNFS (2.20.0):
- React-Core
- RNGestureHandler (2.8.0):
- React-Core
- RNImageCropPicker (0.38.1):
- React-Core
- React-RCTImage
- RNImageCropPicker/QBImagePickerController (= 0.38.1)
- TOCropViewController
- RNImageCropPicker/QBImagePickerController (0.38.1):
- React-Core
- React-RCTImage
- TOCropViewController
- RNInAppBrowser (3.7.0):
- React-Core
- RNNotifee (7.4.0):
- React-Core
- RNNotifee/NotifeeCore (= 7.4.0)
- RNNotifee/NotifeeCore (7.4.0):
- React-Core
- RNReactNativeHapticFeedback (1.14.0):
- React-Core
- RNReanimated (2.13.0):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
@@ -324,19 +395,29 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.13.1):
- RNScreens (3.18.2):
- React-Core
- React-RCTImage
- RNSVG (12.4.0):
- RNSVG (12.5.0):
- React-Core
- segment-analytics-react-native (2.10.1):
- React-Core
- sovran-react-native
- sovran-react-native (0.4.5):
- React-Core
- Swime (3.0.6)
- TOCropViewController (2.6.1)
- Yoga (1.14.0)
DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- BVLinearGradient (from `../node_modules/react-native-linear-gradient`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
@@ -344,18 +425,26 @@ DEPENDENCIES:
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
- React-Codegen (from `build/generated/ios`)
- React-Core (from `../node_modules/react-native/`)
- React-Core/DevSupport (from `../node_modules/react-native/`)
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- "react-native-blur (from `../node_modules/@react-native-community/blur`)"
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- "react-native-image-resizer (from `../node_modules/@bam.tech/react-native-image-resizer`)"
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
- "react-native-paste-input (from `../node_modules/@mattermost/react-native-paste-input`)"
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- react-native-version-number (from `../node_modules/react-native-version-number`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
- React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
- React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
@@ -365,22 +454,35 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
- RNBackgroundFetch (from `../node_modules/react-native-background-fetch`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- RNFS (from `../node_modules/react-native-fs`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
- RNInAppBrowser (from `../node_modules/react-native-inappbrowser-reborn`)
- "RNNotifee (from `../node_modules/@notifee/react-native`)"
- RNReactNativeHapticFeedback (from `../node_modules/react-native-haptic-feedback`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
- "segment-analytics-react-native (from `../node_modules/@segment/analytics-react-native`)"
- "sovran-react-native (from `../node_modules/@segment/sovran-react-native`)"
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
trunk:
- fmt
- libevent
- Swime
- TOCropViewController
EXTERNAL SOURCES:
boost:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
BVLinearGradient:
:path: "../node_modules/react-native-linear-gradient"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
@@ -389,6 +491,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
hermes-engine:
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
@@ -407,6 +511,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/CoreModules"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-hermes:
:path: "../node_modules/react-native/ReactCommon/hermes"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
@@ -415,14 +521,30 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-blur:
:path: "../node_modules/@react-native-community/blur"
react-native-cameraroll:
:path: "../node_modules/@react-native-camera-roll/camera-roll"
react-native-image-resizer:
:path: "../node_modules/@bam.tech/react-native-image-resizer"
react-native-pager-view:
:path: "../node_modules/react-native-pager-view"
react-native-paste-input:
:path: "../node_modules/@mattermost/react-native-paste-input"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
react-native-version-number:
:path: "../node_modules/react-native-version-number"
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../node_modules/react-native/Libraries/NativeAnimation"
React-RCTAppDelegate:
:path: "../node_modules/react-native/Libraries/AppDelegate"
React-RCTBlob:
:path: "../node_modules/react-native/Libraries/Blob"
React-RCTImage:
@@ -441,65 +563,103 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
rn-fetch-blob:
:path: "../node_modules/rn-fetch-blob"
RNBackgroundFetch:
:path: "../node_modules/react-native-background-fetch"
RNCAsyncStorage:
:path: "../node_modules/@react-native-async-storage/async-storage"
RNCClipboard:
:path: "../node_modules/@react-native-clipboard/clipboard"
RNFS:
:path: "../node_modules/react-native-fs"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNImageCropPicker:
:path: "../node_modules/react-native-image-crop-picker"
RNInAppBrowser:
:path: "../node_modules/react-native-inappbrowser-reborn"
RNNotifee:
:path: "../node_modules/@notifee/react-native"
RNReactNativeHapticFeedback:
:path: "../node_modules/react-native-haptic-feedback"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
:path: "../node_modules/react-native-screens"
RNSVG:
:path: "../node_modules/react-native-svg"
segment-analytics-react-native:
:path: "../node_modules/@segment/analytics-react-native"
sovran-react-native:
:path: "../node_modules/@segment/sovran-react-native"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
BVLinearGradient: 34a999fda29036898a09c6a6b728b0b4189e1a44
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648
FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
FBLazyVector: 61839cba7a48c570b7ac3e1cd8a4d0948382202f
FBReactNativeSpec: 5a14398ccf5e27c1ca2d7109eb920594ce93c10d
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 476ee3e89abb49e07f822b48323c51c57124b572
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0
RCTTypeSafety: c43c072a4bd60feb49a9570b0517892b4305c45e
React: 176dd882de001854ced260fad41bb68a31aa4bd0
React-callinvoker: c2864d1818d6e64928d2faf774a3800dfc38fe1f
React-Codegen: 98b6f97f0a7abf7d67e4ce435c77c05b7a95cf05
React-Core: fdaa2916b1c893f39f02cff0476d1fb0cab1e352
React-CoreModules: fd8705b80699ec36c2cdd635c2ce9d874b9cfdfc
React-cxxreact: 1832d971f7b0cb2c7b943dc0ec962762c90c906e
React-jsi: 72af715135abe8c3f0dcf3b2548b71d048b69a7e
React-jsiexecutor: b7b553412f2ec768fe6c8f27cd6bafdb9d8719e6
React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8
React-logger: a0833912d93b36b791b7a521672d8ee89107aff1
react-native-safe-area-context: 6c12e3859b6f27b25de4fee8201cfb858432d8de
React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6
React-RCTActionSheet: 547fe42fdb4b6089598d79f8e1d855d7c23e2162
React-RCTAnimation: bc9440a1c37b06ae9ebbb532d244f607805c6034
React-RCTBlob: a1295c8e183756d7ef30ba6e8f8144dfe8a19215
React-RCTImage: a30d1ee09b1334067fbb6f30789aae2d7ac150c9
React-RCTLinking: ffc6d5b88d1cb9aca13c54c2ec6507fbf07f2ac4
React-RCTNetwork: f807a2facab6cf5cf36d592e634611de9cf12d81
React-RCTSettings: 861806819226ed8332e6a8f90df2951a34bb3e7f
React-RCTText: f3fb464cc41a50fc7a1aba4deeb76a9ad8282cb9
React-RCTVibration: 79040b92bfa9c3c2d2cb4f57e981164ec7ab9374
React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23
ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2
RNCAsyncStorage: 466b9df1a14bccda91da86e0b7d9a345d78e1673
RNCClipboard: f1736c75ab85b627a4d57587edb4b60999c4dd80
RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50
RNInAppBrowser: 3ff3a3b8f458aaf25aaee879d057352862edf357
RNReanimated: 5c8c17e26787fd8984cd5accdc70fef2ca70aafd
RNScreens: 40a2cb40a02a609938137a1e0acfbf8fc9eebf19
RNSVG: 3dd44d99d1c18e1342aee4bfa53ab3f6a8c4865f
Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
hermes-engine: f6e715aa6c8bd38de6c13bc85e07b0a337edaa89
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: dea3e4163184ea57c50288c15c32c1529265c58f
RCTTypeSafety: a0834ab89159a346731e8aae55ad6e2cce61c327
React: d877d055ff2137ca0325a4babdef3411e11f3cb7
React-callinvoker: 77bd2701eee3acac154b11ec219e68d5a1f780ad
React-Codegen: bccc516adc1551ccfe04b0de27e345d38829b204
React-Core: 4035f59e5bec8f3053583c6108d99c7516deb760
React-CoreModules: b6a1f76423fea57a03e0d7a2f79d3b55cf193f2c
React-cxxreact: fe5f6ec8ae875bebc71309d1e8ef89bb966d61a6
React-hermes: 3c8ea5e8f402db2a08b57051206d7f2ba9c75565
React-jsi: dbf0f82c93bfd828fa05c50f2ee74dc81f711050
React-jsiexecutor: 060dd495f1e2af3d87216f7ca8a94c55ec885b4f
React-jsinspector: 5061fcbec93fd672183dfb39cc2f65e55a0835db
React-logger: a6c0b3a807a8e81f6d7fea2e72660766f55daa50
react-native-blur: 50c9feabacbc5f49b61337ebc32192c6be7ec3c3
react-native-cameraroll: 71d68167beb6fc7216aa564abb6d86f1d666a2c6
react-native-image-resizer: 794abf75ec13ed1f0dbb1f134e27504ea65e9e66
react-native-pager-view: 54bed894cecebe28cede54c01038d9d1e122de43
react-native-paste-input: 5182843692fd2ec72be50f241a38a49796e225d7
react-native-safe-area-context: 99b24a0c5acd0d5dcac2b1a7f18c49ea317be99a
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-version-number: b415bbec6a13f2df62bf978e85bc0d699462f37f
React-perflogger: e5fc4149e9bbb972b8520277f3b23141faa47a36
React-RCTActionSheet: 991de88216bf03ab9bb1d213d73c62ecbe64ade7
React-RCTAnimation: b74e3d1bf5280891a573e447b487fa1db0713b5b
React-RCTAppDelegate: f52667f2dbc510f87b7988c5204e8764d50bf0c1
React-RCTBlob: 6762787c01d5d8d18efed03764b0d58d3b79595a
React-RCTImage: 9ed7eba8dd192a49def2cad2ecaedee7e7e315b4
React-RCTLinking: 0b58eed9af0645a161b80bf412b6b721e4585c66
React-RCTNetwork: dc075b0eea00d8a98c928f011d9bc2458acc7092
React-RCTSettings: 30fb3f498cfaf8a4bb47334ff9ffbe318ef78766
React-RCTText: a631564e84a227fe24bae7c04446f36faea7fcf5
React-RCTVibration: 55c91eccdbd435d7634efbe847086944389475b0
React-runtimeexecutor: ac80782d9d76ba2b0f709f4de0c427fe33c352dc
ReactCommon: 20e38a9be5fe1341b5e422220877cc94034776ba
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNBackgroundFetch: 8e16176ff415daac743a6eb57afc8e9e14dbe623
RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60
RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3
RNImageCropPicker: 648356d68fbf9911a1016b3e3723885d28373eda
RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364
RNNotifee: da8dcf09f079ea22f46e239d7c406e10d4525a5f
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: d8d9d3d3801bda5e35e85cdffc871577d044dc2e
RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d
RNSVG: 6adc5c52d2488a476248413064b7f2832e639057
segment-analytics-react-native: cb097e393c3560a0d4cfd877044293e37b0050d9
sovran-react-native: fd3dc8f1a4b14acdc4ad25fc6b4ac4f52a2a2a15
Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
Yoga: c618b544ff8bd8865cdca602f00cbcdb92fd6d31
PODFILE CHECKSUM: cf94853ebcb0d8e0d027dca9ab7a4ede886a8f20
PODFILE CHECKSUM: 0975a639c66f07f4d49706dd0bf7c3aa4dc833cf
COCOAPODS: 1.11.3
+113 -76
View File
@@ -11,11 +11,10 @@
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
5CEAE7B7A55582F96F1D5952 /* libPods-app.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB672808307A6013805A3FE /* libPods-app.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
E4BD704B285AD57E00A8FED9 /* AppSecureRandomModule.m in Sources */ = {isa = PBXBuildFile; fileRef = E4BD704A285AD57E00A8FED9 /* AppSecureRandomModule.m */; };
E4BD704C285AD57E00A8FED9 /* AppSecureRandomModule.m in Sources */ = {isa = PBXBuildFile; fileRef = E4BD704A285AD57E00A8FED9 /* AppSecureRandomModule.m */; };
FEB90D21557517F9279AECA4 /* libPods-app-appTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAD3BC60FA05CF2D4F6F9BA2 /* libPods-app-appTests.a */; };
5698CA584FD738B2091BD18F /* libPods-app-appTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C0C7BDE7769B84011D3747DC /* libPods-app-appTests.a */; };
67BF1AE6AABFC881715B2D6A /* libPods-app.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8789F612EDA2C48C6064ADD6 /* libPods-app.a */; };
E46FE2C12981C0DB007C107C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E46FE2C02981C0DB007C107C /* LaunchScreen.storyboard */; };
E4BBD590292C1F5200296224 /* app.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = E4437C9E28581FA7006DA9E7 /* app.entitlements */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -32,23 +31,21 @@
00E356EE1AD99517003FC87E /* appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = appTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* appTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = appTests.m; sourceTree = "<group>"; };
03F7088487057F17D25D2F4B /* Pods-app-appTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app-appTests.release.xcconfig"; path = "Target Support Files/Pods-app-appTests/Pods-app-appTests.release.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = app/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = app/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = app/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = app/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = app/main.m; sourceTree = "<group>"; };
19C43486502F2DE23E091FE3 /* Pods-app-appTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app-appTests.debug.xcconfig"; path = "Target Support Files/Pods-app-appTests/Pods-app-appTests.debug.xcconfig"; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = app/LaunchScreen.storyboard; sourceTree = "<group>"; };
970005155A83960D1D13380F /* Pods-app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.release.xcconfig"; path = "Target Support Files/Pods-app/Pods-app.release.xcconfig"; sourceTree = "<group>"; };
BAD3BC60FA05CF2D4F6F9BA2 /* libPods-app-appTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-app-appTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
53DBA218C184B95B107AC33E /* Pods-app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.release.xcconfig"; path = "Target Support Files/Pods-app/Pods-app.release.xcconfig"; sourceTree = "<group>"; };
8789F612EDA2C48C6064ADD6 /* libPods-app.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-app.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8BB4EDB104E125B8A1913E74 /* Pods-app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.debug.xcconfig"; path = "Target Support Files/Pods-app/Pods-app.debug.xcconfig"; sourceTree = "<group>"; };
A8E093A0B5DA947150924A68 /* Pods-app-appTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app-appTests.release.xcconfig"; path = "Target Support Files/Pods-app-appTests/Pods-app-appTests.release.xcconfig"; sourceTree = "<group>"; };
C01FB6762BC17DADC0319338 /* Pods-app-appTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app-appTests.debug.xcconfig"; path = "Target Support Files/Pods-app-appTests/Pods-app-appTests.debug.xcconfig"; sourceTree = "<group>"; };
C0C7BDE7769B84011D3747DC /* libPods-app-appTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-app-appTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
E4437C9E28581FA7006DA9E7 /* app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = app.entitlements; path = app/app.entitlements; sourceTree = "<group>"; };
E4BD7049285AD54000A8FED9 /* AppSecureRandomModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppSecureRandomModule.h; sourceTree = "<group>"; };
E4BD704A285AD57E00A8FED9 /* AppSecureRandomModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppSecureRandomModule.m; sourceTree = "<group>"; };
ED22CAA45207BC18E75DB44B /* Pods-app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-app.debug.xcconfig"; path = "Target Support Files/Pods-app/Pods-app.debug.xcconfig"; sourceTree = "<group>"; };
E46FE2C02981C0DB007C107C /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
FCB672808307A6013805A3FE /* libPods-app.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-app.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -56,7 +53,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FEB90D21557517F9279AECA4 /* libPods-app-appTests.a in Frameworks */,
5698CA584FD738B2091BD18F /* libPods-app-appTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -64,7 +61,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5CEAE7B7A55582F96F1D5952 /* libPods-app.a in Frameworks */,
67BF1AE6AABFC881715B2D6A /* libPods-app.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -96,10 +93,8 @@
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
E4BD7049285AD54000A8FED9 /* AppSecureRandomModule.h */,
E4BD704A285AD57E00A8FED9 /* AppSecureRandomModule.m */,
E46FE2C02981C0DB007C107C /* LaunchScreen.storyboard */,
);
name = app;
sourceTree = "<group>";
@@ -108,8 +103,8 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
FCB672808307A6013805A3FE /* libPods-app.a */,
BAD3BC60FA05CF2D4F6F9BA2 /* libPods-app-appTests.a */,
8789F612EDA2C48C6064ADD6 /* libPods-app.a */,
C0C7BDE7769B84011D3747DC /* libPods-app-appTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -148,10 +143,10 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
ED22CAA45207BC18E75DB44B /* Pods-app.debug.xcconfig */,
970005155A83960D1D13380F /* Pods-app.release.xcconfig */,
19C43486502F2DE23E091FE3 /* Pods-app-appTests.debug.xcconfig */,
03F7088487057F17D25D2F4B /* Pods-app-appTests.release.xcconfig */,
8BB4EDB104E125B8A1913E74 /* Pods-app.debug.xcconfig */,
53DBA218C184B95B107AC33E /* Pods-app.release.xcconfig */,
C01FB6762BC17DADC0319338 /* Pods-app-appTests.debug.xcconfig */,
A8E093A0B5DA947150924A68 /* Pods-app-appTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -163,11 +158,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "appTests" */;
buildPhases = (
F309585457BFF312EF73FD95 /* [CP] Check Pods Manifest.lock */,
A6849EFFDCB214D4F4EAE972 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
2772CBCCE24036517E86445D /* [CP] Copy Pods Resources */,
DFA0C2B14E2F369C4B2337CE /* [CP] Copy Pods Resources */,
B73FFC16945F7B215A06B698 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -183,13 +179,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "app" */;
buildPhases = (
4D45C29570A58E7A8A8D177D /* [CP] Check Pods Manifest.lock */,
DDF15D430A078CE70E577FDA /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
9CEFF2A5EA3D60C120442CA6 /* [CP] Copy Pods Resources */,
45E56D79C207C80AF89FBAA2 /* [CP] Copy Pods Resources */,
B0229D18A3C8908C642F9131 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -248,7 +245,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
E46FE2C12981C0DB007C107C /* LaunchScreen.storyboard in Resources */,
E4BBD590292C1F5200296224 /* app.entitlements in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -262,32 +260,90 @@
files = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
2772CBCCE24036517E86445D /* [CP] Copy Pods Resources */ = {
45E56D79C207C80AF89FBAA2 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources.sh\"\n";
showEnvVarsInLog = 0;
};
4D45C29570A58E7A8A8D177D /* [CP] Check Pods Manifest.lock */ = {
A6849EFFDCB214D4F4EAE972 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-app-appTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B0229D18A3C8908C642F9131 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B73FFC16945F7B215A06B698 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DDF15D430A078CE70E577FDA /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -309,43 +365,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9CEFF2A5EA3D60C120442CA6 /* [CP] Copy Pods Resources */ = {
DFA0C2B14E2F369C4B2337CE /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app/Pods-app-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F309585457BFF312EF73FD95 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-app-appTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-app-appTests/Pods-app-appTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
@@ -375,7 +409,6 @@
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* appTests.m in Sources */,
E4BD704C285AD57E00A8FED9 /* AppSecureRandomModule.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -384,7 +417,6 @@
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
E4BD704B285AD57E00A8FED9 /* AppSecureRandomModule.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -402,7 +434,7 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19C43486502F2DE23E091FE3 /* Pods-app-appTests.debug.xcconfig */;
baseConfigurationReference = C01FB6762BC17DADC0319338 /* Pods-app-appTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
@@ -430,7 +462,7 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 03F7088487057F17D25D2F4B /* Pods-app-appTests.release.xcconfig */;
baseConfigurationReference = A8E093A0B5DA947150924A68 /* Pods-app-appTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
@@ -455,16 +487,17 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = ED22CAA45207BC18E75DB44B /* Pods-app.debug.xcconfig */;
baseConfigurationReference = 8BB4EDB104E125B8A1913E74 /* Pods-app.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = app/app.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = A6GRZHF6BV;
DEVELOPMENT_TEAM = B3LX46C5HS;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = app/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -474,7 +507,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = xyz.blueskyweb.pubsq;
PRODUCT_BUNDLE_IDENTIFIER = xyz.blueskyweb.app;
PRODUCT_NAME = app;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -484,25 +517,27 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 970005155A83960D1D13380F /* Pods-app.release.xcconfig */;
baseConfigurationReference = 53DBA218C184B95B107AC33E /* Pods-app.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = app/app.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = A6GRZHF6BV;
DEVELOPMENT_TEAM = B3LX46C5HS;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = app/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = xyz.blueskyweb.pubsq;
PRODUCT_BUNDLE_IDENTIFIER = xyz.blueskyweb.app;
PRODUCT_NAME = app;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -542,7 +577,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -558,7 +593,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -576,6 +611,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
name = Debug;
@@ -613,7 +649,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -622,7 +658,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -639,6 +675,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
+2 -4
View File
@@ -1,8 +1,6 @@
#import <React/RCTBridgeDelegate.h>
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
@interface AppDelegate : RCTAppDelegate
@end
+17 -82
View File
@@ -1,63 +1,27 @@
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTAppSetupUtils.h>
// universal links
#import <React/RCTLinkingManager.h>
#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>
// splash screen
#import "RNSplashScreen.h"
#import <react/config/ReactNativeConfig.h>
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@end
#endif
#import <TSBackgroundFetch/TSBackgroundFetch.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTAppSetupPrepareApp(application);
// Show the splash screen
// [RNSplashScreen show];
// Register BackgroundFetch
[[TSBackgroundFetch sharedInstance] didFinishLaunching];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"xyz.blueskyweb.pubsq", nil);
if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
self.moduleName = @"xyz.blueskyweb.app";
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
@@ -69,45 +33,16 @@
#endif
}
#if RCT_NEW_ARCH_ENABLED
#pragma mark - RCTCxxBridgeDelegate
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
return true;
}
#pragma mark RCTTurboModuleManagerDelegate
- (Class)getModuleClassFromName:(const char *)name
{
return RCTCoreModulesClassProvider(name);
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
return nullptr;
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass);
}
#endif
// universal links
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Some files were not shown because too many files have changed in this diff Show More