Skip to content

Commit 52e9ad5

Browse files
committed
feat: add latest version download url
1 parent 8614814 commit 52e9ad5

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

lang/en-us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"title": "Update available",
3939
"optionalUpdateMessage": "An update is available. Would you like to install it?",
4040
"optionalInstallButtonLabel": "Install",
41-
"optionalIgnoreButtonLabel ": "Ignore"
41+
"optionalIgnoreButtonLabel ": "Ignore",
42+
"downloadLatestVersion": "Download latest version"
4243
}
4344
}

lang/zh-cn.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"title": "发现新版本",
3939
"optionalUpdateMessage": "有新版本可用,你想安装吗?",
4040
"optionalInstallButtonLabel": "安装",
41-
"optionalIgnoreButtonLabel": "忽略"
41+
"optionalIgnoreButtonLabel": "忽略",
42+
"downloadLatestVersion": "下载最新版本"
4243
}
4344
}

screens/ModalScreen.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
import { StatusBar } from 'expo-status-bar';
2-
import { Platform, StyleSheet } from 'react-native';
1+
import { AppI18n } from "@/localize";
2+
import { APP_THEME } from "@/theme";
3+
import { StatusBar } from "expo-status-bar";
4+
import { Platform, StyleSheet, Linking, Pressable } from "react-native";
35

4-
import { Text, View } from '../components/Themed';
6+
import { Text, View } from "../components/Themed";
57

68
export default function ModalScreen() {
9+
const latestVersionUrl =
10+
"https://github.com/xianshenglu/cloudflare-ip-tester-app/releases/latest/download/app-universal-release-signed.apk";
711
return (
812
<View style={styles.container}>
9-
<Text style={styles.title}>Modal</Text>
13+
<Text style={styles.title}>Help</Text>
1014
<View
1115
style={styles.separator}
1216
lightColor="#eee"
1317
darkColor="rgba(255,255,255,0.1)"
1418
/>
1519
{/* <TestPage path="/screens/ModalScreen.tsx" /> */}
20+
<Pressable onPress={() => Linking.openURL(latestVersionUrl)}>
21+
<Text style={{ color: APP_THEME.colors.primary, fontSize: 16 }}>
22+
{AppI18n.t("update.downloadLatestVersion")}
23+
</Text>
24+
</Pressable>
1625

1726
{/* Use a light status bar on iOS to account for the black space above the modal */}
1827
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
@@ -23,16 +32,16 @@ export default function ModalScreen() {
2332
const styles = StyleSheet.create({
2433
container: {
2534
flex: 1,
26-
alignItems: 'center',
27-
justifyContent: 'center',
35+
alignItems: "center",
36+
justifyContent: "center",
2837
},
2938
title: {
3039
fontSize: 20,
31-
fontWeight: 'bold',
40+
fontWeight: "bold",
3241
},
3342
separator: {
3443
marginVertical: 30,
3544
height: 1,
36-
width: '80%',
45+
width: "80%",
3746
},
3847
});

0 commit comments

Comments
 (0)