feat: 更新HotUpdate组件样式;添加路由工具函数

This commit is contained in:
康猛 2025-12-31 11:53:07 +08:00
parent a193c09664
commit 465f3e4366
2 changed files with 25 additions and 4 deletions

View File

@ -81,13 +81,13 @@ export const HotUpdate = () => {
if (!showUpdate) return null if (!showUpdate) return null
return ( return (
<Block className="p-[10px]"> <Block className="bg-white p-[10px]">
<ProgressLine className="h-[5px] w-full" progress={downloadProgress} progressClassName="h-[5px]" /> <ProgressLine className="h-[5px] w-full" progress={downloadProgress} progressClassName="h-[5px]" />
<Block className="mt-1 flex-row items-center justify-between px-1"> <Block className="mt-1 flex-row items-center justify-between bg-white px-1">
<Text className="text-[12px]"> <Text className="text-[12px] text-black">
{isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'} {isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'}
</Text> </Text>
<Text className="text-[12px]">{downloadProgress}%</Text> <Text className="text-[12px] text-black">{downloadProgress}%</Text>
</Block> </Block>
</Block> </Block>
) )

View File

@ -1,4 +1,25 @@
import { router } from 'expo-router'
import { Dimensions } from 'react-native' import { Dimensions } from 'react-native'
export const screenWidth = Dimensions.get('window').width export const screenWidth = Dimensions.get('window').width
export const screenHeight = Dimensions.get('window').height export const screenHeight = Dimensions.get('window').height
export const push = (path: string, params?: Record<string, string | number>) => {
const params2 = params || {}
router.push({
pathname: path as any,
params: params2,
})
}
export const replace = (path: string, params?: Record<string, string | number>) => {
const params2 = params || {}
router.replace({
pathname: path as any,
params: params2,
})
}
export const goBack = () => {
router.back()
}