diff --git a/src/Index.tsx b/src/Index.tsx index a7291c10..e10ad21a 100644 --- a/src/Index.tsx +++ b/src/Index.tsx @@ -171,7 +171,7 @@ export const Index: React.FC = ({ localCorrupt }) => { })} tabBarOptions={{ activeTintColor: theme.primary, - inactiveTintColor: theme.secondary, + inactiveTintColor: localInstance ? theme.secondary : theme.disabled, showLabel: false }} > @@ -182,11 +182,6 @@ export const Index: React.FC = ({ localCorrupt }) => { tabPress: e => { if (!localInstance) { e.preventDefault() - toast({ - type: 'error', - content: '请先登录', - onHide: () => navigation.navigate('Screen-Me') - }) } } })} @@ -201,12 +196,6 @@ export const Index: React.FC = ({ localCorrupt }) => { navigation.navigate(getCurrentTab(navigation), { screen: 'Screen-Shared-Compose' }) - } else { - toast({ - type: 'error', - content: '请先登录', - onHide: () => navigation.navigate('Screen-Me') - }) } } })} @@ -224,15 +213,10 @@ export const Index: React.FC = ({ localCorrupt }) => { backgroundColor: theme.red } }} - listeners={({ navigation }) => ({ + listeners={() => ({ tabPress: e => { if (!localInstance) { e.preventDefault() - toast({ - type: 'error', - content: '请先登录', - onHide: () => navigation.navigate('Screen-Me') - }) } } })} diff --git a/src/components/Menu/Button.tsx b/src/components/Menu/Button.tsx index 6dc137df..d072ba5e 100644 --- a/src/components/Menu/Button.tsx +++ b/src/components/Menu/Button.tsx @@ -27,7 +27,12 @@ const Core: React.FC = ({ text, destructive = false }) => { return ( - + {text} diff --git a/src/components/ParseContent.tsx b/src/components/ParseContent.tsx index 3bdeb751..cda6231a 100644 --- a/src/components/ParseContent.tsx +++ b/src/components/ParseContent.tsx @@ -8,7 +8,6 @@ import { useTheme } from '@utils/styles/ThemeManager' import { Feather } from '@expo/vector-icons' import { StyleConstants } from '@utils/styles/constants' import openLink from '@root/utils/openLink' -import layoutAnimation from '@root/utils/styles/layoutAnimation' // Prevent going to the same hashtag multiple times const renderNode = ({ @@ -154,7 +153,6 @@ const ParseContent: React.FC = ({ } }, []) const rootComponent = useCallback(({ children }) => { - // layoutAnimation() const lineHeight = StyleConstants.Font.LineHeight[size] const [heightOriginal, setHeightOriginal] = useState() @@ -200,7 +198,9 @@ const ParseContent: React.FC = ({ /> {allowExpand && ( setShowAllText(!showAllText)} + onPress={() => { + setShowAllText(!showAllText) + }} style={{ marginTop: showAllText ? 0 : -lineHeight * 1.25 }} > = ({ }) }, []) const onPressReblog = useCallback(() => { - if (status.visibility === 'private' || status.visibility === 'direct') { - console.log('awjerio') - toast({ type: 'error', content: '禁止转发' }) - } else { + if (status.visibility !== 'private' && status.visibility !== 'direct') { mutate({ id: status.id, type: 'reblog', @@ -221,7 +218,11 @@ const TimelineActions: React.FC = ({ () => ( ), diff --git a/src/components/Timelines/Timeline/Shared/Attachment.tsx b/src/components/Timelines/Timeline/Shared/Attachment.tsx index 9ca24bfd..53a39eb4 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment.tsx @@ -10,6 +10,7 @@ import { useNavigation } from '@react-navigation/native' import AttachmentUnsupported from './Attachment/Unsupported' import AttachmentAudio from './Attachment/Audio' import { Feather } from '@expo/vector-icons' +import layoutAnimation from '@root/utils/styles/layoutAnimation' export interface Props { status: Pick @@ -21,6 +22,7 @@ const TimelineAttachment: React.FC = ({ status, contentWidth }) => { const [sensitiveShown, setSensitiveShown] = useState(status.sensitive) const onPressBlurView = useCallback(() => { + layoutAnimation() setSensitiveShown(false) }, []) diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx index 575ae380..5f93a4d2 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx @@ -2,7 +2,6 @@ import React, { useCallback, useState } from 'react' import { Image, Pressable, StyleSheet, View } from 'react-native' import { Audio } from 'expo-av' import { ButtonRow } from '@components/Button' -import layoutAnimation from '@root/utils/styles/layoutAnimation' import { Surface } from 'gl-react-expo' import { Blurhash } from 'gl-react-blurhash' import Slider from '@react-native-community/slider' @@ -15,8 +14,6 @@ export interface Props { } const AttachmentAudio: React.FC = ({ sensitiveShown, audio }) => { - layoutAnimation() - const { theme } = useTheme() const [audioPlayer, setAudioPlayer] = useState() @@ -93,8 +90,8 @@ const AttachmentAudio: React.FC = ({ sensitiveShown, audio }) => { minimumValue={0} maximumValue={audio.meta.original.duration * 1000} value={audioPosition} - minimumTrackTintColor={theme.primary} - maximumTrackTintColor={theme.secondary} + minimumTrackTintColor={theme.secondary} + maximumTrackTintColor={theme.disabled} onSlidingStart={() => { audioPlayer?.pauseAsync() setAudioPlaying(false) diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Image.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Image.tsx index b39df126..15719120 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Image.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Image.tsx @@ -3,7 +3,6 @@ import { Blurhash } from 'gl-react-blurhash' import React, { useCallback, useEffect, useState } from 'react' import { Image, StyleSheet, Pressable } from 'react-native' import { StyleConstants } from '@utils/styles/constants' -import layoutAnimation from '@root/utils/styles/layoutAnimation' export interface Props { sensitiveShown: boolean @@ -18,8 +17,6 @@ const AttachmentImage: React.FC = ({ imageIndex, navigateToImagesViewer }) => { - layoutAnimation() - let isMounted = false useEffect(() => { isMounted = true diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx b/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx index 5125a2ce..6e9280e5 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx +++ b/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx @@ -2,7 +2,6 @@ import React, { useCallback, useRef, useState } from 'react' import { Pressable, StyleSheet } from 'react-native' import { Video } from 'expo-av' import { ButtonRow } from '@components/Button' -import layoutAnimation from '@root/utils/styles/layoutAnimation' import { Surface } from 'gl-react-expo' import { Blurhash } from 'gl-react-blurhash' @@ -19,8 +18,6 @@ const AttachmentVideo: React.FC = ({ width, height }) => { - layoutAnimation() - const videoPlayer = useRef