mirror of https://github.com/tooot-app/app
commit
414119a7e3
|
@ -1,4 +1,3 @@
|
|||
🍎
|
||||
Support version from iOS 12
|
||||
🤖️
|
||||
Support APNG animation
|
||||
Support iOS version starting from 12
|
||||
Optimize performance (hopefully)
|
||||
Using new push and translation service
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
🍎
|
||||
最低版本支持升级至iOS 12
|
||||
🤖️
|
||||
支持APNG动画
|
||||
iOS支持最低版本12
|
||||
(但愿)性能有改进
|
||||
使用新的推送和翻译服务
|
|
@ -4,7 +4,7 @@
|
|||
"native": "211218",
|
||||
"major": 3,
|
||||
"minor": 0,
|
||||
"patch": 0,
|
||||
"patch": 1,
|
||||
"expo": "44.0.0"
|
||||
},
|
||||
"description": "tooot app for Mastodon",
|
||||
|
|
|
@ -187,7 +187,7 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||
headerLeft: () => (
|
||||
<HeaderLeft content='X' onPress={() => navigation.goBack()} />
|
||||
),
|
||||
headerTitle: t('screenAnnouncements:heading')
|
||||
title: t('screenAnnouncements:heading')
|
||||
})}
|
||||
/>
|
||||
<Stack.Screen
|
||||
|
|
|
@ -372,10 +372,8 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
|
|||
name='Screen-Compose-Root'
|
||||
component={ComposeRoot}
|
||||
options={{
|
||||
...Platform.select({
|
||||
ios: {
|
||||
headerTitle: headerContent,
|
||||
headerTitleStyle: {
|
||||
title: headerContent,
|
||||
titleStyle: {
|
||||
fontWeight:
|
||||
totalTextCount > maxTootChars
|
||||
? StyleConstants.Font.Weight.Bold
|
||||
|
@ -383,14 +381,7 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
|
|||
fontSize: StyleConstants.Font.Size.M
|
||||
},
|
||||
headerTintColor:
|
||||
totalTextCount > maxTootChars
|
||||
? theme.red
|
||||
: theme.secondary
|
||||
},
|
||||
android: {
|
||||
headerCenter: () => <HeaderCenter content={headerContent} />
|
||||
}
|
||||
}),
|
||||
totalTextCount > maxTootChars ? theme.red : theme.secondary,
|
||||
headerLeft,
|
||||
headerRight
|
||||
}}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import { HeaderCenter, HeaderLeft } from '@components/Header'
|
||||
import { HeaderLeft } from '@components/Header'
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
||||
import { ScreenComposeStackScreenProps } from '@utils/navigation/navigators'
|
||||
import React, { useCallback } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Platform } from 'react-native'
|
||||
import ComposeDraftsListRoot from './DraftsList/Root'
|
||||
|
||||
const Stack = createNativeStackNavigator()
|
||||
|
||||
const ComposeDraftsList: React.FC<ScreenComposeStackScreenProps<
|
||||
'Screen-Compose-DraftsList'
|
||||
>> = ({
|
||||
const ComposeDraftsList: React.FC<
|
||||
ScreenComposeStackScreenProps<'Screen-Compose-DraftsList'>
|
||||
> = ({
|
||||
route: {
|
||||
params: { timestamp }
|
||||
},
|
||||
|
@ -40,12 +39,7 @@ const ComposeDraftsList: React.FC<ScreenComposeStackScreenProps<
|
|||
children={children}
|
||||
options={{
|
||||
headerLeft,
|
||||
headerTitle: t('content.draftsList.header.title'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('content.draftsList.header.title')} />
|
||||
)
|
||||
}),
|
||||
title: t('content.draftsList.header.title'),
|
||||
headerShadowVisible: false
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -49,7 +49,7 @@ const ComposeEditAttachment: React.FC<ScreenComposeStackScreenProps<
|
|||
options={{
|
||||
headerLeft,
|
||||
headerRight: () => <ComposeEditAttachmentSubmit index={index} />,
|
||||
headerTitle: t('content.editAttachment.header.title')
|
||||
title: t('content.editAttachment.header.title')
|
||||
}}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
|
|
|
@ -15,8 +15,8 @@ const composePost = async (
|
|||
method: 'get',
|
||||
url: `statuses/${composeState.replyToStatus.id}`
|
||||
})
|
||||
} catch (err) {
|
||||
if (err.status && err.status == 404) {
|
||||
} catch (err: any) {
|
||||
if (err && err.status && err.status == 404) {
|
||||
return Promise.reject({ removeReply: true })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ const TabLocal = React.memo(
|
|||
|
||||
const screenOptionsRoot = useMemo(
|
||||
() => ({
|
||||
headerTitle: t('tabs.local.name'),
|
||||
title: t('tabs.local.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => <HeaderCenter content={t('tabs.local.name')} />
|
||||
}),
|
||||
|
|
|
@ -38,7 +38,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Bookmarks'
|
||||
component={TabMeBookmarks}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.bookmarks.name'),
|
||||
title: t('me.stacks.bookmarks.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.bookmarks.name')} />
|
||||
|
@ -51,7 +51,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Conversations'
|
||||
component={TabMeConversations}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.conversations.name'),
|
||||
title: t('me.stacks.conversations.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.conversations.name')} />
|
||||
|
@ -64,7 +64,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Favourites'
|
||||
component={TabMeFavourites}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.favourites.name'),
|
||||
title: t('me.stacks.favourites.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.favourites.name')} />
|
||||
|
@ -77,7 +77,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Lists'
|
||||
component={TabMeLists}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.lists.name'),
|
||||
title: t('me.stacks.lists.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.lists.name')} />
|
||||
|
@ -90,7 +90,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Lists-List'
|
||||
component={TabMeListsList}
|
||||
options={({ route, navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.list.name', { list: route.params.title }),
|
||||
title: t('me.stacks.list.name', { list: route.params.title }),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter
|
||||
|
@ -117,7 +117,7 @@ const TabMe = React.memo(
|
|||
options={({ navigation }) => ({
|
||||
presentation: 'modal',
|
||||
headerShown: true,
|
||||
headerTitle: t('me.stacks.push.name'),
|
||||
title: t('me.stacks.push.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.push.name')} />
|
||||
|
@ -135,12 +135,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Settings'
|
||||
component={TabMeSettings}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.settings.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.settings.name')} />
|
||||
)
|
||||
}),
|
||||
title: t('me.stacks.settings.name'),
|
||||
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
||||
})}
|
||||
/>
|
||||
|
@ -148,7 +143,7 @@ const TabMe = React.memo(
|
|||
name='Tab-Me-Settings-Fontsize'
|
||||
component={TabMeSettingsFontsize}
|
||||
options={({ navigation }: any) => ({
|
||||
headerTitle: t('me.stacks.fontSize.name'),
|
||||
title: t('me.stacks.fontSize.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.fontSize.name')} />
|
||||
|
@ -163,7 +158,7 @@ const TabMe = React.memo(
|
|||
options={({ navigation }) => ({
|
||||
presentation: 'modal',
|
||||
headerShown: true,
|
||||
headerTitle: t('me.stacks.switch.name'),
|
||||
title: t('me.stacks.switch.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.switch.name')} />
|
||||
|
|
|
@ -31,7 +31,7 @@ const TabMeProfile: React.FC<TabMeStackScreenProps<'Tab-Me-Switch'>> = ({
|
|||
<Stack.Screen
|
||||
name='Tab-Me-Profile-Root'
|
||||
options={{
|
||||
headerTitle: t('me.stacks.profile.name'),
|
||||
title: t('me.stacks.profile.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.profile.name')} />
|
||||
|
@ -56,7 +56,7 @@ const TabMeProfile: React.FC<TabMeStackScreenProps<'Tab-Me-Switch'>> = ({
|
|||
<Stack.Screen
|
||||
name='Tab-Me-Profile-Name'
|
||||
options={{
|
||||
headerTitle: t('me.stacks.profileName.name'),
|
||||
title: t('me.stacks.profileName.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.profileName.name')} />
|
||||
|
@ -75,7 +75,7 @@ const TabMeProfile: React.FC<TabMeStackScreenProps<'Tab-Me-Switch'>> = ({
|
|||
<Stack.Screen
|
||||
name='Tab-Me-Profile-Note'
|
||||
options={{
|
||||
headerTitle: t('me.stacks.profileNote.name'),
|
||||
title: t('me.stacks.profileNote.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.profileNote.name')} />
|
||||
|
@ -94,7 +94,7 @@ const TabMeProfile: React.FC<TabMeStackScreenProps<'Tab-Me-Switch'>> = ({
|
|||
<Stack.Screen
|
||||
name='Tab-Me-Profile-Fields'
|
||||
options={{
|
||||
headerTitle: t('me.stacks.profileFields.name'),
|
||||
title: t('me.stacks.profileFields.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('me.stacks.profileFields.name')} />
|
||||
|
|
|
@ -11,6 +11,7 @@ import accountInitialState from '@screens/Tabs/Shared/Account/utils/initialState
|
|||
import accountReducer from '@screens/Tabs/Shared/Account/utils/reducer'
|
||||
import { useProfileQuery } from '@utils/queryHooks/profile'
|
||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import React, { useReducer, useRef } from 'react'
|
||||
import Animated, {
|
||||
useAnimatedScrollHandler,
|
||||
|
@ -49,6 +50,7 @@ const TabMeRoot: React.FC = () => {
|
|||
keyboardShouldPersistTaps='handled'
|
||||
onScroll={onScroll}
|
||||
scrollEventThrottle={16}
|
||||
style={{ marginBottom: StyleConstants.Spacing.L }}
|
||||
>
|
||||
{instanceActive !== -1 ? (
|
||||
<MyInfo account={data} />
|
||||
|
|
|
@ -109,7 +109,7 @@ const Collections: React.FC = () => {
|
|||
iconBack='ChevronRight'
|
||||
title={t('me.stacks.push.name')}
|
||||
content={
|
||||
instancePush
|
||||
instancePush.global.value
|
||||
? t('me.root.push.content.enabled')
|
||||
: t('me.root.push.content.disabled')
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ const TabNotifications = React.memo(
|
|||
|
||||
const screenOptionsRoot = useMemo(
|
||||
() => ({
|
||||
headerTitle: t('tabs.notifications.name'),
|
||||
title: t('tabs.notifications.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter content={t('tabs.notifications.name')} />
|
||||
|
|
|
@ -41,7 +41,7 @@ const TabSharedRoot = ({
|
|||
headerStyle: {
|
||||
backgroundColor: `rgba(255, 255, 255, 0)`
|
||||
},
|
||||
headerTitle: '',
|
||||
title: '',
|
||||
headerLeft: () => (
|
||||
<HeaderLeft onPress={() => navigation.goBack()} background />
|
||||
)
|
||||
|
@ -91,14 +91,7 @@ const TabSharedRoot = ({
|
|||
options={({
|
||||
route
|
||||
}: TabSharedStackScreenProps<'Tab-Shared-Hashtag'>) => ({
|
||||
headerTitle: `#${decodeURIComponent(route.params.hashtag)}`,
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter
|
||||
content={`#${decodeURIComponent(route.params.hashtag)}`}
|
||||
/>
|
||||
)
|
||||
})
|
||||
title: `#${decodeURIComponent(route.params.hashtag)}`
|
||||
})}
|
||||
/>
|
||||
|
||||
|
@ -109,6 +102,13 @@ const TabSharedRoot = ({
|
|||
options={({
|
||||
navigation
|
||||
}: TabSharedStackScreenProps<'Tab-Shared-Search'>) => ({
|
||||
...(Platform.OS === 'ios'
|
||||
? {
|
||||
headerLeft: () => (
|
||||
<HeaderLeft onPress={() => navigation.goBack()} />
|
||||
)
|
||||
}
|
||||
: { headerLeft: () => null }),
|
||||
headerTitle: () => {
|
||||
const onChangeText = debounce(
|
||||
(text: string) => navigation.setParams({ text }),
|
||||
|
@ -164,10 +164,7 @@ const TabSharedRoot = ({
|
|||
name='Tab-Shared-Toot'
|
||||
component={TabSharedToot}
|
||||
options={{
|
||||
headerTitle: t('shared.toot.name'),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => <HeaderCenter content={t('shared.toot.name')} />
|
||||
})
|
||||
title: t('shared.toot.name')
|
||||
}}
|
||||
/>
|
||||
|
||||
|
@ -180,7 +177,7 @@ const TabSharedRoot = ({
|
|||
params: { reference, type, count }
|
||||
}
|
||||
}: TabSharedStackScreenProps<'Tab-Shared-Users'>) => ({
|
||||
headerTitle: t(`shared.users.${reference}.${type}`, { count }),
|
||||
title: t(`shared.users.${reference}.${type}`, { count }),
|
||||
...(Platform.OS === 'android' && {
|
||||
headerCenter: () => (
|
||||
<HeaderCenter
|
||||
|
|
|
@ -38,12 +38,13 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||
if (!scrolled.current) {
|
||||
scrolled.current = true
|
||||
const pointer = findIndex(flattenData, ['id', toot.id])
|
||||
pointer > 0 &&
|
||||
setTimeout(() => {
|
||||
flRef.current?.scrollToIndex({
|
||||
index: pointer === -1 ? 0 : pointer,
|
||||
index: pointer,
|
||||
viewOffset: 100
|
||||
})
|
||||
}, 500)
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -29,7 +29,7 @@ const pushUseConnect = ({ mode, t, instances, dispatch }: Params) => {
|
|||
url: `push/connect/${expoToken}`,
|
||||
sentry: true
|
||||
}).catch(error => {
|
||||
if (error.status == 410) {
|
||||
if (error.status == 404) {
|
||||
displayMessage({
|
||||
mode,
|
||||
type: 'error',
|
||||
|
|
Loading…
Reference in New Issue