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
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user