The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Fix #275
Steven Tey378732021ef2
diff --git a/components/app/modals/upgrade-plan-modal.tsx b/components/app/modals/upgrade-plan-modal.tsxindex 39337b3b42..d291a76d20 100644--- a/components/app/modals/upgrade-plan-modal.tsx+++ b/components/app/modals/upgrade-plan-modal.tsx@@ -53,156 +53,155 @@ function UpgradePlanModal({<ModalshowModal={showUpgradePlanModal}setShowModal={setShowUpgradePlanModal}+ className="max-w-lg"disableDefaultHide={welcomeFlow}>- <div className="inline-block w-full transform overflow-hidden bg-white align-middle shadow-xl transition-all sm:max-w-lg sm:rounded-2xl sm:border sm:border-gray-200">- <motion.div- variants={{- show: {- transition: {- staggerChildren: 0.15,- },+ <motion.div+ variants={{+ show: {+ transition: {+ staggerChildren: 0.15,},- }}+ },+ }}+ initial="hidden"+ animate="show"+ className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-8 sm:px-16"+ >+ <motion.div variants={STAGGER_CHILD_VARIANTS}>+ <Logo />+ </motion.div>+ <motion.h3+ className="text-lg font-medium"+ variants={STAGGER_CHILD_VARIANTS}+ >+ Upgrade to {plan}+ </motion.h3>+ <motion.p+ className="text-center text-sm text-gray-500"+ variants={STAGGER_CHILD_VARIANTS}+ >+ Enjoy higher limits and extra features with our {plan} plan.+ </motion.p>+ </motion.div>+ <div className="bg-gray-50 px-4 py-8 text-left sm:px-16">+ <motion.div+ className="flex flex-col space-y-3"+ variants={STAGGER_CHILD_VARIANTS}initial="hidden"animate="show"- className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 px-4 py-8 sm:px-16">- <motion.div variants={STAGGER_CHILD_VARIANTS}>- <Logo />- </motion.div>- <motion.h3- className="text-lg font-medium"- variants={STAGGER_CHILD_VARIANTS}- >- Upgrade to {plan}- </motion.h3>- <motion.p- className="text-center text-sm text-gray-500"- variants={STAGGER_CHILD_VARIANTS}- >- Enjoy higher limits and extra features with our {plan} plan.- </motion.p>- </motion.div>- <div className="bg-gray-50 px-4 py-8 text-left sm:px-16">- <motion.div- className="flex flex-col space-y-3"- variants={STAGGER_CHILD_VARIANTS}- initial="hidden"- animate="show"- >- <div className="mb-4">- <div className="mb-4 flex items-center justify-between">- <div className="flex items-center space-x-2">- <h4 className="font-medium text-gray-900">- {plan} {capitalize(period)}- </h4>- <Badge- text={`$${- PLANS.find((p) => p.name === plan)!.price[period].amount- }/${period.replace("ly", "")}`}- variant="neutral"- className="text-sm font-normal normal-case"- />- </div>- <Confetti- active={period === "yearly"}- config={{ elementCount: 200, spread: 90 }}+ <div className="mb-4">+ <div className="mb-4 flex items-center justify-between">+ <div className="flex items-center space-x-2">+ <h4 className="font-medium text-gray-900">+ {plan} {capitalize(period)}+ </h4>+ <Badge+ text={`$${+ PLANS.find((p) => p.name === plan)!.price[period].amount+ }/${period.replace("ly", "")}`}+ variant="neutral"+ className="text-sm font-normal normal-case"/>- <button- onClick={() => {- setPeriod(period === "monthly" ? "yearly" : "monthly");- }}- className="text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800"- >- {period === "monthly"- ? "Get 2 months free π"- : "Switch to monthly"}- </button></div>- <motion.div- variants={{- show: {- transition: {- staggerChildren: 0.08,- },- },+ <Confetti+ active={period === "yearly"}+ config={{ elementCount: 200, spread: 90 }}+ />+ <button+ onClick={() => {+ setPeriod(period === "monthly" ? "yearly" : "monthly");}}- initial="hidden"- animate="show"- className="flex flex-col space-y-2"+ className="text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800">- {features.map((feature, i) => (- <motion.div- key={i}- variants={STAGGER_CHILD_VARIANTS}- className="flex items-center space-x-2 text-sm text-gray-500"- >- <CheckCircleFill className="h-5 w-5 text-green-500" />- <span>{feature}</span>- </motion.div>- ))}- </motion.div>+ {period === "monthly"+ ? "Get 2 months free π"+ : "Switch to monthly"}+ </button></div>- <Button- text={`Upgrade to ${plan} ${capitalize(period)}`}- loading={clicked}- onClick={() => {- setClicked(true);- fetch(- `/api/projects/${slug}/billing/upgrade?priceId=${- PLANS.find((p) => p.name === plan)!.price[period].priceIds[- process.env.NEXT_PUBLIC_VERCEL_ENV === "production"- ? "production"- : "test"- ]- }`,- {- method: "POST",+ <motion.div+ variants={{+ show: {+ transition: {+ staggerChildren: 0.08,},- )- .then(async (res) => {- const data = await res.json();- const { id: sessionId } = data;- const stripe = await getStripe();- stripe?.redirectToCheckout({ sessionId });- })- .catch((err) => {- alert(err);- setClicked(false);- });+ },}}- />- {welcomeFlow ? (- <Link- href={`/${slug}`}- className="text-center text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800"- >- Skip for now- </Link>- ) : (- <div className="flex items-center justify-center space-x-2">- <button- onClick={() => {- setPlan(plan === "Pro" ? "Enterprise" : "Pro");- }}- className="text-center text-xs text-gray-500 underline-offset-4 transition-all hover:text-gray-800 hover:underline"- >- Dub {plan === "Pro" ? "Enterprise" : "Pro"}- </button>- <p className="text-gray-500">β’</p>- <a- href="https://dub.sh/pricing"- target="_blank"- rel="noopener noreferrer"- className="text-center text-xs text-gray-500 underline-offset-4 transition-all hover:text-gray-800 hover:underline"+ initial="hidden"+ animate="show"+ className="flex flex-col space-y-2"+ >+ {features.map((feature, i) => (+ <motion.div+ key={i}+ variants={STAGGER_CHILD_VARIANTS}+ className="flex items-center space-x-2 text-sm text-gray-500">- Compare plans- </a>- </div>- )}- </motion.div>- </div>+ <CheckCircleFill className="h-5 w-5 text-green-500" />+ <span>{feature}</span>+ </motion.div>+ ))}+ </motion.div>+ </div>+ <Button+ text={`Upgrade to ${plan} ${capitalize(period)}`}+ loading={clicked}+ onClick={() => {+ setClicked(true);+ fetch(+ `/api/projects/${slug}/billing/upgrade?priceId=${+ PLANS.find((p) => p.name === plan)!.price[period].priceIds[+ process.env.NEXT_PUBLIC_VERCEL_ENV === "production"+ ? "production"+ : "test"+ ]+ }`,+ {+ method: "POST",+ },+ )+ .then(async (res) => {+ const data = await res.json();+ const { id: sessionId } = data;+ const stripe = await getStripe();+ stripe?.redirectToCheckout({ sessionId });+ })+ .catch((err) => {+ alert(err);+ setClicked(false);+ });+ }}+ />+ {welcomeFlow ? (+ <Link+ href={`/${slug}`}+ className="text-center text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-gray-800"+ >+ Skip for now+ </Link>+ ) : (+ <div className="flex items-center justify-center space-x-2">+ <button+ onClick={() => {+ setPlan(plan === "Pro" ? "Enterprise" : "Pro");+ }}+ className="text-center text-xs text-gray-500 underline-offset-4 transition-all hover:text-gray-800 hover:underline"+ >+ Dub {plan === "Pro" ? "Enterprise" : "Pro"}+ </button>+ <p className="text-gray-500">β’</p>+ <a+ href="https://dub.sh/pricing"+ target="_blank"+ rel="noopener noreferrer"+ className="text-center text-xs text-gray-500 underline-offset-4 transition-all hover:text-gray-800 hover:underline"+ >+ Compare plans+ </a>+ </div>+ )}+ </motion.div></div></Modal>);diff --git a/pages/app/index.tsx b/pages/app/index.tsxindex 777f314f03..62798cdadb 100644--- a/pages/app/index.tsx+++ b/pages/app/index.tsx@@ -29,7 +29,7 @@ export default function App() {<MaxWidthWrapper><divclassName={`my-10 grid grid-cols-1 ${- projects?.length === 0 ? "" : "lg:grid-cols-3"+ projects?.length === 0 ? "" : "lg:grid-cols-2 xl:grid-cols-3"} gap-5`}>{projects ? (