- 添加生产环境服务器地址配置支持内外网切换 - 实现采购列表只看我创建的功能开关 - 更新构建脚本中的默认生产环境API地址 - 优化采购单表格单元格编辑体验改用自动补全组件 - 调整应用更新检查逻辑增强生产环境兼容性 - 修复开发服务器切换时的一些验证问题 - 增强应用启动时的服务地址配置灵活性
18 lines
1.4 KiB
TypeScript
18 lines
1.4 KiB
TypeScript
import {Text} from './typography';
|
||
import React from 'react';
|
||
import {Modal,ScrollView,View} from 'react-native';
|
||
import {Button,Note,useTheme} from './ui';
|
||
import type {UpdateView} from './core/updates';
|
||
import {UpdateNotes} from './UpdateNotes';
|
||
|
||
export function AppUpdateDialog({view,later,restart}:{view:UpdateView;later:()=>void;restart:()=>void}){
|
||
const t=useTheme();if(!view.visible)return null;
|
||
return <Modal transparent visible animationType="fade" onRequestClose={later}><View style={{flex:1,backgroundColor:'#0008',justifyContent:'center',alignItems:'center',padding:24}}><View accessibilityViewIsModal accessibilityRole="alert" style={{width:'100%',maxWidth:380,maxHeight:'85%',borderRadius:20,backgroundColor:t.card,padding:22,gap:16}}>
|
||
<ScrollView contentContainerStyle={{gap:12}}>
|
||
<Text style={{fontSize:18,lineHeight:25,fontWeight:'700',color:t.text}}>发现新版本</Text><UpdateNotes notes={view.notes}/><Note>更新已下载,重启后生效。请先保存当前内容,未提交的内容不会保留。</Note>
|
||
{!!view.error&&<Text accessibilityRole="alert" style={{color:'#c64650',fontSize:14,lineHeight:21}}>{view.error}</Text>}
|
||
</ScrollView>
|
||
<View style={{gap:9}}><Button title={view.restarting?'正在重启…':'重启并更新'} busy={view.restarting} onPress={restart}/><Button title="稍后再说" secondary disabled={view.restarting} onPress={later}/></View>
|
||
</View></View></Modal>;
|
||
}
|