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 {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],
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user