From 82c2db119097a7f44cb9db776c30eef703e3bc44 Mon Sep 17 00:00:00 2001 From: czy0729 <402731062@qq.com> Date: Tue, 21 May 2024 20:21:00 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E5=AE=89=E5=8D=93]=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@/ant-design/modal/blur-view/index.tsx | 2 +- .../@/ant-design/toast/blur-view/index.tsx | 2 +- src/components/blur-view/index.tsx | 3 ++- src/components/cover/utils.ts | 2 ++ .../fixed-textarea/container/index.tsx | 6 +++++- .../hardware-texture-blur-view/index.tsx | 2 +- src/components/header/transition/index.tsx | 11 +++++++++-- src/components/image-viewer/index.tsx | 16 +--------------- src/components/storybook/bottom-tab/index.tsx | 6 +++++- src/screens/_/base/blur-view/index.tsx | 2 +- .../vib/component/block-trend/item/styles.ts | 4 ++-- src/screens/rakuen/mine/component/item/index.tsx | 7 +++---- src/screens/rakuen/topic/component/top/top.tsx | 6 ++++-- .../tinygrail/_/characters-modal/index.tsx | 7 +++---- src/screens/tinygrail/_/progress/styles.ts | 4 ++-- .../index/component/bonus-modal/index.tsx | 7 +++---- src/utils/decorators/cycles/blur-view.js | 4 ++-- src/utils/storage/ds.ts | 8 ++++---- src/utils/storage/index.ts | 4 ++-- 19 files changed, 53 insertions(+), 50 deletions(-) diff --git a/src/components/@/ant-design/modal/blur-view/index.tsx b/src/components/@/ant-design/modal/blur-view/index.tsx index 797ecd4f1..fc7dfd3e0 100644 --- a/src/components/@/ant-design/modal/blur-view/index.tsx +++ b/src/components/@/ant-design/modal/blur-view/index.tsx @@ -43,7 +43,7 @@ export const BlurView = observer(({ style, intensity = 100, children }: BlurView return ( {children} diff --git a/src/components/@/ant-design/toast/blur-view/index.tsx b/src/components/@/ant-design/toast/blur-view/index.tsx index 493caf2e4..db1893073 100644 --- a/src/components/@/ant-design/toast/blur-view/index.tsx +++ b/src/components/@/ant-design/toast/blur-view/index.tsx @@ -38,7 +38,7 @@ export const BlurView = observer(({ style, children }: Props) => { return ( {children} diff --git a/src/components/blur-view/index.tsx b/src/components/blur-view/index.tsx index d6b0a06de..81cd8da07 100644 --- a/src/components/blur-view/index.tsx +++ b/src/components/blur-view/index.tsx @@ -10,6 +10,7 @@ import React from 'react' import { StyleSheet, View } from 'react-native' import { observer } from 'mobx-react' import { BlurView as ExpoBlurView } from 'expo-blur' +import { _ } from '@stores' import { matchCoverUrl } from '@utils' import { r } from '@utils/dev' import { IOS } from '@constants' @@ -29,7 +30,7 @@ export const BlurView = observer( ({ style, src, - tint = 'extraLight', + tint = _.ios('extraLight', 'light'), intensity = 100, blurRadius = 16, children diff --git a/src/components/cover/utils.ts b/src/components/cover/utils.ts index 305c5c71a..f12675a39 100644 --- a/src/components/cover/utils.ts +++ b/src/components/cover/utils.ts @@ -10,6 +10,8 @@ import { CoverPrefix, CoverSize, Props } from './types' /** 修正封面图地址 */ export function getCoverSrc(src: Props['src'], width: number, cdn?: boolean, noDefault?: boolean) { + if (typeof src !== 'string') return src + const { prefix, size } = getCoverPramas(width) return ( getCover400(cdn !== false ? matchCoverUrl(src, noDefault, prefix) : src, size) || IMG_DEFAULT diff --git a/src/components/fixed-textarea/container/index.tsx b/src/components/fixed-textarea/container/index.tsx index 925d5934f..39cb45d2f 100644 --- a/src/components/fixed-textarea/container/index.tsx +++ b/src/components/fixed-textarea/container/index.tsx @@ -16,7 +16,11 @@ function Container({ children }) { const styles = memoStyles() if (IOS || STORYBOOK) { return ( - + {children} ) diff --git a/src/components/hardware-texture-blur-view/index.tsx b/src/components/hardware-texture-blur-view/index.tsx index 382a8ccde..c35141d8d 100644 --- a/src/components/hardware-texture-blur-view/index.tsx +++ b/src/components/hardware-texture-blur-view/index.tsx @@ -39,7 +39,7 @@ export const HardwareTextureBlurView = ({ height: _.flatten(style)?.height || '100%', ...containerStyle }} - tint={_.select('extraLight', 'dark')} + tint={_.select(_.ios('extraLight', 'light'), 'dark')} intensity={100} /> diff --git a/src/components/header/transition/index.tsx b/src/components/header/transition/index.tsx index 90993b89a..e8c32ccac 100644 --- a/src/components/header/transition/index.tsx +++ b/src/components/header/transition/index.tsx @@ -2,9 +2,9 @@ * @Author: czy0729 * @Date: 2022-03-12 20:43:41 * @Last Modified by: czy0729 - * @Last Modified time: 2024-04-09 15:23:40 + * @Last Modified time: 2024-05-21 17:30:47 */ -import React from 'react' +import React, { useEffect, useState } from 'react' import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated' import { r } from '@utils/dev' import { useObserver } from '@utils/hooks' @@ -17,6 +17,11 @@ import { Props } from './types' function Transition({ fixed, title, headerTitle }: Props) { r(COMPONENT) + const [show, setShow] = useState(fixed) + useEffect(() => { + if (!show) setShow(true) + }, [fixed, show]) + const wrapStyles = useAnimatedStyle(() => ({ opacity: withTiming(fixed ? 1 : 0, { duration: 160 @@ -33,6 +38,8 @@ function Transition({ fixed, title, headerTitle }: Props) { })) return useObserver(() => { + if (!show) return null + const styles = memoStyles() return ( diff --git a/src/components/image-viewer/index.tsx b/src/components/image-viewer/index.tsx index b4e5916a0..91551ffba 100755 --- a/src/components/image-viewer/index.tsx +++ b/src/components/image-viewer/index.tsx @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2019-05-23 18:57:26 * @Last Modified by: czy0729 - * @Last Modified time: 2024-01-14 16:34:24 + * @Last Modified time: 2024-05-21 13:22:49 */ import React from 'react' import { Modal, View } from 'react-native' @@ -14,7 +14,6 @@ import { HOST_DOGE, IOS } from '@constants' import { Component } from '../component' import RNImageViewer from '../@/react-native-image-zoom-viewer/image-viewer.component' import { Iconfont } from '../iconfont' -import { StatusBar } from '../status-bar' import { Text } from '../text' import { Touchable } from '../touchable' import { ACTION_SHEET_DS, COMPONENT } from './ds' @@ -36,19 +35,6 @@ export const ImageViewer = observer( onCancel: () => {} } - componentDidUpdate() { - if (!IOS) { - const { visible } = this.props - if (visible) { - StatusBar.setHidden(true) - } else { - setTimeout(() => { - StatusBar.setHidden(false) - }, 400) - } - } - } - onRequestClose = () => { const { onCancel } = this.props onCancel() diff --git a/src/components/storybook/bottom-tab/index.tsx b/src/components/storybook/bottom-tab/index.tsx index 03223ff74..25318654c 100644 --- a/src/components/storybook/bottom-tab/index.tsx +++ b/src/components/storybook/bottom-tab/index.tsx @@ -38,7 +38,11 @@ export const StorybookBottomTab = () => { const styles = memoStyles() return ( - + {DS.map((item: (typeof BOTTOM_TAB_WITH_AUTH_DS)[number]) => { const storyId = getSPAId(item.id) diff --git a/src/screens/_/base/blur-view/index.tsx b/src/screens/_/base/blur-view/index.tsx index 149312246..8d566eb70 100755 --- a/src/screens/_/base/blur-view/index.tsx +++ b/src/screens/_/base/blur-view/index.tsx @@ -20,7 +20,7 @@ export const BlurView = ob(({ style, intensity = 100, children, ...other }: Blur diff --git a/src/screens/discovery/vib/component/block-trend/item/styles.ts b/src/screens/discovery/vib/component/block-trend/item/styles.ts index 70da84ea0..7fae714b1 100644 --- a/src/screens/discovery/vib/component/block-trend/item/styles.ts +++ b/src/screens/discovery/vib/component/block-trend/item/styles.ts @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2024-05-03 23:08:14 * @Last Modified by: czy0729 - * @Last Modified time: 2024-05-14 06:34:31 + * @Last Modified time: 2024-05-21 17:43:33 */ import { _ } from '@stores' @@ -16,7 +16,7 @@ export const styles = _.create({ marginLeft: 40 }, reverse: { - marginTop: 4, + marginTop: _.ios(4, -1), transform: [ { rotate: '180deg' diff --git a/src/screens/rakuen/mine/component/item/index.tsx b/src/screens/rakuen/mine/component/item/index.tsx index f389501b8..cff08fe5a 100755 --- a/src/screens/rakuen/mine/component/item/index.tsx +++ b/src/screens/rakuen/mine/component/item/index.tsx @@ -2,12 +2,11 @@ * @Author: czy0729 * @Date: 2020-05-02 16:30:02 * @Last Modified by: czy0729 - * @Last Modified time: 2024-05-16 19:18:05 + * @Last Modified time: 2024-05-21 13:01:07 */ import React from 'react' import { View } from 'react-native' -import { Flex, Text, Touchable } from '@components' -import { Cover } from '@_' +import { Cover, Flex, Text, Touchable } from '@components' import { _, systemStore } from '@stores' import { getGroupThumbStatic } from '@utils' import { HOST_IMAGE } from '@utils/app/ds' @@ -46,7 +45,7 @@ function Item({ id, cover, name, num }: any, { navigation }: Ctx) { }} > - + diff --git a/src/screens/rakuen/topic/component/top/top.tsx b/src/screens/rakuen/topic/component/top/top.tsx index acc1bed7c..05164b371 100644 --- a/src/screens/rakuen/topic/component/top/top.tsx +++ b/src/screens/rakuen/topic/component/top/top.tsx @@ -108,8 +108,10 @@ const Top = memo( src={groupThumb || _.select(IMG_EMPTY, IMG_EMPTY_DARK)} radius={_.radiusXs} priority='high' - fallback - fallbackSrc={String(groupThumbFallback).replace('/r/100x100', '')} + fallback={isEp} + fallbackSrc={ + isEp ? String(groupThumbFallback).replace('/r/100x100', '') : undefined + } /> {HTMLDecode(findSubjectCn(group))} diff --git a/src/screens/tinygrail/_/characters-modal/index.tsx b/src/screens/tinygrail/_/characters-modal/index.tsx index 8c42a7f06..cf3cbcb7c 100755 --- a/src/screens/tinygrail/_/characters-modal/index.tsx +++ b/src/screens/tinygrail/_/characters-modal/index.tsx @@ -2,12 +2,12 @@ * @Author: czy0729 * @Date: 2020-06-28 14:02:31 * @Last Modified by: czy0729 - * @Last Modified time: 2024-05-01 16:13:36 + * @Last Modified time: 2024-05-21 19:42:47 */ import React from 'react' import { BackHandler, View } from 'react-native' import { computed } from 'mobx' -import { Button, Flex, Iconfont, Modal, StatusBar, Text } from '@components' +import { Button, Flex, Iconfont, Modal, Text } from '@components' import { Popover } from '@_' import { _, tinygrailStore } from '@stores' import { @@ -22,7 +22,6 @@ import { trim } from '@utils' import { obc } from '@utils/decorators' -import { IOS } from '@constants' import { calculateRate } from '../utils' import Item from './item' import ItemBottom from './item-bottom' @@ -97,7 +96,7 @@ class CharactersModal extends React.Component { this.title = nextProps.title } - if (!IOS) StatusBar.setHidden(nextProps.visible) + // if (!IOS) StatusBar.setHidden(nextProps.visible) } onBackAndroid = () => { diff --git a/src/screens/tinygrail/_/progress/styles.ts b/src/screens/tinygrail/_/progress/styles.ts index 525c28444..c8351d68e 100644 --- a/src/screens/tinygrail/_/progress/styles.ts +++ b/src/screens/tinygrail/_/progress/styles.ts @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2024-03-03 07:04:28 * @Last Modified by: czy0729 - * @Last Modified time: 2024-03-16 17:21:05 + * @Last Modified time: 2024-05-21 19:51:41 */ import { _ } from '@stores' @@ -12,7 +12,7 @@ export const memoStyles = _.memoStyles(() => ({ progress: { padding: PADDING, borderWidth: 1, - borderColor: _.tSelect('rgba(255, 255, 255, 0.36)', _.colorTinygrailBorder), + borderColor: _.select('rgba(0, 0, 0, 0.16)', _.colorTinygrailBorder), borderRadius: 8, overflow: 'hidden' }, diff --git a/src/screens/tinygrail/index/component/bonus-modal/index.tsx b/src/screens/tinygrail/index/component/bonus-modal/index.tsx index 39649a992..a418a5140 100755 --- a/src/screens/tinygrail/index/component/bonus-modal/index.tsx +++ b/src/screens/tinygrail/index/component/bonus-modal/index.tsx @@ -2,16 +2,15 @@ * @Author: czy0729 * @Date: 2020-07-30 18:10:42 * @Last Modified by: czy0729 - * @Last Modified time: 2024-03-13 08:23:44 + * @Last Modified time: 2024-05-21 19:44:39 */ import React from 'react' import { BackHandler, View } from 'react-native' -import { Button, Flex, Image, Modal, StatusBar, Text, Touchable } from '@components' +import { Button, Flex, Image, Modal, Text, Touchable } from '@components' import { _ } from '@stores' import { stl, tinygrailOSS, toFixed } from '@utils' import { obc } from '@utils/decorators' import { r } from '@utils/dev' -import { IOS } from '@constants' import { Ctx } from '../../types' import { COMPONENT } from './ds' import { memoStyles } from './styles' @@ -32,7 +31,7 @@ class BonusModal extends React.Component<{ } UNSAFE_componentWillReceiveProps(nextProps: { visible: boolean }) { - if (!IOS) StatusBar.setHidden(nextProps.visible) + // if (!IOS) StatusBar.setHidden(nextProps.visible) } onBackAndroid = () => { diff --git a/src/utils/decorators/cycles/blur-view.js b/src/utils/decorators/cycles/blur-view.js index f24e38b5a..9c9b214da 100755 --- a/src/utils/decorators/cycles/blur-view.js +++ b/src/utils/decorators/cycles/blur-view.js @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2019-11-30 15:23:07 * @Last Modified by: czy0729 - * @Last Modified time: 2024-05-10 05:40:12 + * @Last Modified time: 2024-05-21 12:57:03 */ import React from 'react' import { BlurView as ExpoBlurView } from 'expo-blur' @@ -14,7 +14,7 @@ function BlurView({ style, children }) { return ( {children} diff --git a/src/utils/storage/ds.ts b/src/utils/storage/ds.ts index b589c0c1a..18f6e9100 100644 --- a/src/utils/storage/ds.ts +++ b/src/utils/storage/ds.ts @@ -2,16 +2,16 @@ * @Author: czy0729 * @Date: 2022-09-29 20:48:57 * @Last Modified by: czy0729 - * @Last Modified time: 2023-08-03 01:35:49 + * @Last Modified time: 2024-05-21 13:32:31 */ import { STORYBOOK } from '@constants/device' import { DEV } from '@/config' -/** 本地化字符串大于此值会延迟合并再写入 */ -export const LAZY_SET_STORAGE_SIZE = 1024 +/** 本地化字符串大于此值会延迟合并再写入 (Bytes) */ +export const LAZY_SET_STORAGE_SIZE = 1024 * 20 /** 延迟写入间隔 */ -export const LAZY_SET_STORAGE_INTERVAL = STORYBOOK ? 1000 : DEV ? 6000 : 18000 +export const LAZY_SET_STORAGE_INTERVAL = STORYBOOK ? 1000 : DEV ? 6000 : 12000 /** 缓存过程中间值 */ export const CACHE_MAP = new Map() diff --git a/src/utils/storage/index.ts b/src/utils/storage/index.ts index 4ec1b2ba8..a414e28f0 100644 --- a/src/utils/storage/index.ts +++ b/src/utils/storage/index.ts @@ -4,11 +4,11 @@ * @Author: czy0729 * @Date: 2022-04-13 04:14:20 * @Last Modified by: czy0729 - * @Last Modified time: 2023-11-01 14:20:43 + * @Last Modified time: 2024-05-21 13:31:18 */ import { queue } from '../utils' import { getItem, setItem } from './utils' -import { CACHE_MAP, LAZY_SET_STORAGE_SIZE, LAZY_SET_STORAGE_INTERVAL } from './ds' +import { CACHE_MAP, LAZY_SET_STORAGE_INTERVAL, LAZY_SET_STORAGE_SIZE } from './ds' let setStorageInterval: any if (setStorageInterval) clearInterval(setStorageInterval)