feat: 更新HotUpdate组件样式;添加路由工具函数
This commit is contained in:
parent
a193c09664
commit
465f3e4366
|
|
@ -81,13 +81,13 @@ export const HotUpdate = () => {
|
|||
|
||||
if (!showUpdate) return null
|
||||
return (
|
||||
<Block className="p-[10px]">
|
||||
<Block className="bg-white p-[10px]">
|
||||
<ProgressLine className="h-[5px] w-full" progress={downloadProgress} progressClassName="h-[5px]" />
|
||||
<Block className="mt-1 flex-row items-center justify-between px-1">
|
||||
<Text className="text-[12px]">
|
||||
<Block className="mt-1 flex-row items-center justify-between bg-white px-1">
|
||||
<Text className="text-[12px] text-black">
|
||||
{isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'}
|
||||
</Text>
|
||||
<Text className="text-[12px]">{downloadProgress}%</Text>
|
||||
<Text className="text-[12px] text-black">{downloadProgress}%</Text>
|
||||
</Block>
|
||||
</Block>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,25 @@
|
|||
import { router } from 'expo-router'
|
||||
import { Dimensions } from 'react-native'
|
||||
|
||||
export const screenWidth = Dimensions.get('window').width
|
||||
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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue