All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m24s
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import Constants from "expo-constants";
|
|
import { Link } from "expo-router";
|
|
import { Text, View } from "react-native";
|
|
import { useServerStore } from "../hooks/useServerCheck";
|
|
|
|
export function GlobalFooter() {
|
|
const build = Constants.expoConfig?.android?.versionCode ?? 1;
|
|
const serverVersion = useServerStore((s) => s.serverVersion);
|
|
const hasUpdate =
|
|
serverVersion && serverVersion?.minSupportedVersionCode > build;
|
|
const shouldUpdate = serverVersion && serverVersion?.versionCode > build;
|
|
|
|
if (serverVersion && serverVersion?.versionCode <= build) return;
|
|
return (
|
|
<View>
|
|
<View>
|
|
{hasUpdate && (
|
|
<View className="items-center h-[75px] bg-[#EB091A]">
|
|
<Link href={"/updateScreen"}>
|
|
<Text className="h-[75px] font-medium text-base text-wrap text-center">
|
|
Critical updates pending, once you are completed with your task
|
|
please click me for instructions to update
|
|
</Text>
|
|
</Link>
|
|
</View>
|
|
)}
|
|
|
|
{!hasUpdate && shouldUpdate && (
|
|
<View className="bg-[#FDBA74]">
|
|
<Link href={"/updateScreen"}>
|
|
<Text className="h-[32] font-medium text-lg text-wrap text-center">
|
|
There is an update click me for instructions
|
|
</Text>
|
|
</Link>
|
|
</View>
|
|
)}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|