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.

installed Next.js patch fix tarball (h/t to @ijjk), fixed default stats 0

Steven Tey32fcc7f06a6b
diff --git a/components/stats/clicks.tsx b/components/stats/clicks.tsx
index b2f692566b..1b612dd0b2 100644
--- a/components/stats/clicks.tsx
+++ b/components/stats/clicks.tsx
@@ -8,7 +8,7 @@ export default function Clicks({ data }: { data: StatsProps }) {
<div className="max-w-4xl border border-gray-200 bg-white p-5 sm:rounded-lg sm:border-gray-100 sm:p-10 sm:pr-20 sm:shadow-lg ">
<div className="mb-5 text-left">
<div className="flex items-end space-x-1">
- {data.totalClicks ? (
+ {data.totalClicks || data.totalClicks === 0 ? (
<h1 className="text-3xl font-bold sm:text-4xl">
{nFormatter(data.totalClicks)}
</h1>
diff --git a/components/stats/index.tsx b/components/stats/index.tsx
index 171115588b..b7ac216b42 100644
--- a/components/stats/index.tsx
+++ b/components/stats/index.tsx
@@ -24,7 +24,7 @@ export default function Stats({
interval?: string;
};
- const { data, isValidating } = useSWR<StatsProps>(
+ const { data } = useSWR<StatsProps>(
router.isReady &&
`${
slug && domain
diff --git a/lib/constants/index.ts b/lib/constants/index.ts
index b7667784fa..3141a8efcd 100644
--- a/lib/constants/index.ts
+++ b/lib/constants/index.ts
@@ -52,6 +52,7 @@ export const DEFAULT_REDIRECTS = {
dashboard: "https://app.dub.sh",
links: "https://app.dub.sh/links",
settings: "https://app.dub.sh/settings",
+ welcome: "https://app.dub.sh/welcome",
};
export const FREE_PLAN_PROJECT_LIMIT = 5;
diff --git a/lib/stats.ts b/lib/stats.ts
index 32c77ff6f6..0ae9cd3fcd 100644
--- a/lib/stats.ts
+++ b/lib/stats.ts
@@ -263,7 +263,7 @@ export const processRefererData = (
export const dummyData: StatsProps = {
key: "test",
interval: "24h",
- totalClicks: 0,
+ totalClicks: null,
clicksData: getTimeIntervals("24h").timeIntervals.map((interval) => ({
...interval,
count: 0,
diff --git a/package.json b/package.json
index b265884967..7c30ddfaaf 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,8 @@
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
+ "@splinetool/react-spline": "^2.2.3",
+ "@splinetool/runtime": "^0.9.138",
"@stitches/react": "^1.2.8",
"@stripe/stripe-js": "^1.36.0",
"@tailwindcss/forms": "^0.5.3",
@@ -43,7 +45,7 @@
"i": "^0.3.7",
"mailing-core": "^0.8.16",
"ms": "^2.1.3",
- "next": "^13.0.3-canary.4",
+ "next": "https://files-f5u5avutt-ijjk-testing.vercel.app",
"next-auth": "^4.16.4",
"next-plausible": "^3.6.3",
"nodemailer": "^6.7.8",
diff --git a/pages/api/projects/[slug]/domains/[domain]/links/[key]/stats.ts b/pages/api/projects/[slug]/domains/[domain]/links/[key]/stats.ts
index a211120250..da84c09655 100644
--- a/pages/api/projects/[slug]/domains/[domain]/links/[key]/stats.ts
+++ b/pages/api/projects/[slug]/domains/[domain]/links/[key]/stats.ts
@@ -27,7 +27,7 @@ export default withProjectAuth(
byScore: true,
},
);
- const data = await processData(key, response, interval);
+ const data = processData(key, response, interval);
return res.status(200).json(data);
} else {
res.setHeader("Allow", ["GET"]);
diff --git a/yarn.lock b/yarn.lock
index 309379ccfa..50cb705910 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -434,81 +434,16 @@
resolved "https://registry.yarnpkg.com/@next-auth/prisma-adapter/-/prisma-adapter-1.0.5.tgz#41a2fc7b44907054b81d456b426164e58becf4ed"
integrity sha512-VqMS11IxPXrPGXw6Oul6jcyS/n8GLOWzRMrPr3EMdtD6eOalM6zz05j08PcNiis8QzkfuYnCv49OvufTuaEwYQ==
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/env/-/env-13.0.3-canary.4.tgz#59fb414d9fdd39135f5eb447437543432e74869e"
- integrity sha512-IKMYPznB0ttgHa1K7nKbfSMM8kne3G7Am+eNeM11cr+HjPljAzl863Ib9UBk6s7oChTAEVtaoKHbAerW/36tWA==
+ version "13.0.3"
+ resolved "https://registry.yarnpkg.com/@next/env/-/env-13.0.3.tgz#f2ecec9a6634aed28dca9e7b79bd65d9c516a1b4"
+ integrity sha512-/4WzeG61Ot/PxsghXkSqQJ6UohFfwXoZ3dtsypmR9EBP+OIax9JRq0trq8Z/LCT9Aq4JbihVkaazRWguORjTAw==
"@next/font@^13.0.3-canary.4":
version "13.0.3-canary.4"
resolved "https://registry.yarnpkg.com/@next/font/-/font-13.0.3-canary.4.tgz#89ce58913316786fef7cd85194f295990ef15d51"
integrity sha512-S4Fh9GT86Xf2gyir20KFzuh97qMiKjkw/+twcmor7Pno2QGBytgfoeadgxvifXrXBewagU6pbHigmkibvMlQow==
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.3-canary.4.tgz#880d56e6fe4c45943346d746208f34654d552083"
- integrity sha512-3CXPHZfP7KGwKlrBv451x3l++q1Jxr/5PESk1TkFednJmw+9F6Tno+2RPYEzE++EWxjuAM8SmwHZxhJ6HorOvA==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-13.0.3-canary.4.tgz#599f091a4cd6f4e509efca87e87e5a44f33d0724"
- integrity sha512-hjsSok+41ZYDghIXMUrvv1eyDboinpDu5kcd/aQTqiV9ukuoQSQFwPd9i8fXVWKOb8w9rfoSLrPoslZXxbMolw==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.3-canary.4.tgz#2b38f7666bcd3e5db75018eff15ea997ced23884"
- integrity sha512-DxpeUXj7UcSidRDH0WjDzFlrycNvCKtQgpjPEzljBs2MGXGisuJ/znFkmqbLYwUi71La0nw91Yuz7IrGDpbhag==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.3-canary.4.tgz#af9da86a03edd8de67dde6292ff8eeb19a278c22"
- integrity sha512-jGdLe9QRpbSMkO+Ttpr8fnl2q/s1cQuBvGKM0nHiIUtwuwnho4BjcYQdcCJbjjH2Vs0KMhayZh9REa+52vdAEA==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.3-canary.4.tgz#0599e81d30391e5f3b9a786e9289008863b2eabd"
- integrity sha512-9VJCLOkbteSozo8kxrqiFJDntARLIn0Uv4aXdvbAuYhEIVRbnP0uA3z1r6d4g8ycC1Yout6z0m3pkg0MHbKV2w==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.3-canary.4.tgz#4d4e6296038fd80c12076e2f806b8e8dd071e68d"
- integrity sha512-SBA6Ja07guZI8KnIpMRN6tDvD6tse70c8d9HPwdkK7JziwIBzNDSuLbuA9WB+9/byM70U8jROBKgMUZAsAbnew==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.3-canary.4.tgz#79288b05fcb10702c597df4030f8815bf3f751a2"
- integrity sha512-9hQU3mZtzuLAvqaz/72jM2IWtV3lcLFhWqWGCS8yqUCKjkT2ppd/L/VEVuvatC67H5wzpbAJPnDxjPIl7ryiOA==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.3-canary.4.tgz#2d198fba5d30a8f16e90ea16aa3f2bb94c3c52e7"
- integrity sha512-iZTyAMbQiI0kng46mVp9XKscv59STqLbIVs6pSD3pnrBqKUh4SECQ6Z2r6Y4/H65ig64x6hvdk3KbG71UU+Kaw==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.3-canary.4.tgz#014b9a2482eddc698b8921e1646e06489095c59f"
- integrity sha512-2yYi/bjxf5jHJPTvnC6WbomgETkLWaNY+CEC2Ci1HV3xNVm1/4LiKB0KoDZGUWMBDjAQHO9LmTZS8+P4Q/wubA==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.3-canary.4.tgz#ceb4d490baf188bcc1c93683bb60b7402483da20"
- integrity sha512-DuT/jlTSyZDMPWDWpVqxkLJqGytXYnbIbZ8T+XRbOihDy8p4HwaKZW9ZcHM04lSnOmxwXFHRR5Exx4y5cQOH+A==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.3-canary.4.tgz#8c8b99958a4d96b39ad270acc9a04015b642d9fb"
- integrity sha512-TW1wLzOorp0IhBf2u1XiJ+8OmGWSUID8zWISwyW74oWuNIhpvzbgmCbjFqlfX9xUxAY6tVcx2TfOc5lmsIoaEg==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.3-canary.4.tgz#f5ac0a9c11367e8464965e684926be4eb7c5055d"
- integrity sha512-cCbuBq8ua9u/bpJ0TvyTrEZXNhrzR0R0z/h3gitw+8VUQG4xREwfn3od0J9XjeL0RQ4QbtgorVE2yw9JZ5pOdg==
-
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.3-canary.4.tgz#ee9c8e73869593d0409b29d2a925e041ac7294d8"
- integrity sha512-kWfN2WhqxwkaySEddUjm2xJKKdeaIE1/UZXFNCaU5aSZFTn1I4yVjjL40tMCfcppqYbY58X6c5UocOviLcKbrg==
-
"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"
@@ -1260,6 +1195,20 @@
resolved "https://registry.yarnpkg.com/@reecelucas/react-use-hotkeys/-/react-use-hotkeys-1.3.5.tgz#14006121e52b86695c12b0502fe4c0e333ad36e5"
integrity sha512-mzogZ/zykHd9F88V9zwh+7ZVzlHomGjz4ztOCkHBSHmAPrM4fF4z3TMPaG4YSykB03spuVh6GbKAkSNY1rUDBQ==
+"@splinetool/react-spline@^2.2.3":
+ version "2.2.3"
+ resolved "https://registry.yarnpkg.com/@splinetool/react-spline/-/react-spline-2.2.3.tgz#f0c93fe1f539be95de4564c19440be1061d42ee0"
+ integrity sha512-KdvyP2cCLLG/PcHp0ObE147nhawY4R/iqI6733MSWBx4KSpeo4oD589rCPuXeGdgyr2lCtZqUQOkQj4QCnXxmw==
+ dependencies:
+ react-merge-refs "^1.1.0"
+
+"@splinetool/runtime@^0.9.138":
+ version "0.9.138"
+ resolved "https://registry.yarnpkg.com/@splinetool/runtime/-/runtime-0.9.138.tgz#c845d2750899ded08dda1277374d209b90283127"
+ integrity sha512-oTj4lEYIoN1z5TjbjsZoAbZ/HH+Eb877MIzwj9YMgBo35wEKHb4P+w4Ug2akpasMv0Gb+XzPMdyXDpXvLo5gjA==
+ dependencies:
+ on-change "^4.0.0"
+
"@stitches/react@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@stitches/react/-/react-1.2.8.tgz#954f8008be8d9c65c4e58efa0937f32388ce3a38"
@@ -4645,31 +4594,16 @@ next-plausible@^3.6.3:
resolved "https://registry.npmjs.org/next-plausible/-/next-plausible-3.6.3.tgz"
integrity sha512-KlpB0k/PPMq0udKOLgTcp6RAqGLiIi7956tXRD5w/gzzgVdp2i3xvnafG60Exjiz98go1Jj98n/PxD3WitKH6Q==
-next@^13.0.3-canary.4:
- version "13.0.3-canary.4"
- resolved "https://registry.yarnpkg.com/next/-/next-13.0.3-canary.4.tgz#4c02a9886276f3dd367574bc4f4caf4bf29cd700"
- integrity sha512-GCf0loggwGvPXeDfYMtg36HByukmALnldQZMIdQnGcJtFHRQsWrprvrTEfqTENU5UOZSYbTdJRdL1Y8QOyymWw==
+"next@https://files-f5u5avutt-ijjk-testing.vercel.app":
+ version "13.0.3"
+ resolved "https://files-f5u5avutt-ijjk-testing.vercel.app#6fd8f2fbad132ebb32ffdbd073afc4f8dea9edf2"
dependencies:
- "@next/env" "13.0.3-canary.4"
+ "@next/env" "13.0.3"
"@swc/helpers" "0.4.11"
caniuse-lite "^1.0.30001406"
postcss "8.4.14"
styled-jsx "5.1.0"
use-sync-external-store "1.2.0"
- optionalDependencies:
- "@next/swc-android-arm-eabi" "13.0.3-canary.4"
- "@next/swc-android-arm64" "13.0.3-canary.4"
- "@next/swc-darwin-arm64" "13.0.3-canary.4"
- "@next/swc-darwin-x64" "13.0.3-canary.4"
- "@next/swc-freebsd-x64" "13.0.3-canary.4"
- "@next/swc-linux-arm-gnueabihf" "13.0.3-canary.4"
- "@next/swc-linux-arm64-gnu" "13.0.3-canary.4"
- "@next/swc-linux-arm64-musl" "13.0.3-canary.4"
- "@next/swc-linux-x64-gnu" "13.0.3-canary.4"
- "@next/swc-linux-x64-musl" "13.0.3-canary.4"
- "@next/swc-win32-arm64-msvc" "13.0.3-canary.4"
- "@next/swc-win32-ia32-msvc" "13.0.3-canary.4"
- "@next/swc-win32-x64-msvc" "13.0.3-canary.4"
no-case@^2.2.0:
version "2.3.2"
@@ -4999,6 +4933,11 @@ oidc-token-hash@^5.0.1:
resolved "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.0.1.tgz"
integrity sha512-EvoOtz6FIEBzE+9q253HsLCVRiK/0doEJ2HCvvqMQb3dHZrP3WlJKYtJ55CRTw4jmYomzH4wkPuCj/I3ZvpKxQ==
+on-change@^4.0.0:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/on-change/-/on-change-4.0.1.tgz#a3fea9971748efab3560351c8278ea1a692b7c16"
+ integrity sha512-Gxmr/8NsLTigoUUEPvnAIUGl7uxwfC3Mm1G+qTmODEZcT4ZGfeaFyQgfGCdbKVS2pICIFYB82RH6MUHToPcS4Q==
+
once@^1.3.0:
version "1.4.0"
resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
@@ -5502,6 +5441,11 @@ react-is@^16.13.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
+react-merge-refs@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/react-merge-refs/-/react-merge-refs-1.1.0.tgz#73d88b892c6c68cbb7a66e0800faa374f4c38b06"
+ integrity sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==
+
react-parallax-tilt@^1.7.68:
version "1.7.68"
resolved "https://registry.yarnpkg.com/react-parallax-tilt/-/react-parallax-tilt-1.7.68.tgz#0aeb733343d942706380c425c30b6f94579896b4"