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