This commit is contained in:
eric
2026-03-26 00:48:14 -05:00
parent f16a8a9255
commit aba40c8cb7
9 changed files with 1496 additions and 60 deletions

View File

@@ -1,7 +1,8 @@
import { useCallback, useEffect, useState } from 'react'
import { View, Text, ScrollView, StyleSheet, RefreshControl } from 'react-native'
import { View, Text, ScrollView, StyleSheet, RefreshControl, Pressable } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import { UserAgreementModal } from '@/components/UserAgreementModal'
import { useBind } from '@/context/BindContext'
import { apiFetch } from '@/lib/api'
import type { SystemMetricsPayload } from '@/lib/pcTypes'
@@ -20,6 +21,7 @@ export default function SystemScreen() {
const [data, setData] = useState<SystemMetricsPayload | null>(null)
const [err, setErr] = useState<string | null>(null)
const [refreshing, setRefreshing] = useState(false)
const [agreementOpen, setAgreementOpen] = useState(false)
const load = useCallback(async () => {
if (!bind) {
@@ -147,8 +149,12 @@ export default function SystemScreen() {
<View style={styles.cardMuted}>
<Text style={styles.cardTitle}></Text>
<Text style={styles.muted}> Electron </Text>
<Pressable style={styles.agreementRow} onPress={() => setAgreementOpen(true)} hitSlop={8}>
<Text style={styles.agreementLink}></Text>
</Pressable>
</View>
</ScrollView>
<UserAgreementModal visible={agreementOpen} onClose={() => setAgreementOpen(false)} />
</SafeAreaView>
)
}
@@ -205,4 +211,6 @@ const styles = StyleSheet.create({
ffSec: { marginTop: 12 },
ffLine: { fontSize: 12, color: theme.muted, marginBottom: 4, fontFamily: 'monospace' },
muted: { fontSize: 13, color: theme.muted, lineHeight: 20 },
agreementRow: { marginTop: 10, alignSelf: 'flex-start' },
agreementLink: { fontSize: 12, color: theme.accent, textDecorationLine: 'underline' },
})