about summary refs log tree commit diff
path: root/src/screens/Settings/AboutSettings.tsx
diff options
context:
space:
mode:
authorTom Sherman <the.tomsherman@gmail.com>2025-02-13 01:11:13 +0000
committerGitHub <noreply@github.com>2025-02-13 01:11:13 +0000
commitd56efe250e8b83930d71793c44e6ba58cdecdaf4 (patch)
tree8cb6557b76e70c7c6b144f1694be9b1f822deb38 /src/screens/Settings/AboutSettings.tsx
parentdb25f95c33121da9d04a02dc2e77929a5d24a5ce (diff)
downloadvoidsky-d56efe250e8b83930d71793c44e6ba58cdecdaf4.tar.zst
Add dev mode for easy copying of at:// URIs and DIDs (#7723)
* Add dev mode for easy copying at:// URIs and DIDs

* Use storage API

* Share text instead of URL

* Cleanup persisted schema

* Change translation msg
Diffstat (limited to 'src/screens/Settings/AboutSettings.tsx')
-rw-r--r--src/screens/Settings/AboutSettings.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/screens/Settings/AboutSettings.tsx b/src/screens/Settings/AboutSettings.tsx
index 92ba2c1be..4d009281d 100644
--- a/src/screens/Settings/AboutSettings.tsx
+++ b/src/screens/Settings/AboutSettings.tsx
@@ -7,6 +7,7 @@ import {NativeStackScreenProps} from '@react-navigation/native-stack'
 import {appVersion, BUNDLE_DATE, bundleInfo} from '#/lib/app-info'
 import {STATUS_PAGE_URL} from '#/lib/constants'
 import {CommonNavigatorParams} from '#/lib/routes/types'
+import {useDevModeEnabled} from '#/state/preferences/dev-mode'
 import * as Toast from '#/view/com/util/Toast'
 import * as SettingsList from '#/screens/Settings/components/SettingsList'
 import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines'
@@ -18,6 +19,7 @@ import * as Layout from '#/components/Layout'
 type Props = NativeStackScreenProps<CommonNavigatorParams, 'AboutSettings'>
 export function AboutSettingsScreen({}: Props) {
   const {_} = useLingui()
+  const [devModeEnabled, setDevModeEnabled] = useDevModeEnabled()
 
   return (
     <Layout.Screen>
@@ -66,6 +68,15 @@ export function AboutSettingsScreen({}: Props) {
           <SettingsList.PressableItem
             label={_(msg`Version ${appVersion}`)}
             accessibilityHint={_(msg`Copies build version to clipboard`)}
+            onLongPress={() => {
+              const newDevModeEnabled = !devModeEnabled
+              setDevModeEnabled(newDevModeEnabled)
+              Toast.show(
+                newDevModeEnabled
+                  ? _(msg`Developer mode enabled`)
+                  : _(msg`Developer mode disabled`),
+              )
+            }}
             onPress={() => {
               setStringAsync(
                 `Build version: ${appVersion}; Bundle info: ${bundleInfo}; Bundle date: ${BUNDLE_DATE}; Platform: ${Platform.OS}; Platform version: ${Platform.Version}`,