about summary refs log tree commit diff
path: root/src/view/screens/Log.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-08-25 19:25:02 +0300
committerGitHub <noreply@github.com>2025-08-25 19:25:02 +0300
commit3810b29fb6f6bf217da93e3510d9ebad851f7f11 (patch)
treed5fb2b22a5eaf6c4e3ebd67dfab168238a2af221 /src/view/screens/Log.tsx
parent9d77b361fe67c0082452265d293c94e277e29aae (diff)
downloadvoidsky-3810b29fb6f6bf217da93e3510d9ebad851f7f11.tar.zst
ALF log screen (#8845)
Diffstat (limited to 'src/view/screens/Log.tsx')
-rw-r--r--src/view/screens/Log.tsx116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/view/screens/Log.tsx b/src/view/screens/Log.tsx
deleted file mode 100644
index 026319baf..000000000
--- a/src/view/screens/Log.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-import React from 'react'
-import {StyleSheet, TouchableOpacity, View} from 'react-native'
-import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
-import {msg} from '@lingui/macro'
-import {useLingui} from '@lingui/react'
-import {useFocusEffect} from '@react-navigation/native'
-
-import {usePalette} from '#/lib/hooks/usePalette'
-import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
-import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
-import {s} from '#/lib/styles'
-import {getEntries} from '#/logger/logDump'
-import {useTickEveryMinute} from '#/state/shell'
-import {useSetMinimalShellMode} from '#/state/shell'
-import {Text} from '#/view/com/util/text/Text'
-import {ViewHeader} from '#/view/com/util/ViewHeader'
-import {ScrollView} from '#/view/com/util/Views'
-import * as Layout from '#/components/Layout'
-
-export function LogScreen({}: NativeStackScreenProps<
-  CommonNavigatorParams,
-  'Log'
->) {
-  const pal = usePalette('default')
-  const {_} = useLingui()
-  const setMinimalShellMode = useSetMinimalShellMode()
-  const [expanded, setExpanded] = React.useState<string[]>([])
-  const timeAgo = useGetTimeAgo()
-  const tick = useTickEveryMinute()
-
-  useFocusEffect(
-    React.useCallback(() => {
-      setMinimalShellMode(false)
-    }, [setMinimalShellMode]),
-  )
-
-  const toggler = (id: string) => () => {
-    if (expanded.includes(id)) {
-      setExpanded(expanded.filter(v => v !== id))
-    } else {
-      setExpanded([...expanded, id])
-    }
-  }
-
-  return (
-    <Layout.Screen>
-      <ViewHeader title="Log" />
-      <ScrollView style={s.flex1}>
-        {getEntries()
-          .slice(0)
-          .map(entry => {
-            return (
-              <View key={`entry-${entry.id}`}>
-                <TouchableOpacity
-                  style={[styles.entry, pal.border, pal.view]}
-                  onPress={toggler(entry.id)}
-                  accessibilityLabel={_(msg`View debug entry`)}
-                  accessibilityHint={_(
-                    msg`Opens additional details for a debug entry`,
-                  )}>
-                  {entry.level === 'debug' ? (
-                    <FontAwesomeIcon icon="info" />
-                  ) : (
-                    <FontAwesomeIcon icon="exclamation" style={s.red3} />
-                  )}
-                  <Text type="sm" style={[styles.summary, pal.text]}>
-                    {String(entry.message)}
-                  </Text>
-                  {entry.metadata && Object.keys(entry.metadata).length ? (
-                    <FontAwesomeIcon
-                      icon={
-                        expanded.includes(entry.id) ? 'angle-up' : 'angle-down'
-                      }
-                      style={s.mr5}
-                    />
-                  ) : undefined}
-                  <Text type="sm" style={[styles.ts, pal.textLight]}>
-                    {timeAgo(entry.timestamp, tick)}
-                  </Text>
-                </TouchableOpacity>
-                {expanded.includes(entry.id) ? (
-                  <View style={[pal.view, s.pl10, s.pr10, s.pb10]}>
-                    <View style={[pal.btn, styles.details]}>
-                      <Text type="mono" style={pal.text}>
-                        {JSON.stringify(entry.metadata, null, 2)}
-                      </Text>
-                    </View>
-                  </View>
-                ) : undefined}
-              </View>
-            )
-          })}
-        <View style={s.footerSpacer} />
-      </ScrollView>
-    </Layout.Screen>
-  )
-}
-
-const styles = StyleSheet.create({
-  entry: {
-    flexDirection: 'row',
-    borderTopWidth: 1,
-    paddingVertical: 10,
-    paddingHorizontal: 6,
-  },
-  summary: {
-    flex: 1,
-  },
-  ts: {
-    width: 40,
-  },
-  details: {
-    paddingVertical: 10,
-    paddingHorizontal: 6,
-  },
-})