align web and mobile qr code styles

This commit is contained in:
Hailey
2024-06-13 13:43:11 -07:00
parent 9655947a1b
commit 740a8ea1b4
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -6,6 +6,7 @@ import {AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
import {Trans} from '@lingui/macro'
import {makeStarterPackLink} from 'lib/routes/links'
import {isWeb} from 'platform/detection'
import {Logo} from 'view/icons/Logo'
import {Logotype} from 'view/icons/Logotype'
import {useTheme} from '#/alf'
@@ -86,12 +87,12 @@ export function QrCodeInner({url}: {url: string}) {
data={url}
style={[
a.rounded_sm,
{height: 200, width: 200, backgroundColor: '#f3f3f3'},
{height: 225, width: 225, backgroundColor: '#f3f3f3'},
]}
pieceSize={8}
pieceSize={isWeb ? 8 : 6}
padding={20}
// pieceLiquidRadius={2}
pieceBorderRadius={4.5}
pieceBorderRadius={isWeb ? 4.5 : 3.5}
outerEyesOptions={{
topLeft: {
borderRadius: [12, 12, 0, 12],
+4 -3
View File
@@ -65,8 +65,6 @@ export function QrCodeDialog({
await saveImageToMediaLibrary({uri: filename})
await FS.deleteAsync(filename)
control.close()
} else {
if (!AppBskyGraphStarterpack.isRecord(starterPack.record)) {
return
@@ -87,13 +85,15 @@ export function QrCodeDialog({
}
Toast.show(_(msg`QR code saved to your camera roll!`))
control.close()
})
}
const onCopyPress = async () => {
ref.current?.capture?.().then(async (uri: string) => {
if (isNative) {
await setImageAsync(uri)
const base64 = await FS.readAsStringAsync(uri, {encoding: 'base64'})
await setImageAsync(base64)
} else {
const canvas = await getCanvas(uri)
canvas.toBlob((blob: Blob) => {
@@ -103,6 +103,7 @@ export function QrCodeDialog({
}
Toast.show(_(msg`QR code copied to your clipboard!`))
control.close()
})
}