mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Updates
This commit is contained in:
@ -74,7 +74,7 @@ const TimelineNotifications: React.FC<Props> = ({
|
|||||||
{notification.status.media_attachments.length > 0 && (
|
{notification.status.media_attachments.length > 0 && (
|
||||||
<TimelineAttachment
|
<TimelineAttachment
|
||||||
status={notification.status}
|
status={notification.status}
|
||||||
width={contentWidth}
|
contentWidth={contentWidth}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{notification.status.card && (
|
{notification.status.card && (
|
||||||
|
@ -4,6 +4,7 @@ import ParseContent from '@components/ParseContent'
|
|||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { LinearGradient } from 'expo-linear-gradient'
|
import { LinearGradient } from 'expo-linear-gradient'
|
||||||
|
import layoutAnimation from '@root/utils/styles/layoutAnimation'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
status: Mastodon.Status
|
status: Mastodon.Status
|
||||||
@ -16,7 +17,7 @@ const TimelineContent: React.FC<Props> = ({
|
|||||||
numberOfLines,
|
numberOfLines,
|
||||||
highlighted = false
|
highlighted = false
|
||||||
}) => {
|
}) => {
|
||||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
layoutAnimation()
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
const [spoilerCollapsed, setSpoilerCollapsed] = useState(false)
|
const [spoilerCollapsed, setSpoilerCollapsed] = useState(false)
|
||||||
const lineHeight = 28
|
const lineHeight = 28
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useRef, useState } from 'react'
|
import React, { useRef, useState } from 'react'
|
||||||
import { Animated, LayoutAnimation, ScrollView } from 'react-native'
|
import { Animated, ScrollView } from 'react-native'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
|
|
||||||
import { getLocalUrl } from '@utils/slices/instancesSlice'
|
import { getLocalUrl } from '@utils/slices/instancesSlice'
|
||||||
@ -12,9 +12,10 @@ import Logout from '@screens/Me/Root/Logout'
|
|||||||
import { useScrollToTop } from '@react-navigation/native'
|
import { useScrollToTop } from '@react-navigation/native'
|
||||||
import { AccountState } from '../Shared/Account'
|
import { AccountState } from '../Shared/Account'
|
||||||
import AccountNav from '../Shared/Account/Nav'
|
import AccountNav from '../Shared/Account/Nav'
|
||||||
|
import layoutAnimation from '@root/utils/styles/layoutAnimation'
|
||||||
|
|
||||||
const ScreenMeRoot: React.FC = () => {
|
const ScreenMeRoot: React.FC = () => {
|
||||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
layoutAnimation()
|
||||||
const localRegistered = useSelector(getLocalUrl)
|
const localRegistered = useSelector(getLocalUrl)
|
||||||
|
|
||||||
const scrollRef = useRef<ScrollView>(null)
|
const scrollRef = useRef<ScrollView>(null)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useReducer, useRef, useState } from 'react'
|
import React, { useEffect, useReducer, useRef, useState } from 'react'
|
||||||
import { Animated, LayoutAnimation, ScrollView } from 'react-native'
|
import { Animated, ScrollView } from 'react-native'
|
||||||
|
|
||||||
import { useQuery } from 'react-query'
|
import { useQuery } from 'react-query'
|
||||||
import { accountFetch } from '@utils/fetches/accountFetch'
|
import { accountFetch } from '@utils/fetches/accountFetch'
|
||||||
@ -13,6 +13,7 @@ import BottomSheet from '@root/components/BottomSheet'
|
|||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { getLocalAccountId } from '@root/utils/slices/instancesSlice'
|
import { getLocalAccountId } from '@root/utils/slices/instancesSlice'
|
||||||
import HeaderDefaultActionsAccount from '@root/components/Timelines/Timeline/Shared/HeaderDefault/ActionsAccount'
|
import HeaderDefaultActionsAccount from '@root/components/Timelines/Timeline/Shared/HeaderDefault/ActionsAccount'
|
||||||
|
import layoutAnimation from '@root/utils/styles/layoutAnimation'
|
||||||
|
|
||||||
// Moved account example: https://m.cmx.im/web/accounts/27812
|
// Moved account example: https://m.cmx.im/web/accounts/27812
|
||||||
|
|
||||||
@ -73,7 +74,7 @@ const ScreenSharedAccount: React.FC<Props> = ({
|
|||||||
},
|
},
|
||||||
navigation
|
navigation
|
||||||
}) => {
|
}) => {
|
||||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
layoutAnimation()
|
||||||
const localAccountId = useSelector(getLocalAccountId)
|
const localAccountId = useSelector(getLocalAccountId)
|
||||||
const { data } = useQuery(['Account', { id: account.id }], accountFetch)
|
const { data } = useQuery(['Account', { id: account.id }], accountFetch)
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import React, {
|
|||||||
Dispatch,
|
Dispatch,
|
||||||
ReactNode,
|
ReactNode,
|
||||||
RefObject,
|
RefObject,
|
||||||
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useReducer,
|
useReducer,
|
||||||
useState
|
useState
|
||||||
@ -13,7 +14,6 @@ import {
|
|||||||
Alert,
|
Alert,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
LayoutAnimation,
|
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
TextInput
|
TextInput
|
||||||
@ -333,7 +333,6 @@ export interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
||||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
@ -538,6 +537,53 @@ const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
|||||||
edit: '发嘟嘟'
|
edit: '发嘟嘟'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const headerLeft = useCallback(
|
||||||
|
() => (
|
||||||
|
<HeaderLeft
|
||||||
|
onPress={() =>
|
||||||
|
Alert.alert('确认取消编辑?', '', [
|
||||||
|
{ text: '继续编辑', style: 'cancel' },
|
||||||
|
{
|
||||||
|
text: '退出编辑',
|
||||||
|
style: 'destructive',
|
||||||
|
onPress: () => navigation.goBack()
|
||||||
|
}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
text='退出编辑'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
const headerCenter = useCallback(
|
||||||
|
() => (
|
||||||
|
<Text
|
||||||
|
style={[
|
||||||
|
styles.count,
|
||||||
|
{
|
||||||
|
color: totalTextCount > 500 ? theme.red : theme.secondary
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
{totalTextCount} / 500
|
||||||
|
</Text>
|
||||||
|
),
|
||||||
|
[totalTextCount]
|
||||||
|
)
|
||||||
|
const headerRight = useCallback(
|
||||||
|
() =>
|
||||||
|
isSubmitting ? (
|
||||||
|
<ActivityIndicator />
|
||||||
|
) : (
|
||||||
|
<HeaderRight
|
||||||
|
onPress={async () => tootPost()}
|
||||||
|
text={params?.type ? postButtonText[params.type] : '发嘟嘟'}
|
||||||
|
disabled={rawCount < 1 || totalTextCount > 500}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
[isSubmitting, rawCount, totalTextCount]
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView behavior='padding' style={{ flex: 1 }}>
|
<KeyboardAvoidingView behavior='padding' style={{ flex: 1 }}>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
@ -547,45 +593,7 @@ const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
|||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name='PostMain'
|
name='PostMain'
|
||||||
options={{
|
options={{ headerLeft, headerCenter, headerRight }}
|
||||||
headerLeft: () => (
|
|
||||||
<HeaderLeft
|
|
||||||
onPress={() =>
|
|
||||||
Alert.alert('确认取消编辑?', '', [
|
|
||||||
{ text: '继续编辑', style: 'cancel' },
|
|
||||||
{
|
|
||||||
text: '退出编辑',
|
|
||||||
style: 'destructive',
|
|
||||||
onPress: () => navigation.goBack()
|
|
||||||
}
|
|
||||||
])
|
|
||||||
}
|
|
||||||
text='退出编辑'
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
headerCenter: () => (
|
|
||||||
<Text
|
|
||||||
style={[
|
|
||||||
styles.count,
|
|
||||||
{
|
|
||||||
color: totalTextCount > 500 ? theme.red : theme.secondary
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{totalTextCount} / 500
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
headerRight: () =>
|
|
||||||
isSubmitting ? (
|
|
||||||
<ActivityIndicator />
|
|
||||||
) : (
|
|
||||||
<HeaderRight
|
|
||||||
onPress={async () => tootPost()}
|
|
||||||
text={params?.type ? postButtonText[params.type] : '发嘟嘟'}
|
|
||||||
disabled={rawCount < 1 || totalTextCount > 500}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{() => (
|
{() => (
|
||||||
<ComposeContext.Provider
|
<ComposeContext.Provider
|
||||||
|
Reference in New Issue
Block a user