Skip to content

Commit

Permalink
feat: add latest version download url
Browse files Browse the repository at this point in the history
  • Loading branch information
xianshenglu committed Mar 8, 2023
1 parent 8614814 commit 52e9ad5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lang/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"title": "Update available",
"optionalUpdateMessage": "An update is available. Would you like to install it?",
"optionalInstallButtonLabel": "Install",
"optionalIgnoreButtonLabel ": "Ignore"
"optionalIgnoreButtonLabel ": "Ignore",
"downloadLatestVersion": "Download latest version"
}
}
3 changes: 2 additions & 1 deletion lang/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"title": "发现新版本",
"optionalUpdateMessage": "有新版本可用,你想安装吗?",
"optionalInstallButtonLabel": "安装",
"optionalIgnoreButtonLabel": "忽略"
"optionalIgnoreButtonLabel": "忽略",
"downloadLatestVersion": "下载最新版本"
}
}
25 changes: 17 additions & 8 deletions screens/ModalScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import { StatusBar } from 'expo-status-bar';
import { Platform, StyleSheet } from 'react-native';
import { AppI18n } from "@/localize";
import { APP_THEME } from "@/theme";
import { StatusBar } from "expo-status-bar";
import { Platform, StyleSheet, Linking, Pressable } from "react-native";

import { Text, View } from '../components/Themed';
import { Text, View } from "../components/Themed";

export default function ModalScreen() {
const latestVersionUrl =
"https://github.com/xianshenglu/cloudflare-ip-tester-app/releases/latest/download/app-universal-release-signed.apk";
return (
<View style={styles.container}>
<Text style={styles.title}>Modal</Text>
<Text style={styles.title}>Help</Text>
<View
style={styles.separator}
lightColor="#eee"
darkColor="rgba(255,255,255,0.1)"
/>
{/* <TestPage path="/screens/ModalScreen.tsx" /> */}
<Pressable onPress={() => Linking.openURL(latestVersionUrl)}>
<Text style={{ color: APP_THEME.colors.primary, fontSize: 16 }}>
{AppI18n.t("update.downloadLatestVersion")}
</Text>
</Pressable>

{/* Use a light status bar on iOS to account for the black space above the modal */}
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
Expand All @@ -23,16 +32,16 @@ export default function ModalScreen() {
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
alignItems: "center",
justifyContent: "center",
},
title: {
fontSize: 20,
fontWeight: 'bold',
fontWeight: "bold",
},
separator: {
marginVertical: 30,
height: 1,
width: '80%',
width: "80%",
},
});

0 comments on commit 52e9ad5

Please sign in to comment.