diff --git a/app.config.ts b/app.config.ts index 087f6bc6..88e1fd9d 100644 --- a/app.config.ts +++ b/app.config.ts @@ -8,6 +8,7 @@ export default (): ExpoConfig => ({ slug: 'tooot', scheme: 'tooot', version, + // @ts-ignore extra: { environment: process.env.ENVIRONMENT }, privacy: 'hidden', ios: { diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 402bc057..d8170552 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -370,7 +370,7 @@ PODS: - RCTTypeSafety - React-Core - ReactCommon/turbomodule/core - - react-native-segmented-control (2.2.2): + - react-native-segmented-control (2.4.0): - React-Core - React-perflogger (0.71.2) - React-RCTActionSheet (0.71.2): @@ -571,7 +571,7 @@ DEPENDENCIES: - "react-native-paste-input (from `../node_modules/@mattermost/react-native-paste-input`)" - react-native-quick-base64 (from `../node_modules/react-native-quick-base64`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - - "react-native-segmented-control (from `../node_modules/@react-native-community/segmented-control`)" + - "react-native-segmented-control (from `../node_modules/@react-native-segmented-control/segmented-control`)" - 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`) @@ -722,7 +722,7 @@ EXTERNAL SOURCES: react-native-safe-area-context: :path: "../node_modules/react-native-safe-area-context" react-native-segmented-control: - :path: "../node_modules/@react-native-community/segmented-control" + :path: "../node_modules/@react-native-segmented-control/segmented-control" React-perflogger: :path: "../node_modules/react-native/ReactCommon/reactperflogger" React-RCTActionSheet: @@ -831,7 +831,7 @@ SPEC CHECKSUMS: react-native-paste-input: fb7156dc75960c9895ddd9b9d68eeb874c9f323a react-native-quick-base64: e657e9197e61b60a9dec49807843052b830da254 react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc - react-native-segmented-control: 65df6cd0619b780b3843d574a72d4c7cec396097 + react-native-segmented-control: 06607462630512ff8eef652ec560e6235a30cc3e React-perflogger: c7ccda3d1d1da837f7ff4e54e816022a6803ee87 React-RCTActionSheet: 01c125aebbad462a24228f68c584c7a921d6c28e React-RCTAnimation: 5277a9440acffc4a5b7baa6ae3880fe467277ae6 diff --git a/ios/tooot.xcodeproj/project.pbxproj b/ios/tooot.xcodeproj/project.pbxproj index 4584070d..03d723d0 100644 --- a/ios/tooot.xcodeproj/project.pbxproj +++ b/ios/tooot.xcodeproj/project.pbxproj @@ -573,8 +573,9 @@ PRODUCT_BUNDLE_IDENTIFIER = com.xmflsct.app.tooot; PRODUCT_NAME = tooot; PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.xmflsct.app.tooot"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = YES; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "tooot-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_PRECOMPILE_BRIDGING_HEADER = YES; @@ -612,8 +613,9 @@ PRODUCT_BUNDLE_IDENTIFIER = com.xmflsct.app.tooot; PRODUCT_NAME = tooot; PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.xmflsct.app.tooot"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = YES; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "tooot-Bridging-Header.h"; SWIFT_PRECOMPILE_BRIDGING_HEADER = YES; SWIFT_VERSION = 5.0; diff --git a/package.json b/package.json index 0868d58e..ed39a02e 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,9 @@ "@react-native-clipboard/clipboard": "^1.11.1", "@react-native-community/blur": "^4.3.0", "@react-native-community/netinfo": "9.3.7", - "@react-native-community/segmented-control": "^2.2.2", "@react-native-firebase/app": "^17.1.0", "@react-native-menu/menu": "^0.7.3", + "@react-native-segmented-control/segmented-control": "^2.4.0", "@react-navigation/bottom-tabs": "^6.5.4", "@react-navigation/native": "^6.1.3", "@react-navigation/native-stack": "^6.9.9", diff --git a/src/App.tsx b/src/App.tsx index 89748fed..41edd9e0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,16 +18,15 @@ import ThemeManager from '@utils/styles/ThemeManager' import * as Localization from 'expo-localization' import * as SplashScreen from 'expo-splash-screen' import React, { useCallback, useEffect, useState } from 'react' -import { LogBox, Platform } from 'react-native' +import { Platform } from 'react-native' import { GestureHandlerRootView } from 'react-native-gesture-handler' import { SafeAreaProvider } from 'react-native-safe-area-context' import { enableFreeze } from 'react-native-screens' import i18n from './i18n' import Screens from './screens' -Platform.select({ - android: LogBox.ignoreLogs(['Setting a timer for a long period of time']) -}) +log('log', 'App', 'delay splash') +SplashScreen.preventAutoHideAsync() dev() sentry() @@ -36,9 +35,6 @@ audio() push() enableFreeze(true) -log('log', 'App', 'delay splash') -SplashScreen.preventAutoHideAsync() - const App: React.FC = () => { log('log', 'App', 'rendering App') const [appIsReady, setAppIsReady] = useState(false) diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 736b2af6..a1fd45f8 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,6 +1,6 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' -import React, { forwardRef, RefObject } from 'react' +import React, { ForwardedRef, forwardRef } from 'react' import { Platform, TextInput, TextInputProps, View } from 'react-native' import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated' import { EmojisState } from './Emojis/Context' @@ -35,7 +35,7 @@ const ComponentInput = forwardRef( isFocused, ...props }: Props, - ref: RefObject + ref: ForwardedRef ) => { const { colors, mode } = useTheme() diff --git a/src/components/ModalScrollView.tsx b/src/components/ModalScrollView.tsx index 302ffeef..61a5174c 100644 --- a/src/components/ModalScrollView.tsx +++ b/src/components/ModalScrollView.tsx @@ -1,11 +1,11 @@ import { useHeaderHeight } from '@react-navigation/elements' import { StyleConstants } from '@utils/styles/constants' -import { forwardRef, PropsWithChildren, RefObject } from 'react' +import { ForwardedRef, forwardRef, PropsWithChildren } from 'react' import { KeyboardAvoidingView, Platform, ScrollView } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' export const ModalScrollView = forwardRef( - ({ children }: PropsWithChildren, ref: RefObject) => { + ({ children }: PropsWithChildren, ref: ForwardedRef) => { const headerHeight = useHeaderHeight() return ( diff --git a/src/components/Timeline/Refresh.tsx b/src/components/Timeline/Refresh.tsx index d401d8d4..056bd9ce 100644 --- a/src/components/Timeline/Refresh.tsx +++ b/src/components/Timeline/Refresh.tsx @@ -177,7 +177,7 @@ const TimelineRefresh: React.FC = ({ flRef.current?.scrollToOffset({ offset: scrollY.value - 15, animated: true }) } - await new Promise(promise => setTimeout(promise, 64)) + await new Promise(promise => setTimeout(promise, 64)) queryClient.setQueryData< InfiniteData< PagedResponse<(Mastodon.Status | Mastodon.Notification | Mastodon.Conversation)[]> diff --git a/src/components/Timeline/Shared/Actions.tsx b/src/components/Timeline/Shared/Actions.tsx index 3178e62a..c71c23db 100644 --- a/src/components/Timeline/Shared/Actions.tsx +++ b/src/components/Timeline/Shared/Actions.tsx @@ -103,7 +103,7 @@ const TimelineActions: React.FC = () => { cancelButtonIndex: 2, ...androidActionSheetStyles(colors) }, - (selectedIndex: number) => { + selectedIndex => { switch (selectedIndex) { case 0: mutation.mutate({ diff --git a/src/screens/Compose/Root/Footer/addAttachment.ts b/src/screens/Compose/Root/Footer/addAttachment.ts index 2f03c701..d7bde9ee 100644 --- a/src/screens/Compose/Root/Footer/addAttachment.ts +++ b/src/screens/Compose/Root/Footer/addAttachment.ts @@ -129,7 +129,7 @@ const chooseAndUploadAttachment = async ({ for (const media of result) { const requiredMedia = media as Required uploadAttachment({ composeDispatch, media: requiredMedia }) - await new Promise(res => setTimeout(res, 500)) + await new Promise(res => setTimeout(res, 500)) } } diff --git a/src/screens/Tabs/Public/Root.tsx b/src/screens/Tabs/Public/Root.tsx index 77339868..95540a5f 100644 --- a/src/screens/Tabs/Public/Root.tsx +++ b/src/screens/Tabs/Public/Root.tsx @@ -1,6 +1,6 @@ import { HeaderRight } from '@components/Header' import Timeline from '@components/Timeline' -import SegmentedControl from '@react-native-community/segmented-control' +import SegmentedControl from '@react-native-segmented-control/segmented-control' import { NativeStackScreenProps } from '@react-navigation/native-stack' import { TabPublicStackParamList } from '@utils/navigation/navigators' import { QueryKeyTimeline } from '@utils/queryHooks/timeline' @@ -49,11 +49,12 @@ const Root: React.FC { navigation.setOptions({ headerTitle: () => ( + // @ts-ignore title)} selectedIndex={segment} - onChange={({ nativeEvent }) => { + onChange={({ nativeEvent }: any) => { setSegment(nativeEvent.selectedSegmentIndex) setGlobalStorage('app.prev_public_segment', segments[nativeEvent.selectedSegmentIndex]) }} diff --git a/src/screens/Tabs/Shared/Account/index.tsx b/src/screens/Tabs/Shared/Account/index.tsx index 5ba578a5..7f380153 100644 --- a/src/screens/Tabs/Shared/Account/index.tsx +++ b/src/screens/Tabs/Shared/Account/index.tsx @@ -3,7 +3,7 @@ import menuShare from '@components/contextMenu/share' import { HeaderLeft, HeaderRight } from '@components/Header' import Timeline from '@components/Timeline' import TimelineDefault from '@components/Timeline/Default' -import SegmentedControl from '@react-native-community/segmented-control' +import SegmentedControl from '@react-native-segmented-control/segmented-control' import { useQueryClient } from '@tanstack/react-query' import { TabSharedStackScreenProps } from '@utils/navigation/navigators' import { useAccountQuery } from '@utils/queryHooks/account' @@ -182,11 +182,12 @@ const TabSharedAccount: React.FC {!data?.suspended ? ( + // @ts-ignore { + onChange={({ nativeEvent }: any) => { setSegment(nativeEvent.selectedSegmentIndex) switch (nativeEvent.selectedSegmentIndex) { case 0: diff --git a/src/screens/Tabs/Shared/Toot.tsx b/src/screens/Tabs/Shared/Toot.tsx index 75f49ca6..93bc153e 100644 --- a/src/screens/Tabs/Shared/Toot.tsx +++ b/src/screens/Tabs/Shared/Toot.tsx @@ -85,7 +85,7 @@ const TabSharedToot: React.FC> = ({ for (let [] of Array( Math.ceil(ancestorsCache.current.length / PREV_PER_BATCH) ).entries()) { - await new Promise(promise => setTimeout(promise, 64)) + await new Promise(promise => setTimeout(promise, 64)) queryClient.setQueryData<{ pages: { body: Mastodon.Status[] }[] }>( queryKey.local, old => { diff --git a/src/screens/Tabs/Shared/index.tsx b/src/screens/Tabs/Shared/index.tsx index 50fd33a9..0b01a052 100644 --- a/src/screens/Tabs/Shared/index.tsx +++ b/src/screens/Tabs/Shared/index.tsx @@ -1,4 +1,3 @@ -import { createNativeStackNavigator } from '@react-navigation/native-stack' import TabSharedAccount from '@screens/Tabs/Shared/Account' import TabSharedAccountInLists from '@screens/Tabs/Shared/AccountInLists' import TabSharedAttachments from '@screens/Tabs/Shared/Attachments' @@ -11,7 +10,7 @@ import TabSharedUsers from '@screens/Tabs/Shared/Users' import React from 'react' import TabSharedFilter from './Filter' -const TabShared = ({ Stack }: { Stack: ReturnType }) => { +const TabShared = ({ Stack }: { Stack: any }) => { return ( { log('log', 'Migration', 'Migrating...') - const start = global.performance.now() const unwrapPushData = (setting: { value: boolean } | boolean | undefined): boolean => typeof setting === 'object' ? setting.value : typeof setting === 'boolean' ? setting : true @@ -176,6 +175,5 @@ export async function migrateFromAsyncStorage(): Promise { storage.global.set('version.global', 0) - const end = global.performance.now() - log('log', 'Migration', `Migrated in ${end - start}ms`) + log('log', 'Migration', 'Migrated') } diff --git a/tsconfig.json b/tsconfig.json index 310d38de..dffbcb43 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,16 +9,18 @@ "react-native" ], "lib": [ - "es2019" + "esnext" ], "allowJs": false, "jsx": "react-native", "noEmit": true, "isolatedModules": true, "strict": true, + "strictFunctionTypes": false, "moduleResolution": "node", "resolveJsonModule": true, "allowSyntheticDefaultImports": true, + "traceResolution": true, "forceConsistentCasingInFileNames": true, "esModuleInterop": true, "skipLibCheck": true, diff --git a/yarn.lock b/yarn.lock index b0357d7d..0868ed00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3069,16 +3069,6 @@ __metadata: languageName: node linkType: hard -"@react-native-community/segmented-control@npm:^2.2.2": - version: 2.2.2 - resolution: "@react-native-community/segmented-control@npm:2.2.2" - peerDependencies: - react: ">=16.0" - react-native: ">=0.62" - checksum: 2b691a8a1c3b1afc4262d8c27c64b9af14d075198cd1873a6d8abbcea93f9f2fcca00355a31e281350f07d2d48dee9d3020e20eb82ef61901134e3aaba2f833e - languageName: node - linkType: hard - "@react-native-firebase/app@npm:^17.1.0": version: 17.1.0 resolution: "@react-native-firebase/app@npm:17.1.0" @@ -3103,6 +3093,16 @@ __metadata: languageName: node linkType: hard +"@react-native-segmented-control/segmented-control@npm:^2.4.0": + version: 2.4.0 + resolution: "@react-native-segmented-control/segmented-control@npm:2.4.0" + peerDependencies: + react: ">=16.0" + react-native: ">=0.62" + checksum: a7d6b243116bf1aa8e98dc0514f83a169c2e3881ec5b435bf8eab2fc2c125b7b15a53d81c1d46ab5889950cb6f5c1351708b5a3f7c5759421c0fdb73839fce3a + languageName: node + linkType: hard + "@react-native/assets@npm:1.0.0": version: 1.0.0 resolution: "@react-native/assets@npm:1.0.0" @@ -11585,9 +11585,9 @@ __metadata: "@react-native-clipboard/clipboard": ^1.11.1 "@react-native-community/blur": ^4.3.0 "@react-native-community/netinfo": 9.3.7 - "@react-native-community/segmented-control": ^2.2.2 "@react-native-firebase/app": ^17.1.0 "@react-native-menu/menu": ^0.7.3 + "@react-native-segmented-control/segmented-control": ^2.4.0 "@react-navigation/bottom-tabs": ^6.5.4 "@react-navigation/native": ^6.1.3 "@react-navigation/native-stack": ^6.9.9