diff --git a/package-lock.json b/package-lock.json index c0f582f..813edac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "devDependencies": { "@babel/core": "^7.20.0", "@react-native/eslint-config": "^0.74.0", - "@tingyuan/react-native-tailwindcss": "^0.0.15", + "@tingyuan/react-native-tailwindcss": "^0.0.16", "@types/he": "^1.2.3", "@types/react": "~18.2.14", "@types/spark-md5": "^3.0.4", @@ -7261,9 +7261,9 @@ } }, "node_modules/@tingyuan/react-native-tailwindcss": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/@tingyuan/react-native-tailwindcss/-/react-native-tailwindcss-0.0.15.tgz", - "integrity": "sha512-522IyliCuSMZBm/D7Inq4ftYzKUQTA+176cL7Ds1im8DRySd2f/lF8iKF+Tc50b8JK01PmJ5UGg+A0BlVoRlCQ==", + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@tingyuan/react-native-tailwindcss/-/react-native-tailwindcss-0.0.16.tgz", + "integrity": "sha512-HgfW6WR6zg12MqN3/CfC4VCTYnBO6Z46aepwWLJRV1rXHM1WRtlEDZaeNTxGIJoa5w9fcxkvUbXSOUpHs+OBew==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", diff --git a/package.json b/package.json index d356fa9..0d9e42d 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "devDependencies": { "@babel/core": "^7.20.0", "@react-native/eslint-config": "^0.74.0", - "@tingyuan/react-native-tailwindcss": "^0.0.15", + "@tingyuan/react-native-tailwindcss": "^0.0.16", "@types/he": "^1.2.3", "@types/react": "~18.2.14", "@types/spark-md5": "^3.0.4", diff --git a/src/routes/Dynamic/Header.tsx b/src/routes/Dynamic/Header.tsx index 90449d3..2815356 100644 --- a/src/routes/Dynamic/Header.tsx +++ b/src/routes/Dynamic/Header.tsx @@ -42,8 +42,9 @@ export function HeaderLeft(props: { scrollTop: () => void }) { const userName = dynamicUser?.name || '' // ? dynamicUser.name + level : '' const sex = dynamicUser?.sex === '男' ? '♂️' : dynamicUser?.sex === '女' ? '♀️' : '' - const { _followedUpsMap, setCheckLiveTimeStamp } = useStore() + const { _followedUpsMap, setCheckLiveTimeStamp, $blackUps } = useStore() const followed = dynamicUser?.mid && dynamicUser.mid in _followedUpsMap + const isBlackUp = dynamicUser?.mid && dynamicUser.mid in $blackUps return ( {dynamicUser?.face ? ( @@ -87,6 +88,7 @@ export function HeaderLeft(props: { scrollTop: () => void }) { className={clsx( followed && [colors.secondary.text, 'font-bold'], 'text-lg pt-1', + isBlackUp && 'line-through', )} adjustsFontSizeToFit numberOfLines={1} diff --git a/src/routes/Play/Header.tsx b/src/routes/Play/Header.tsx index e852ca8..16efe23 100644 --- a/src/routes/Play/Header.tsx +++ b/src/routes/Play/Header.tsx @@ -1,6 +1,7 @@ import { type RouteProp, useRoute } from '@react-navigation/native' import { NativeStackScreenProps } from '@react-navigation/native-stack' import { Icon, Text } from '@rneui/themed' +import clsx from 'clsx' import * as Clipboard from 'expo-clipboard' import React from 'react' import { Linking, View } from 'react-native' @@ -19,13 +20,17 @@ export function PlayHeaderTitle() { const route = useRoute>() const { data: vi } = useVideoInfo(route.params.bvid) const { data: fans } = useUserRelation(route.params?.mid || vi?.mid) - const { _followedUpsMap } = useStore() - const followed = route.params?.mid && route.params?.mid in _followedUpsMap - + const { _followedUpsMap, $blackUps } = useStore() + const followed = route.params?.mid && route.params.mid in _followedUpsMap + const isBlackUp = route.params?.mid && route.params.mid in $blackUps return ( + className={clsx( + 'text-lg font-semibold', + isBlackUp && 'line-through', + followed && colors.secondary.text, + )}> {route.params?.name || vi?.name} () - const { _followedUpsMap, set$followedUps, get$followedUps } = useStore() + const { _followedUpsMap, $blackUps, set$followedUps, get$followedUps } = + useStore() const isFollowed = props.up.mid in _followedUpsMap - + const isBlackUp = props.up.mid in $blackUps return ( {props.up.name} diff --git a/src/routes/WebPage/index.tsx b/src/routes/WebPage/index.tsx index 793ae40..96f81f8 100644 --- a/src/routes/WebPage/index.tsx +++ b/src/routes/WebPage/index.tsx @@ -10,6 +10,7 @@ import { } from 'react-native' import { WebView } from 'react-native-webview' +import useMounted from '@/hooks/useMounted' import useUpdateNavigationOptions from '@/hooks/useUpdateNavigationOptions' import { UA } from '../../constants' @@ -40,7 +41,7 @@ function WebPage({ route }: Props) { const { url, title } = route.params const webviewRef = React.useRef(null) - const { webViewMode } = useStore() + const { webViewMode, setCheckLiveTimeStamp } = useStore() const isDark = useIsDark() const [height, setHeight] = React.useState(Dimensions.get('screen').height) const [isEnabled, setEnabled] = React.useState(true) @@ -53,6 +54,13 @@ function WebPage({ route }: Props) { }) }, []), ) + useMounted(() => { + return () => { + if (url.includes('live.bilibili.com')) { + setCheckLiveTimeStamp(Date.now()) + } + } + }) useUpdateNavigationOptions( React.useMemo(() => { const headerRight = () => {