mirror of
https://github.com/tooot-app/app
synced 2025-01-30 10:14:53 +01:00
commit
fbddcd2940
@ -188,6 +188,10 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0") {
|
||||
force = true
|
||||
}
|
||||
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
//noinspection GradleDynamicVersion
|
||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||
|
@ -2,11 +2,12 @@
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
buildToolsVersion = "29.0.3"
|
||||
buildToolsVersion = "30.0.2"
|
||||
minSdkVersion = 21
|
||||
compileSdkVersion = 30
|
||||
targetSdkVersion = 30
|
||||
ndkVersion = "20.1.5948944"
|
||||
ndkVersion = "21.4.7075529"
|
||||
kotlinVersion = '1.5.32'
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
@ -15,7 +16,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
classpath("com.android.tools.build:gradle:4.1.0")
|
||||
classpath("com.android.tools.build:gradle:4.2.0")
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
141
ios/Podfile.lock
141
ios/Podfile.lock
@ -5,75 +5,76 @@ PODS:
|
||||
- ExpoModulesCore
|
||||
- EXAV (10.1.3):
|
||||
- ExpoModulesCore
|
||||
- EXConstants (12.1.3):
|
||||
- EXConstants (13.0.0):
|
||||
- ExpoModulesCore
|
||||
- EXCrypto (10.0.3):
|
||||
- EXCrypto (10.1.1):
|
||||
- ExpoModulesCore
|
||||
- EXDevice (4.0.3):
|
||||
- EXDevice (4.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXErrorRecovery (3.0.3):
|
||||
- EXErrorRecovery (3.0.4):
|
||||
- ExpoModulesCore
|
||||
- EXFileSystem (13.0.3):
|
||||
- EXFileSystem (13.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXFirebaseAnalytics (5.0.3):
|
||||
- EXFirebaseAnalytics (6.0.0):
|
||||
- EXFirebaseCore
|
||||
- ExpoModulesCore
|
||||
- Firebase/Core (= 7.7.0)
|
||||
- EXFirebaseCore (4.0.3):
|
||||
- EXFirebaseCore (4.1.0):
|
||||
- ExpoModulesCore
|
||||
- Firebase/Core (= 7.7.0)
|
||||
- EXFont (10.0.3):
|
||||
- EXFont (10.0.4):
|
||||
- ExpoModulesCore
|
||||
- EXHaptics (11.0.3):
|
||||
- ExpoModulesCore
|
||||
- EXImageLoader (3.0.0):
|
||||
- EXImageLoader (3.1.0):
|
||||
- ExpoModulesCore
|
||||
- React-Core
|
||||
- EXImageManipulator (10.1.2):
|
||||
- EXImageManipulator (10.2.0):
|
||||
- EXImageLoader
|
||||
- ExpoModulesCore
|
||||
- EXImagePicker (11.0.3):
|
||||
- EXImagePicker (12.0.1):
|
||||
- ExpoModulesCore
|
||||
- EXJSONUtils (0.2.0)
|
||||
- EXKeepAwake (10.0.0):
|
||||
- ExpoModulesCore
|
||||
- EXLocalization (11.0.0):
|
||||
- EXKeepAwake (10.0.1):
|
||||
- ExpoModulesCore
|
||||
- EXManifests (0.2.2):
|
||||
- EXJSONUtils
|
||||
- EXMediaLibrary (13.0.3):
|
||||
- EXMediaLibrary (14.0.0):
|
||||
- ExpoModulesCore
|
||||
- React-Core
|
||||
- EXNotifications (0.13.3):
|
||||
- EXNotifications (0.14.0):
|
||||
- ExpoModulesCore
|
||||
- EXPermissions (13.0.3):
|
||||
- EXPermissions (13.1.0):
|
||||
- ExpoModulesCore
|
||||
- Expo (43.0.4):
|
||||
- Expo (44.0.0):
|
||||
- ExpoModulesCore
|
||||
- ExpoModulesCore (0.4.4):
|
||||
- ExpoHaptics (11.1.0):
|
||||
- ExpoModulesCore
|
||||
- ExpoLocalization (12.0.0):
|
||||
- ExpoModulesCore
|
||||
- ExpoModulesCore (0.6.3):
|
||||
- React-Core
|
||||
- EXRandom (12.0.1):
|
||||
- ReactCommon/turbomodule/core
|
||||
- EXRandom (12.1.1):
|
||||
- React-Core
|
||||
- EXScreenCapture (4.0.3):
|
||||
- EXScreenCapture (4.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXSecureStore (11.0.3):
|
||||
- EXSecureStore (11.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXSplashScreen (0.13.5):
|
||||
- EXSplashScreen (0.14.0):
|
||||
- ExpoModulesCore
|
||||
- React-Core
|
||||
- EXStoreReview (5.0.3):
|
||||
- EXStoreReview (5.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXStructuredHeaders (2.0.0)
|
||||
- EXUpdates (0.10.15):
|
||||
- EXStructuredHeaders (2.1.0)
|
||||
- EXUpdates (0.11.1):
|
||||
- EXManifests
|
||||
- ExpoModulesCore
|
||||
- EXStructuredHeaders
|
||||
- EXUpdatesInterface
|
||||
- React-Core
|
||||
- EXUpdatesInterface (0.4.0)
|
||||
- EXVideoThumbnails (6.0.3):
|
||||
- EXUpdatesInterface (0.5.0)
|
||||
- EXVideoThumbnails (6.1.0):
|
||||
- ExpoModulesCore
|
||||
- EXWebBrowser (10.0.3):
|
||||
- EXWebBrowser (10.1.0):
|
||||
- ExpoModulesCore
|
||||
- FBLazyVector (0.66.4)
|
||||
- FBReactNativeSpec (0.66.4):
|
||||
@ -461,7 +462,7 @@ PODS:
|
||||
- SDWebImageWebPCoder (~> 0.8.4)
|
||||
- RNGestureHandler (2.1.0):
|
||||
- React-Core
|
||||
- RNReanimated (2.3.0):
|
||||
- RNReanimated (2.3.1):
|
||||
- DoubleConversion
|
||||
- FBLazyVector
|
||||
- FBReactNativeSpec
|
||||
@ -506,7 +507,7 @@ PODS:
|
||||
- Sentry (7.5.1):
|
||||
- Sentry/Core (= 7.5.1)
|
||||
- Sentry/Core (7.5.1)
|
||||
- UMTaskManagerInterface (7.0.3):
|
||||
- UMTaskManagerInterface (7.1.0):
|
||||
- ExpoModulesCore
|
||||
- Yoga (1.14.0)
|
||||
|
||||
@ -523,18 +524,18 @@ DEPENDENCIES:
|
||||
- EXFirebaseAnalytics (from `../node_modules/expo-firebase-analytics/ios`)
|
||||
- EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`)
|
||||
- EXFont (from `../node_modules/expo-font/ios`)
|
||||
- EXHaptics (from `../node_modules/expo-haptics/ios`)
|
||||
- EXImageLoader (from `../node_modules/expo-image-loader/ios`)
|
||||
- EXImageManipulator (from `../node_modules/expo-image-manipulator/ios`)
|
||||
- EXImagePicker (from `../node_modules/expo-image-picker/ios`)
|
||||
- EXJSONUtils (from `../node_modules/expo-json-utils/ios`)
|
||||
- EXKeepAwake (from `../node_modules/expo-keep-awake/ios`)
|
||||
- EXLocalization (from `../node_modules/expo-localization/ios`)
|
||||
- EXManifests (from `../node_modules/expo-manifests/ios`)
|
||||
- EXMediaLibrary (from `../node_modules/expo-media-library/ios`)
|
||||
- EXNotifications (from `../node_modules/expo-notifications/ios`)
|
||||
- EXPermissions (from `../node_modules/expo-permissions/ios`)
|
||||
- Expo (from `../node_modules/expo/ios`)
|
||||
- ExpoHaptics (from `../node_modules/expo-haptics/ios`)
|
||||
- ExpoLocalization (from `../node_modules/expo-localization/ios`)
|
||||
- ExpoModulesCore (from `../node_modules/expo-modules-core/ios`)
|
||||
- EXRandom (from `../node_modules/expo-random/ios`)
|
||||
- EXScreenCapture (from `../node_modules/expo-screen-capture/ios`)
|
||||
@ -640,8 +641,6 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/expo-firebase-core/ios"
|
||||
EXFont:
|
||||
:path: "../node_modules/expo-font/ios"
|
||||
EXHaptics:
|
||||
:path: "../node_modules/expo-haptics/ios"
|
||||
EXImageLoader:
|
||||
:path: "../node_modules/expo-image-loader/ios"
|
||||
EXImageManipulator:
|
||||
@ -652,8 +651,6 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/expo-json-utils/ios"
|
||||
EXKeepAwake:
|
||||
:path: "../node_modules/expo-keep-awake/ios"
|
||||
EXLocalization:
|
||||
:path: "../node_modules/expo-localization/ios"
|
||||
EXManifests:
|
||||
:path: "../node_modules/expo-manifests/ios"
|
||||
EXMediaLibrary:
|
||||
@ -664,6 +661,10 @@ EXTERNAL SOURCES:
|
||||
:path: "../node_modules/expo-permissions/ios"
|
||||
Expo:
|
||||
:path: "../node_modules/expo/ios"
|
||||
ExpoHaptics:
|
||||
:path: "../node_modules/expo-haptics/ios"
|
||||
ExpoLocalization:
|
||||
:path: "../node_modules/expo-localization/ios"
|
||||
ExpoModulesCore:
|
||||
:path: "../node_modules/expo-modules-core/ios"
|
||||
EXRandom:
|
||||
@ -780,37 +781,37 @@ SPEC CHECKSUMS:
|
||||
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
|
||||
EXApplication: 0e15240e4d125b62f1cae48759ffbbd32b9286a6
|
||||
EXAV: 8adf9a1c0161144d77e96149a1e5a5f9358be290
|
||||
EXConstants: 6d585d93723b18d7a8c283591a335609e3bc153e
|
||||
EXCrypto: 7bcda085ffaccdaf3a252c20774a08be4277b8e3
|
||||
EXDevice: d19bbef7ab8ee4669ef1d6424c538f8d8fe7d6e9
|
||||
EXErrorRecovery: ac2622400a32be84604591f70d0efff416e4b9a2
|
||||
EXFileSystem: 99aac7962c11c680681819dd9cbca24e20e5b1e7
|
||||
EXFirebaseAnalytics: fd0c025fcf12e45904c2be40beab3f7147746a5b
|
||||
EXFirebaseCore: 2d0e5aac214f977dfbb72379509e6a11481b1400
|
||||
EXFont: 2e1c6fe726d008a039db80df95f48b4921b7fe59
|
||||
EXHaptics: f52df335f17192e440d9639c971ebcbb3fb91dec
|
||||
EXImageLoader: 939451be6f7b731aaa6588920b90743f20121a4d
|
||||
EXImageManipulator: 49bbcede2429523edfd95dc242cf7f8fdf271307
|
||||
EXImagePicker: bf704ef8e9171b05696a24114b44c6629565b45d
|
||||
EXConstants: 5d18484e38e8eacef7695a82214b6ac90133dedf
|
||||
EXCrypto: e3c0853c2a9ef885928f6227b967b9598132f727
|
||||
EXDevice: 7de98d8f97088fad9c01e9a68abad07e501208b2
|
||||
EXErrorRecovery: deea88a01d38f8b1c1181b4e1d179b0ba0e4bb5b
|
||||
EXFileSystem: 7d1309ba6b38b82ef7fc9e80174de3f9184ac8b4
|
||||
EXFirebaseAnalytics: 27dbc5cb83c244d8404b2927676299f3e172470e
|
||||
EXFirebaseCore: 16f39b0ea94ce985a8f2e16cc796bf79bdcfa297
|
||||
EXFont: 1fb13af43dc517c01c0ff21a6e32f9f9bf2ea602
|
||||
EXImageLoader: df83442d32bcfb57b7cfc5690096b6caf8203f8d
|
||||
EXImageManipulator: 810c7ea8d4cdcc52d07ad377a9b4ffeaee3d937f
|
||||
EXImagePicker: 91337b8d57a0a8f56800b9ac0f2b2f10aecf88ce
|
||||
EXJSONUtils: f515cf71710855d7ba5bfc6752af3b9a6f6aad01
|
||||
EXKeepAwake: 8aa32396a5972d26e75e538603aad0f032396503
|
||||
EXLocalization: bb38414618b30a177482c9a6f5594ec6eb0898c1
|
||||
EXKeepAwake: b571c2ad8323b2fced6e907766e2549f75119471
|
||||
EXManifests: 50e42e01335df4e54109dee7be5a91bfd37347db
|
||||
EXMediaLibrary: 2a684cca228d6605a72f9995d3e7b8af2a05246c
|
||||
EXNotifications: 4a2beb5a2a7292ba64165413811b7c495bcb1297
|
||||
EXPermissions: 7696f4c16e89981f84c04d96327f7e1e592373c0
|
||||
Expo: 363a3f3c60d5a1d4f8badb29a869005487f2d9e4
|
||||
ExpoModulesCore: 47b403a33ad73770c49d7559615b3ea121a36116
|
||||
EXRandom: 64c954ae24619b8d0c18ff46aa96401e98efc977
|
||||
EXScreenCapture: aa7292f963ccfde7aed4ba6bb6e822e95ef5153e
|
||||
EXSecureStore: 919bf7c28472862020d2cd7b59b69aae160b5d40
|
||||
EXSplashScreen: 57f329dbf25c5c12800feed79068a056453dc772
|
||||
EXStoreReview: ba32e9ebdab47176fe263db022982e4b8a580c28
|
||||
EXStructuredHeaders: 873e7f329c2f6279c1b1e0229df59c9861560b53
|
||||
EXUpdates: 061b67c33f0e7f8fd335bbb48697c4a4fc8a5157
|
||||
EXUpdatesInterface: e1c01b4f5ec76bd1d6cc714938f9edf5ef6379b9
|
||||
EXVideoThumbnails: 3bdcce697449df005fcc348153e2f854ed462984
|
||||
EXWebBrowser: ecb70d9e6edb279d9b10b2bbc9ad4320fcdc4060
|
||||
EXMediaLibrary: 6acf919299bccc64a59e6e89a3b792276e309302
|
||||
EXNotifications: d5b454a2363c8743aa9b2888cc0df70a1d9ee816
|
||||
EXPermissions: f4c65fa770489cbf16ea17c3013a670671525014
|
||||
Expo: 6ca1d5ca8c8264a7131a608afcd01561f79f1e6e
|
||||
ExpoHaptics: c62a5fc7bba0184d0165d559fc2b0fc46168ef40
|
||||
ExpoLocalization: 83582a967db52987a8479490b056d5eb9fd70552
|
||||
ExpoModulesCore: d04e519b3e8e21523b195bb21a40144e30f1e163
|
||||
EXRandom: 06978dcf45075f3c9e17ae5e726b887316ee9877
|
||||
EXScreenCapture: 0146fdf6ca4c3402a1cf62b2ddb739a840e08c94
|
||||
EXSecureStore: fa0fdde1c81ceee2a3cb0519e649feae42767969
|
||||
EXSplashScreen: 845290df0d2730fdedc59ee6ce3b959d8079a350
|
||||
EXStoreReview: 6143555fc912a4a194300992cd297c3e5b521a8a
|
||||
EXStructuredHeaders: 2ce79a3770bd3795bade1aab215ada70deae8bbc
|
||||
EXUpdates: a0ef6520618deee31b45d9a09406682c9e724789
|
||||
EXUpdatesInterface: f459b515151bd73fff7a35366eace34a6c6a0d3f
|
||||
EXVideoThumbnails: 6c08e978ed7a5542c5dca04a1757363fd29cb2a1
|
||||
EXWebBrowser: 37388663fa51cbfc883de2244931a5182d948e5f
|
||||
FBLazyVector: e5569e42a1c79ca00521846c223173a57aca1fe1
|
||||
FBReactNativeSpec: fe08c1cd7e2e205718d77ad14b34957cce949b58
|
||||
Firebase: cd2ab85eec8170dc260186159f21072ecb679ad5
|
||||
@ -863,14 +864,14 @@ SPEC CHECKSUMS:
|
||||
RNCAsyncStorage: ea6b5c280997b2b32a587793163b1f10e580c4f7
|
||||
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
|
||||
RNGestureHandler: e5c7cab5f214503dcefd6b2b0cefb050e1f51c4a
|
||||
RNReanimated: 569c269480a76e39196aa17a5df08ef1561db5ff
|
||||
RNReanimated: da3860204e5660c0dd66739936732197d359d753
|
||||
RNScreens: 522705f2e5c9d27efb17f24aceb2bf8335bc7b8e
|
||||
RNSentry: 97bc62fa65b7d663daee16fbf9771470852217cf
|
||||
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
|
||||
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
|
||||
SDWebImageWebPCoder: f93010f3f6c031e2f8fb3081ca4ee6966c539815
|
||||
Sentry: 0718c3ad7a08e1107599610795adaf08864102f3
|
||||
UMTaskManagerInterface: 5654c50e68af11b19b9d05452bacf23d19b3f30f
|
||||
UMTaskManagerInterface: 6f7150f9ec9bc6f2760eeae532a70de71ff951c1
|
||||
Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280
|
||||
|
||||
PODFILE CHECKSUM: 9bf9d386bac4ff98f76fc93f120c9922660384b5
|
||||
|
@ -1,3 +1,4 @@
|
||||
#import <Expo/Expo.h>
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
@ -51,17 +51,11 @@ static void InitializeFlipper(UIApplication *application) {
|
||||
InitializeFlipper(application);
|
||||
#endif
|
||||
|
||||
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"main" initialProperties:nil];
|
||||
id rootViewBackgroundColor = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTRootViewBackgroundColor"];
|
||||
if (rootViewBackgroundColor != nil) {
|
||||
rootView.backgroundColor = [RCTConvert UIColor:rootViewBackgroundColor];
|
||||
} else {
|
||||
rootView.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
|
||||
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];
|
||||
RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:nil];
|
||||
rootView.backgroundColor = [UIColor whiteColor];
|
||||
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
UIViewController *rootViewController = [UIViewController new];
|
||||
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
|
||||
rootViewController.view = rootView;
|
||||
self.window.rootViewController = rootViewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
56
package.json
56
package.json
@ -35,35 +35,35 @@
|
||||
"@react-navigation/native": "6.0.6",
|
||||
"@react-navigation/native-stack": "6.2.5",
|
||||
"@react-navigation/stack": "6.0.11",
|
||||
"@reduxjs/toolkit": "1.7.0",
|
||||
"@reduxjs/toolkit": "1.7.1",
|
||||
"@sentry/react-native": "3.2.3",
|
||||
"@sharcoux/slider": "5.6.1",
|
||||
"axios": "0.24.0",
|
||||
"expo": "43.0.4",
|
||||
"expo-auth-session": "3.4.2",
|
||||
"expo": "44.0.0",
|
||||
"expo-auth-session": "3.5.0",
|
||||
"expo-av": "10.1.3",
|
||||
"expo-constants": "^12.1.3",
|
||||
"expo-crypto": "10.0.3",
|
||||
"expo-device": "4.0.3",
|
||||
"expo-file-system": "^13.0.3",
|
||||
"expo-firebase-analytics": "5.0.3",
|
||||
"expo-haptics": "11.0.3",
|
||||
"expo-image-manipulator": "10.1.2",
|
||||
"expo-image-picker": "11.0.3",
|
||||
"expo-linking": "2.4.2",
|
||||
"expo-localization": "11.0.0",
|
||||
"expo-media-library": "^13.0.3",
|
||||
"expo-notifications": "0.13.3",
|
||||
"expo-permissions": "13.0.3",
|
||||
"expo-random": "12.0.1",
|
||||
"expo-screen-capture": "4.0.3",
|
||||
"expo-secure-store": "11.0.3",
|
||||
"expo-splash-screen": "0.13.5",
|
||||
"expo-status-bar": "1.1.0",
|
||||
"expo-store-review": "5.0.3",
|
||||
"expo-updates": "0.10.15",
|
||||
"expo-video-thumbnails": "6.0.3",
|
||||
"expo-web-browser": "10.0.3",
|
||||
"expo-constants": "^13.0.0",
|
||||
"expo-crypto": "10.1.1",
|
||||
"expo-device": "4.1.0",
|
||||
"expo-file-system": "13.1.0",
|
||||
"expo-firebase-analytics": "6.0.0",
|
||||
"expo-haptics": "11.1.0",
|
||||
"expo-image-manipulator": "10.2.0",
|
||||
"expo-image-picker": "12.0.1",
|
||||
"expo-linking": "3.0.0",
|
||||
"expo-localization": "12.0.0",
|
||||
"expo-media-library": "^14.0.0",
|
||||
"expo-notifications": "0.14.0",
|
||||
"expo-permissions": "13.1.0",
|
||||
"expo-random": "12.1.1",
|
||||
"expo-screen-capture": "4.1.0",
|
||||
"expo-secure-store": "11.1.0",
|
||||
"expo-splash-screen": "0.14.0",
|
||||
"expo-status-bar": "1.2.0",
|
||||
"expo-store-review": "5.1.0",
|
||||
"expo-updates": "0.11.1",
|
||||
"expo-video-thumbnails": "6.1.0",
|
||||
"expo-web-browser": "10.1.0",
|
||||
"i18next": "20.6.1",
|
||||
"li": "1.3.0",
|
||||
"lodash": "4.17.21",
|
||||
@ -80,13 +80,13 @@
|
||||
"react-native-gesture-handler": "2.1.0",
|
||||
"react-native-htmlview": "0.16.0",
|
||||
"react-native-pager-view": "5.4.9",
|
||||
"react-native-reanimated": "2.3.0",
|
||||
"react-native-reanimated": "2.3.1",
|
||||
"react-native-safe-area-context": "3.3.2",
|
||||
"react-native-screens": "3.10.1",
|
||||
"react-native-svg": "12.1.1",
|
||||
"react-native-swipe-list-view": "3.2.9",
|
||||
"react-native-tab-view": "3.1.1",
|
||||
"react-query": "3.34.3",
|
||||
"react-query": "3.34.5",
|
||||
"react-redux": "7.2.6",
|
||||
"react-timeago": "6.2.1",
|
||||
"redux-persist": "6.0.0",
|
||||
@ -99,7 +99,7 @@
|
||||
"@babel/core": "7.16.5",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.16.5",
|
||||
"@babel/preset-typescript": "7.16.5",
|
||||
"@expo/config": "6.0.13",
|
||||
"@expo/config": "6.0.14",
|
||||
"@types/lodash": "4.14.178",
|
||||
"@types/react": "17.0.37",
|
||||
"@types/react-dom": "17.0.11",
|
||||
|
166
patches/expo-file-system+13.1.0.patch
Normal file
166
patches/expo-file-system+13.1.0.patch
Normal file
@ -0,0 +1,166 @@
|
||||
diff --git a/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt b/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt
|
||||
index 53bf40f..0ba5d89 100644
|
||||
--- a/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt
|
||||
+++ b/node_modules/expo-file-system/android/src/main/java/expo/modules/filesystem/FileSystemModule.kt
|
||||
@@ -56,6 +56,7 @@ import okhttp3.Callback
|
||||
import okhttp3.Headers
|
||||
import okhttp3.JavaNetCookieJar
|
||||
import okhttp3.MediaType
|
||||
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.MultipartBody
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
@@ -63,11 +64,7 @@ import okhttp3.RequestBody
|
||||
import okhttp3.Response
|
||||
import okhttp3.ResponseBody
|
||||
|
||||
-import okio.Buffer
|
||||
-import okio.BufferedSource
|
||||
-import okio.ForwardingSource
|
||||
-import okio.Okio
|
||||
-import okio.Source
|
||||
+import okio.*
|
||||
|
||||
import org.apache.commons.codec.binary.Hex
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
@@ -766,7 +763,7 @@ open class FileSystemModule(
|
||||
}
|
||||
|
||||
val body = createRequestBody(options, decorator, fileUri.toFile())
|
||||
- return requestBuilder.method(method, body).build()
|
||||
+ return method?.let { requestBuilder.method(it, body).build() }
|
||||
} catch (e: Exception) {
|
||||
e.message?.let { Log.e(TAG, it) }
|
||||
promise.reject(e)
|
||||
@@ -791,7 +788,7 @@ open class FileSystemModule(
|
||||
} ?: URLConnection.guessContentTypeFromName(file.name)
|
||||
|
||||
val fieldName = options["fieldName"]?.let { it as String } ?: file.name
|
||||
- bodyBuilder.addFormDataPart(fieldName, file.name, decorator.decorate(RequestBody.create(MediaType.parse(mimeType), file)))
|
||||
+ bodyBuilder.addFormDataPart(fieldName, file.name, decorator.decorate(RequestBody.create(mimeType.toMediaTypeOrNull(), file)))
|
||||
bodyBuilder.build()
|
||||
}
|
||||
else -> {
|
||||
@@ -816,9 +813,9 @@ open class FileSystemModule(
|
||||
|
||||
override fun onResponse(call: Call, response: Response) {
|
||||
val result = Bundle().apply {
|
||||
- putString("body", response.body()?.string())
|
||||
- putInt("status", response.code())
|
||||
- putBundle("headers", translateHeaders(response.headers()))
|
||||
+ putString("body", response.body?.string())
|
||||
+ putInt("status", response.code)
|
||||
+ putBundle("headers", translateHeaders(response.headers))
|
||||
}
|
||||
response.close()
|
||||
promise.resolve(result)
|
||||
@@ -866,7 +863,7 @@ open class FileSystemModule(
|
||||
taskHandlers[uuid] = TaskHandler(call)
|
||||
call.enqueue(object : Callback {
|
||||
override fun onFailure(call: Call, e: IOException) {
|
||||
- if (call.isCanceled) {
|
||||
+ if (call.isCanceled()) {
|
||||
promise.resolve(null)
|
||||
return
|
||||
}
|
||||
@@ -876,11 +873,11 @@ open class FileSystemModule(
|
||||
|
||||
override fun onResponse(call: Call, response: Response) {
|
||||
val result = Bundle()
|
||||
- val body = response.body()
|
||||
+ val body = response.body
|
||||
result.apply {
|
||||
putString("body", body?.string())
|
||||
- putInt("status", response.code())
|
||||
- putBundle("headers", translateHeaders(response.headers()))
|
||||
+ putInt("status", response.code)
|
||||
+ putBundle("headers", translateHeaders(response.headers))
|
||||
}
|
||||
response.close()
|
||||
promise.resolve(result)
|
||||
@@ -900,10 +897,10 @@ open class FileSystemModule(
|
||||
val resources = context.resources
|
||||
val packageName = context.packageName
|
||||
val resourceId = resources.getIdentifier(url, "raw", packageName)
|
||||
- val bufferedSource = Okio.buffer(Okio.source(context.resources.openRawResource(resourceId)))
|
||||
+ val bufferedSource = context.resources.openRawResource(resourceId).source().buffer()
|
||||
val file = uri.toFile()
|
||||
file.delete()
|
||||
- val sink = Okio.buffer(Okio.sink(file))
|
||||
+ val sink = file.sink().buffer()
|
||||
sink.writeAll(bufferedSource)
|
||||
sink.close()
|
||||
val result = Bundle()
|
||||
@@ -934,13 +931,13 @@ open class FileSystemModule(
|
||||
override fun onResponse(call: Call, response: Response) {
|
||||
val file = uri.toFile()
|
||||
file.delete()
|
||||
- val sink = Okio.buffer(Okio.sink(file))
|
||||
- sink.writeAll(response.body()!!.source())
|
||||
+ val sink = file.sink().buffer()
|
||||
+ sink.writeAll(response.body!!.source())
|
||||
sink.close()
|
||||
val result = Bundle().apply {
|
||||
putString("uri", Uri.fromFile(file).toString())
|
||||
- putInt("status", response.code())
|
||||
- putBundle("headers", translateHeaders(response.headers()))
|
||||
+ putInt("status", response.code)
|
||||
+ putBundle("headers", translateHeaders(response.headers))
|
||||
if (options?.get("md5") == true) {
|
||||
putString("md5", md5(file))
|
||||
}
|
||||
@@ -1003,7 +1000,7 @@ open class FileSystemModule(
|
||||
?.addNetworkInterceptor { chain ->
|
||||
val originalResponse = chain.proceed(chain.request())
|
||||
originalResponse.newBuilder()
|
||||
- .body(ProgressResponseBody(originalResponse.body(), progressListener))
|
||||
+ .body(ProgressResponseBody(originalResponse.body, progressListener))
|
||||
.build()
|
||||
}
|
||||
?.build()
|
||||
@@ -1098,7 +1095,7 @@ open class FileSystemModule(
|
||||
val options = params[0]?.options
|
||||
return try {
|
||||
val response = call!!.execute()
|
||||
- val responseBody = response.body()
|
||||
+ val responseBody = response.body
|
||||
val input = BufferedInputStream(responseBody!!.byteStream())
|
||||
val output = FileOutputStream(file, isResume == true)
|
||||
val data = ByteArray(1024)
|
||||
@@ -1108,15 +1105,15 @@ open class FileSystemModule(
|
||||
}
|
||||
val result = Bundle().apply {
|
||||
putString("uri", Uri.fromFile(file).toString())
|
||||
- putInt("status", response.code())
|
||||
- putBundle("headers", translateHeaders(response.headers()))
|
||||
+ putInt("status", response.code)
|
||||
+ putBundle("headers", translateHeaders(response.headers))
|
||||
options?.get("md5").takeIf { it == true }?.let { putString("md5", file?.let { md5(it) }) }
|
||||
}
|
||||
response.close()
|
||||
promise?.resolve(result)
|
||||
null
|
||||
} catch (e: Exception) {
|
||||
- if (call?.isCanceled == true) {
|
||||
+ if (call?.isCanceled() == true) {
|
||||
promise?.resolve(null)
|
||||
return null
|
||||
}
|
||||
@@ -1139,7 +1136,7 @@ open class FileSystemModule(
|
||||
override fun contentLength(): Long = responseBody?.contentLength() ?: -1
|
||||
|
||||
override fun source(): BufferedSource =
|
||||
- bufferedSource ?: Okio.buffer(source(responseBody!!.source()))
|
||||
+ bufferedSource ?: source(responseBody!!.source()).buffer()
|
||||
|
||||
private fun source(source: Source): Source {
|
||||
return object : ForwardingSource(source) {
|
||||
@@ -1304,7 +1301,7 @@ open class FileSystemModule(
|
||||
// Copied out of React Native's `NetworkingModule.java`
|
||||
private fun translateHeaders(headers: Headers): Bundle {
|
||||
val responseHeaders = Bundle()
|
||||
- for (i in 0 until headers.size()) {
|
||||
+ for (i in 0 until headers.size) {
|
||||
val headerName = headers.name(i)
|
||||
// multiple values for the same header
|
||||
if (responseHeaders[headerName] != null) {
|
12128
patches/expo-updates+0.11.1.patch
Normal file
12128
patches/expo-updates+0.11.1.patch
Normal file
File diff suppressed because one or more lines are too long
23
src/App.tsx
23
src/App.tsx
@ -15,6 +15,8 @@ import * as Notifications from 'expo-notifications'
|
||||
import * as SplashScreen from 'expo-splash-screen'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import { AppState, LogBox, Platform } from 'react-native'
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler'
|
||||
import { enableFreeze } from 'react-native-screens'
|
||||
import { QueryClientProvider } from 'react-query'
|
||||
import { Provider } from 'react-redux'
|
||||
import { PersistGate } from 'redux-persist/integration/react'
|
||||
@ -28,6 +30,7 @@ dev()
|
||||
sentry()
|
||||
audio()
|
||||
push()
|
||||
enableFreeze()
|
||||
|
||||
const App: React.FC = () => {
|
||||
log('log', 'App', 'rendering App')
|
||||
@ -101,15 +104,17 @@ const App: React.FC = () => {
|
||||
)
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Provider store={store}>
|
||||
<PersistGate
|
||||
persistor={persistor}
|
||||
onBeforeLift={onBeforeLift}
|
||||
children={children}
|
||||
/>
|
||||
</Provider>
|
||||
</QueryClientProvider>
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Provider store={store}>
|
||||
<PersistGate
|
||||
persistor={persistor}
|
||||
onBeforeLift={onBeforeLift}
|
||||
children={children}
|
||||
/>
|
||||
</Provider>
|
||||
</QueryClientProvider>
|
||||
</GestureHandlerRootView>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
||||
}
|
||||
|
||||
if (previousRoute?.name !== currentRoute?.name) {
|
||||
Analytics.setCurrentScreen(currentRoute?.name)
|
||||
Analytics.logEvent('screen_view', { screen_name: currentRoute?.name })
|
||||
Sentry.Native.setContext('page', {
|
||||
previous: previousRoute,
|
||||
current: currentRoute
|
||||
|
@ -21,6 +21,11 @@ export type Params = {
|
||||
>
|
||||
}
|
||||
|
||||
export type InstanceResponse<T = unknown> = {
|
||||
body: T
|
||||
links: { prev?: string; next?: string }
|
||||
}
|
||||
|
||||
const apiInstance = async <T = unknown>({
|
||||
method,
|
||||
version = 'v1',
|
||||
@ -29,7 +34,7 @@ const apiInstance = async <T = unknown>({
|
||||
headers,
|
||||
body,
|
||||
extras
|
||||
}: Params): Promise<{ body: T; links: { prev?: string; next?: string } }> => {
|
||||
}: Params): Promise<InstanceResponse<T>> => {
|
||||
const { store } = require('@root/store')
|
||||
const state = store.getState() as RootState
|
||||
const instanceActive = state.instances.instances.findIndex(
|
||||
|
@ -47,7 +47,6 @@ const TimelineTranslate = React.memo(
|
||||
|
||||
const [enabled, setEnabled] = useState(false)
|
||||
const { refetch, data, isLoading, isSuccess, isError } = useTranslateQuery({
|
||||
uri: status.uri,
|
||||
source: status.language,
|
||||
target: settingsLanguage,
|
||||
text,
|
||||
|
@ -31,7 +31,7 @@ const Tab = createBottomTabNavigator<ScreenTabsStackParamList>()
|
||||
|
||||
const ScreenTabs = React.memo(
|
||||
({ navigation }: RootStackScreenProps<'Screen-Tabs'>) => {
|
||||
const { mode, theme } = useTheme()
|
||||
const { theme } = useTheme()
|
||||
|
||||
const instanceActive = useSelector(getInstanceActive)
|
||||
const instanceAccount = useSelector(
|
||||
|
@ -10,9 +10,11 @@ import { Alert, StyleSheet } from 'react-native'
|
||||
import FlashMessage from 'react-native-flash-message'
|
||||
import { ScrollView } from 'react-native-gesture-handler'
|
||||
|
||||
const TabMeProfileName: React.FC<TabMeProfileStackScreenProps<
|
||||
'Tab-Me-Profile-Name'
|
||||
> & { messageRef: RefObject<FlashMessage> }> = ({
|
||||
const TabMeProfileName: React.FC<
|
||||
TabMeProfileStackScreenProps<'Tab-Me-Profile-Name'> & {
|
||||
messageRef: RefObject<FlashMessage>
|
||||
}
|
||||
> = ({
|
||||
messageRef,
|
||||
route: {
|
||||
params: { display_name }
|
||||
@ -91,7 +93,8 @@ const TabMeProfileName: React.FC<TabMeProfileStackScreenProps<
|
||||
options={{
|
||||
maxLength: 30,
|
||||
autoCapitalize: 'none',
|
||||
autoCompleteType: 'username',
|
||||
autoComplete: 'username',
|
||||
textContentType: 'username',
|
||||
autoCorrect: false
|
||||
}}
|
||||
/>
|
||||
|
@ -64,6 +64,7 @@ const SettingsApp: React.FC = () => {
|
||||
cancelButtonIndex: options.length - 1
|
||||
},
|
||||
buttonIndex => {
|
||||
if (!buttonIndex) return
|
||||
if (buttonIndex < options.length - 1) {
|
||||
analytics('settings_language_press', {
|
||||
current: i18n.language,
|
||||
|
@ -32,9 +32,9 @@ export const mapFontsizeToName = (size: SettingsState['fontsize']) => {
|
||||
}
|
||||
}
|
||||
|
||||
const TabMeSettingsFontsize: React.FC<TabMeStackScreenProps<
|
||||
'Tab-Me-Settings-Fontsize'
|
||||
>> = () => {
|
||||
const TabMeSettingsFontsize: React.FC<
|
||||
TabMeStackScreenProps<'Tab-Me-Settings-Fontsize'>
|
||||
> = () => {
|
||||
const { mode, theme } = useTheme()
|
||||
const { t } = useTranslation('screenTabs')
|
||||
const initialSize = useSelector(getSettingsFontsize)
|
||||
@ -113,7 +113,12 @@ const TabMeSettingsFontsize: React.FC<TabMeStackScreenProps<
|
||||
extraMarginLeft={-StyleConstants.Spacing.Global.PagePadding}
|
||||
extraMarginRight={-StyleConstants.Spacing.Global.PagePadding}
|
||||
/>
|
||||
<TimelineDefault item={item} disableDetails disableOnPress />
|
||||
<TimelineDefault
|
||||
// @ts-ignore
|
||||
item={item}
|
||||
disableDetails
|
||||
disableOnPress
|
||||
/>
|
||||
<ComponentSeparator
|
||||
extraMarginLeft={-StyleConstants.Spacing.Global.PagePadding}
|
||||
extraMarginRight={-StyleConstants.Spacing.Global.PagePadding}
|
||||
|
@ -18,9 +18,9 @@ import {
|
||||
} from 'react-native'
|
||||
import { Circle } from 'react-native-animated-spinkit'
|
||||
|
||||
const TabSharedSearch: React.FC<TabSharedStackScreenProps<
|
||||
'Tab-Shared-Search'
|
||||
>> = ({
|
||||
const TabSharedSearch: React.FC<
|
||||
TabSharedStackScreenProps<'Tab-Shared-Search'>
|
||||
> = ({
|
||||
route: {
|
||||
params: { text }
|
||||
}
|
||||
@ -33,7 +33,13 @@ const TabSharedSearch: React.FC<TabSharedStackScreenProps<
|
||||
hashtags: t('shared.search.sections.hashtags'),
|
||||
statuses: t('shared.search.sections.statuses')
|
||||
}
|
||||
const { status, data } = useSearchQuery({
|
||||
const { status, data } = useSearchQuery<
|
||||
{
|
||||
title: string
|
||||
translation: string
|
||||
data: any[]
|
||||
}[]
|
||||
>({
|
||||
term: text,
|
||||
options: {
|
||||
enabled: text !== undefined,
|
||||
|
@ -33,24 +33,18 @@ const AccessibilityManager: React.FC = ({ children }) => {
|
||||
useEffect(() => {
|
||||
loadAccessibilityInfo()
|
||||
|
||||
AccessibilityInfo.addEventListener(
|
||||
const reduceMotionSubscription = AccessibilityInfo.addEventListener(
|
||||
'reduceMotionChanged',
|
||||
handleReduceMotionChanged
|
||||
)
|
||||
AccessibilityInfo.addEventListener(
|
||||
const screenReaderSubscription = AccessibilityInfo.addEventListener(
|
||||
'screenReaderChanged',
|
||||
handleScreenReaderEnabled
|
||||
)
|
||||
|
||||
return () => {
|
||||
AccessibilityInfo.removeEventListener(
|
||||
'reduceMotionChanged',
|
||||
handleReduceMotionChanged
|
||||
)
|
||||
AccessibilityInfo.removeEventListener(
|
||||
'screenReaderChanged',
|
||||
handleScreenReaderEnabled
|
||||
)
|
||||
reduceMotionSubscription.remove()
|
||||
screenReaderSubscription.remove()
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKeyAccount = ['Account', { id: Mastodon.Account['id'] }]
|
||||
|
||||
const queryFunction = ({ queryKey }: { queryKey: QueryKeyAccount }) => {
|
||||
const queryFunction = ({ queryKey }: QueryFunctionContext<QueryKeyAccount>) => {
|
||||
const { id } = queryKey[1]
|
||||
|
||||
return apiInstance<Mastodon.Account>({
|
||||
@ -13,11 +13,11 @@ const queryFunction = ({ queryKey }: { queryKey: QueryKeyAccount }) => {
|
||||
}).then(res => res.body)
|
||||
}
|
||||
|
||||
const useAccountQuery = <TData = Mastodon.Account>({
|
||||
const useAccountQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKeyAccount[1] & {
|
||||
options?: UseQueryOptions<Mastodon.Account, AxiosError, TData>
|
||||
options?: UseQueryOptions<Mastodon.Account, AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKeyAccount = ['Account', { ...queryKeyParams }]
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import {
|
||||
QueryFunctionContext,
|
||||
useMutation,
|
||||
UseMutationOptions,
|
||||
useQuery,
|
||||
@ -9,7 +10,9 @@ import {
|
||||
|
||||
type QueryKeyAnnouncement = ['Announcements', { showAll?: boolean }]
|
||||
|
||||
const queryFunction = ({ queryKey }: { queryKey: QueryKeyAnnouncement }) => {
|
||||
const queryFunction = ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeyAnnouncement>) => {
|
||||
const { showAll } = queryKey[1]
|
||||
|
||||
return apiInstance<Mastodon.Announcement[]>({
|
||||
@ -23,11 +26,11 @@ const queryFunction = ({ queryKey }: { queryKey: QueryKeyAnnouncement }) => {
|
||||
}).then(res => res.body)
|
||||
}
|
||||
|
||||
const useAnnouncementQuery = <TData = Mastodon.Announcement[]>({
|
||||
const useAnnouncementQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKeyAnnouncement[1] & {
|
||||
options?: UseQueryOptions<Mastodon.Announcement[], AxiosError, TData>
|
||||
options?: UseQueryOptions<Mastodon.Announcement[], AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKeyAnnouncement = [
|
||||
'Announcements',
|
||||
|
@ -1,11 +1,11 @@
|
||||
import apiGeneral from '@api/general'
|
||||
import { AxiosError } from 'axios'
|
||||
import * as AuthSession from 'expo-auth-session'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKey = ['Apps', { domain?: string }]
|
||||
export type QueryKeyApps = ['Apps', { domain?: string }]
|
||||
|
||||
const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
const queryFunction = ({ queryKey }: QueryFunctionContext<QueryKeyApps>) => {
|
||||
const redirectUri = AuthSession.makeRedirectUri({
|
||||
native: 'tooot://instance-auth',
|
||||
useProxy: false
|
||||
@ -27,13 +27,13 @@ const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
}).then(res => res.body)
|
||||
}
|
||||
|
||||
const useAppsQuery = <TData = Mastodon.Apps>({
|
||||
const useAppsQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKey[1] & {
|
||||
options?: UseQueryOptions<Mastodon.Apps, AxiosError, TData>
|
||||
}: QueryKeyApps[1] & {
|
||||
options?: UseQueryOptions<Mastodon.Apps, AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKey = ['Apps', { ...queryKeyParams }]
|
||||
const queryKey: QueryKeyApps = ['Apps', { ...queryKeyParams }]
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
}
|
||||
|
||||
|
@ -2,21 +2,22 @@ import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
type QueryKey = ['Emojis']
|
||||
type QueryKeyEmojis = ['Emojis']
|
||||
|
||||
const queryFunction = () => {
|
||||
return apiInstance<Mastodon.Emoji[]>({
|
||||
const queryFunction = async () => {
|
||||
const res = await apiInstance<Mastodon.Emoji[]>({
|
||||
method: 'get',
|
||||
url: 'custom_emojis'
|
||||
}).then(res => res.body)
|
||||
})
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useEmojisQuery = <TData = Mastodon.Emoji[]>({
|
||||
const useEmojisQuery = ({
|
||||
options
|
||||
}: {
|
||||
options?: UseQueryOptions<Mastodon.Emoji[], AxiosError, TData>
|
||||
options?: UseQueryOptions<Mastodon.Emoji[], AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKey = ['Emojis']
|
||||
const queryKey: QueryKeyEmojis = ['Emojis']
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
import apiGeneral from '@api/general'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKey = ['Instance', { domain?: string }]
|
||||
export type QueryKeyInstance = ['Instance', { domain?: string }]
|
||||
|
||||
const queryFunction = async ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
const queryFunction = async ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeyInstance>) => {
|
||||
const { domain } = queryKey[1]
|
||||
if (!domain) {
|
||||
return Promise.reject()
|
||||
@ -18,19 +20,16 @@ const queryFunction = async ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useInstanceQuery = <
|
||||
TData = Mastodon.Instance & { publicAllow?: boolean }
|
||||
>({
|
||||
const useInstanceQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKey[1] & {
|
||||
}: QueryKeyInstance[1] & {
|
||||
options?: UseQueryOptions<
|
||||
Mastodon.Instance & { publicAllow?: boolean },
|
||||
AxiosError,
|
||||
TData
|
||||
AxiosError
|
||||
>
|
||||
}) => {
|
||||
const queryKey: QueryKey = ['Instance', { ...queryKeyParams }]
|
||||
const queryKey: QueryKeyInstance = ['Instance', { ...queryKeyParams }]
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
}
|
||||
|
||||
|
@ -4,17 +4,18 @@ import { useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKey = ['Lists']
|
||||
|
||||
const queryFunction = () => {
|
||||
return apiInstance<Mastodon.List[]>({
|
||||
const queryFunction = async () => {
|
||||
const res = await apiInstance<Mastodon.List[]>({
|
||||
method: 'get',
|
||||
url: 'lists'
|
||||
}).then(res => res.body)
|
||||
})
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useListsQuery = <TData = Mastodon.List[]>({
|
||||
const useListsQuery = ({
|
||||
options
|
||||
}: {
|
||||
options?: UseQueryOptions<Mastodon.List[], AxiosError, TData>
|
||||
options?: UseQueryOptions<Mastodon.List[], AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKey = ['Lists']
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
|
@ -14,17 +14,18 @@ type AccountWithSource = Mastodon.Account &
|
||||
type QueryKeyProfile = ['Profile']
|
||||
const queryKey: QueryKeyProfile = ['Profile']
|
||||
|
||||
const queryFunction = () => {
|
||||
return apiInstance<AccountWithSource>({
|
||||
const queryFunction = async () => {
|
||||
const res = await apiInstance<AccountWithSource>({
|
||||
method: 'get',
|
||||
url: `accounts/verify_credentials`
|
||||
}).then(res => res.body)
|
||||
})
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useProfileQuery = <TData = AccountWithSource>({
|
||||
const useProfileQuery = ({
|
||||
options
|
||||
}: {
|
||||
options?: UseQueryOptions<AccountWithSource, AxiosError, TData>
|
||||
options?: UseQueryOptions<AccountWithSource, AxiosError>
|
||||
}) => {
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import {
|
||||
QueryFunctionContext,
|
||||
useMutation,
|
||||
UseMutationOptions,
|
||||
useQuery,
|
||||
@ -12,7 +13,9 @@ export type QueryKeyRelationship = [
|
||||
{ id: Mastodon.Account['id'] }
|
||||
]
|
||||
|
||||
const queryFunction = ({ queryKey }: { queryKey: QueryKeyRelationship }) => {
|
||||
const queryFunction = ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeyRelationship>) => {
|
||||
const { id } = queryKey[1]
|
||||
|
||||
return apiInstance<Mastodon.Relationship[]>({
|
||||
|
@ -1,8 +1,8 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
export type QueryKey = [
|
||||
export type QueryKeySearch = [
|
||||
'Search',
|
||||
{
|
||||
type?: 'accounts' | 'hashtags' | 'statuses'
|
||||
@ -17,9 +17,11 @@ export type SearchResult = {
|
||||
statuses: Mastodon.Status[]
|
||||
}
|
||||
|
||||
const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
const queryFunction = async ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeySearch>) => {
|
||||
const { type, term, limit = 20 } = queryKey[1]
|
||||
return apiInstance<SearchResult>({
|
||||
const res = await apiInstance<SearchResult>({
|
||||
version: 'v2',
|
||||
method: 'get',
|
||||
url: 'search',
|
||||
@ -29,16 +31,17 @@ const queryFunction = ({ queryKey }: { queryKey: QueryKey }) => {
|
||||
limit,
|
||||
resolve: true
|
||||
}
|
||||
}).then(res => res.body)
|
||||
})
|
||||
return res.body
|
||||
}
|
||||
|
||||
const useSearchQuery = <TData = SearchResult>({
|
||||
const useSearchQuery = <T = unknown>({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKey[1] & {
|
||||
options?: UseQueryOptions<SearchResult, AxiosError, TData>
|
||||
}: QueryKeySearch[1] & {
|
||||
options?: UseQueryOptions<SearchResult, AxiosError, T>
|
||||
}) => {
|
||||
const queryKey: QueryKey = ['Search', { ...queryKeyParams }]
|
||||
const queryKey: QueryKeySearch = ['Search', { ...queryKeyParams }]
|
||||
return useQuery(queryKey, queryFunction, options)
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import apiInstance, { InstanceResponse } from '@api/instance'
|
||||
import haptics from '@components/haptics'
|
||||
import queryClient from '@helpers/queryClient'
|
||||
import { store } from '@root/store'
|
||||
@ -7,6 +7,7 @@ import { AxiosError } from 'axios'
|
||||
import { uniqBy } from 'lodash'
|
||||
import {
|
||||
MutationOptions,
|
||||
QueryFunctionContext,
|
||||
useInfiniteQuery,
|
||||
UseInfiniteQueryOptions,
|
||||
useMutation
|
||||
@ -28,10 +29,7 @@ export type QueryKeyTimeline = [
|
||||
const queryFunction = async ({
|
||||
queryKey,
|
||||
pageParam
|
||||
}: {
|
||||
queryKey: QueryKeyTimeline
|
||||
pageParam?: { [key: string]: string }
|
||||
}) => {
|
||||
}: QueryFunctionContext<QueryKeyTimeline>) => {
|
||||
const { page, account, hashtag, list, toot } = queryKey[1]
|
||||
let params: { [key: string]: string } = { ...pageParam }
|
||||
|
||||
@ -191,21 +189,15 @@ const queryFunction = async ({
|
||||
|
||||
type Unpromise<T extends Promise<any>> = T extends Promise<infer U> ? U : never
|
||||
export type TimelineData = Unpromise<ReturnType<typeof queryFunction>>
|
||||
const useTimelineQuery = <TData = TimelineData>({
|
||||
const useTimelineQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKeyTimeline[1] & {
|
||||
options?: UseInfiniteQueryOptions<
|
||||
{
|
||||
body:
|
||||
| Mastodon.Status[]
|
||||
| Mastodon.Notification[]
|
||||
| Mastodon.Conversation[]
|
||||
links?: { prev?: string; next?: string }
|
||||
pinned?: Mastodon.Status['id'][]
|
||||
},
|
||||
AxiosError,
|
||||
TData
|
||||
InstanceResponse<
|
||||
Mastodon.Status[] | Mastodon.Notification[] | Mastodon.Conversation[]
|
||||
>,
|
||||
AxiosError
|
||||
>
|
||||
}) => {
|
||||
const queryKey: QueryKeyTimeline = ['Timeline', { ...queryKeyParams }]
|
||||
|
@ -1,7 +1,7 @@
|
||||
import apiTooot from '@api/tooot'
|
||||
import haptics from '@components/haptics'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useQuery, UseQueryOptions } from 'react-query'
|
||||
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
|
||||
|
||||
type Translations = {
|
||||
provider: string
|
||||
@ -18,7 +18,9 @@ export type QueryKeyTranslate = [
|
||||
}
|
||||
]
|
||||
|
||||
const queryFunction = async ({ queryKey }: { queryKey: QueryKeyTranslate }) => {
|
||||
const queryFunction = async ({
|
||||
queryKey
|
||||
}: QueryFunctionContext<QueryKeyTranslate>) => {
|
||||
const { source, target, text } = queryKey[1]
|
||||
|
||||
const res = await apiTooot<Translations>({
|
||||
@ -34,7 +36,7 @@ const useTranslateQuery = ({
|
||||
options,
|
||||
...queryKeyParams
|
||||
}: QueryKeyTranslate[1] & {
|
||||
options?: UseQueryOptions<Translations, AxiosError, Translations>
|
||||
options?: UseQueryOptions<Translations, AxiosError>
|
||||
}) => {
|
||||
const queryKey: QueryKeyTranslate = ['Translate', { ...queryKeyParams }]
|
||||
return useQuery(queryKey, queryFunction, { ...options, retry: false })
|
||||
|
@ -1,7 +1,11 @@
|
||||
import apiInstance from '@api/instance'
|
||||
import apiInstance, { InstanceResponse } from '@api/instance'
|
||||
import { TabSharedStackParamList } from '@utils/navigation/navigators'
|
||||
import { AxiosError } from 'axios'
|
||||
import { useInfiniteQuery, UseInfiniteQueryOptions } from 'react-query'
|
||||
import {
|
||||
QueryFunctionContext,
|
||||
useInfiniteQuery,
|
||||
UseInfiniteQueryOptions
|
||||
} from 'react-query'
|
||||
|
||||
export type QueryKeyUsers = [
|
||||
'Users',
|
||||
@ -11,10 +15,7 @@ export type QueryKeyUsers = [
|
||||
const queryFunction = ({
|
||||
queryKey,
|
||||
pageParam
|
||||
}: {
|
||||
queryKey: QueryKeyUsers
|
||||
pageParam?: { [key: string]: string }
|
||||
}) => {
|
||||
}: QueryFunctionContext<QueryKeyUsers>) => {
|
||||
const { reference, id, type } = queryKey[1]
|
||||
let params: { [key: string]: string } = { ...pageParam }
|
||||
|
||||
@ -30,15 +31,8 @@ const useUsersQuery = ({
|
||||
...queryKeyParams
|
||||
}: QueryKeyUsers[1] & {
|
||||
options?: UseInfiniteQueryOptions<
|
||||
{
|
||||
body: Mastodon.Account[]
|
||||
links?: { prev?: string; next?: string }
|
||||
},
|
||||
AxiosError,
|
||||
{
|
||||
body: Mastodon.Account[]
|
||||
links?: { prev?: string; next?: string }
|
||||
}
|
||||
InstanceResponse<Mastodon.Account[]>,
|
||||
AxiosError
|
||||
>
|
||||
}) => {
|
||||
const queryKey: QueryKeyUsers = ['Users', { ...queryKeyParams }]
|
||||
|
@ -99,7 +99,7 @@ const addInstance = createAsyncThunk(
|
||||
mention: { loading: false, value: true },
|
||||
poll: { loading: false, value: true }
|
||||
},
|
||||
keys: undefined
|
||||
keys: { auth: undefined, public: undefined, private: undefined }
|
||||
},
|
||||
drafts: []
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user