Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

default includeMargin to true

Kyle Zheng97b1b7f2438e
diff --git a/apps/web/lib/qr/constants.ts b/apps/web/lib/qr/constants.ts
index 73fd0b49b9..f7565cb908 100644
--- a/apps/web/lib/qr/constants.ts
+++ b/apps/web/lib/qr/constants.ts
@@ -11,9 +11,9 @@ export const DEFAULT_SIZE = 128;
export const DEFAULT_LEVEL = "L";
export const DEFAULT_BGCOLOR = "#FFFFFF";
export const DEFAULT_FGCOLOR = "#000000";
-export const DEFAULT_INCLUDEMARGIN = false;
+export const DEFAULT_INCLUDEMARGIN = true;
-export const MARGIN_SIZE = 4;
+export const MARGIN_SIZE = 2;
export const QR_LEVELS = ["L", "M", "Q", "H"] as const;
diff --git a/apps/web/lib/qr/index.tsx b/apps/web/lib/qr/index.tsx
index a107259e95..b996a3d8e3 100644
--- a/apps/web/lib/qr/index.tsx
+++ b/apps/web/lib/qr/index.tsx
@@ -362,7 +362,7 @@ export function getQRData({
size: 1024,
level: "Q", // QR Code error correction level: https://blog.qrstuff.com/general/qr-code-error-correction
hideLogo,
- includeMargin: false,
+ includeMargin: true,
...(!hideLogo && {
imageSettings: {
src: logo || DUB_QR_LOGO,
diff --git a/apps/web/lib/zod/schemas/qr.ts b/apps/web/lib/zod/schemas/qr.ts
index 7872181a12..7123d1584c 100644
--- a/apps/web/lib/zod/schemas/qr.ts
+++ b/apps/web/lib/zod/schemas/qr.ts
@@ -54,6 +54,6 @@ export const getQRCodeQuerySchema = z.object({
.optional()
.default(`${DEFAULT_INCLUDEMARGIN}`)
.describe(
- "Whether to include a margin around the QR code. Defaults to `false` if not provided.",
+ "Whether to include a margin around the QR code. Defaults to `true` if not provided.",
),
});
diff --git a/apps/web/ui/shared/qr-code.tsx b/apps/web/ui/shared/qr-code.tsx
index 45880988bb..7664d3f196 100644
--- a/apps/web/ui/shared/qr-code.tsx
+++ b/apps/web/ui/shared/qr-code.tsx
@@ -26,7 +26,7 @@ export function QRCode({
bgColor={qrData.bgColor}
fgColor={qrData.fgColor}
level={qrData.level}
- includeMargin={false}
+ includeMargin={true}
{...(qrData.imageSettings && {
imageSettings: {
...qrData.imageSettings,