forked from expo/react-conf-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildDetails.tsx
43 lines (37 loc) · 1.22 KB
/
BuildDetails.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import * as Application from "expo-application";
import { View, StyleSheet } from "react-native";
import { ThemedText } from "./Themed";
import { useReactConfStore } from "@/store/reactConfStore";
import { theme } from "@/theme";
import { formatFullDate } from "@/utils/formatDate";
import { useUpdates } from "expo-updates";
export function BuildDetails() {
const lastRefreshed = useReactConfStore((state) => state.lastRefreshed);
const updates = useUpdates();
const currentUpdateId = updates?.currentlyRunning?.updateId;
return (
<View style={styles.container}>
<ThemedText fontSize={12}>
v{Application.nativeApplicationVersion} (
{Application.nativeBuildVersion})
</ThemedText>
<ThemedText fontSize={12}>
Schedule last refreshed:{" "}
{lastRefreshed ? formatFullDate(lastRefreshed) : "Never"}
</ThemedText>
{currentUpdateId ? (
<ThemedText fontSize={12} style={{ color: theme.colorGrey }}>
{currentUpdateId}
</ThemedText>
) : null}
</View>
);
}
const styles = StyleSheet.create({
container: {
justifyContent: "center",
alignItems: "center",
paddingTop: theme.space12,
paddingBottom: theme.space8,
},
});