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:
Tom Sherman
2025-02-13 01:11:13 +00:00
committed by GitHub
parent db25f95c33
commit d56efe250e
6 changed files with 106 additions and 2 deletions
+16
View File
@@ -25,3 +25,19 @@ export async function shareUrl(url: string) {
Toast.show(t`Copied to clipboard`, 'clipboard-check')
}
}
/**
* This function shares a text using the native Share API if available, or copies it to the clipboard
* and displays a toast message if not (mostly on web)
*
* @param {string} text - A string representing the text that needs to be shared or copied to the
* clipboard.
*/
export async function shareText(text: string) {
if (isAndroid || isIOS) {
await Share.share({message: text})
} else {
await setStringAsync(text)
Toast.show(t`Copied to clipboard`, 'clipboard-check')
}
}