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.

fix register background & login error handling

Steven Teyf229c70919a7
diff --git a/emails/MayRecap.tsx b/emails/MayRecap.tsx
new file mode 100644
index 0000000000..0d66396328
--- /dev/null
+++ b/emails/MayRecap.tsx
@@ -0,0 +1,211 @@
+import {
+ Mjml,
+ MjmlBody,
+ MjmlColumn,
+ MjmlImage,
+ MjmlSection,
+ MjmlText,
+ MjmlWrapper,
+} from "mjml-react";
+import Divider from "./components/Divider";
+import Footer from "./components/Footer";
+import Head from "./components/Head";
+import Header from "./components/Header";
+import { grayLight } from "./components/theme";
+
+export default function MayRecap({
+ slug,
+}: {
+ slug: string | null;
+}): JSX.Element {
+ return (
+ <Mjml>
+ <Head />
+ <MjmlBody width={500}>
+ <MjmlWrapper cssClass="container">
+ <Header title="Dub.sh May Product Recap" />
+ <MjmlSection cssClass="smooth">
+ <MjmlColumn>
+ <MjmlImage
+ cssClass="hero"
+ padding="0 0 20px 0"
+ border={`1px solid ${grayLight}`}
+ borderRadius={8}
+ align="left"
+ href="https://dub.sh/changelog/team-invites"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/team-invites.png"
+ />
+ <MjmlText cssClass="subtitle">Team Invites</MjmlText>
+ <MjmlText cssClass="paragraph">
+ You can now invite teammates to your Dub project. This is useful
+ if you want to collaborate with your team on a project.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ Dub has the most generous free plan in the industry. You can
+ invite up to 2 teammates to your project (3 total users) for
+ free.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ Need to invite more teammates? Upgrade to our{" "}
+ <a href="https://dub.sh/pricing" target="_blank">
+ Pro plan
+ </a>{" "}
+ for unlimited teammates.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ {slug ? (
+ <a
+ href={`https://app.dub.sh/${slug}/settings/people`}
+ target="_blank"
+ >
+ Start inviting your team →
+ </a>
+ ) : (
+ <a
+ href="https://dub.sh/changelog/team-invites"
+ target="_blank"
+ >
+ Read the changelog →
+ </a>
+ )}
+ </MjmlText>
+
+ <Divider bottomPadding />
+ <MjmlImage
+ cssClass="hero"
+ padding="0 0 20px 0"
+ border={`1px solid ${grayLight}`}
+ borderRadius={8}
+ align="left"
+ href="https://dub.sh/changelog/introducing-tags"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/introducing-tags.png"
+ />
+ <MjmlText cssClass="subtitle">
+ Tags – a smarter way to manage your links on Dub
+ </MjmlText>
+ <MjmlText cssClass="paragraph">With tags, you can now:</MjmlText>
+ <MjmlText cssClass="li">
+ ◆ Organize your links by campaigns, clients, etc.
+ </MjmlText>
+ <MjmlText cssClass="li">◆ Filter your links by tags</MjmlText>
+ <MjmlText cssClass="li">◆ Easily edit/delete your tags</MjmlText>
+ <MjmlText cssClass="paragraph">
+ <a
+ href="https://dub.sh/changelog/introducing-tags"
+ target="_blank"
+ >
+ Read the changelog →
+ </a>
+ </MjmlText>
+
+ <Divider bottomPadding />
+ <MjmlImage
+ cssClass="hero"
+ padding="0 0 20px 0"
+ border={`1px solid ${grayLight}`}
+ borderRadius={8}
+ align="left"
+ href="https://dub.sh/changelog/pass-url-parameters"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/pass-url-parameters.png"
+ />
+ <MjmlText cssClass="subtitle">
+ Pass URL Parameters to Destination URL
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ You can now pass URL query parameters from your short link to
+ its destination URL.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ If there are any duplicate parameters, the parameter in the
+ short link will override its counterpart in the destination URL.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ <a
+ href="https://dub.sh/changelog/pass-url-parameters"
+ target="_blank"
+ >
+ Read the changelog →
+ </a>
+ </MjmlText>
+
+ <Divider bottomPadding />
+ <MjmlImage
+ cssClass="hero"
+ padding="0 0 20px 0"
+ border={`1px solid ${grayLight}`}
+ borderRadius={8}
+ align="left"
+ href="https://dub.sh/changelog/all-time-link-stats"
+ src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/all-time-link-stats.png"
+ />
+ <MjmlText cssClass="subtitle">All-Time Link Stats</MjmlText>
+ <MjmlText cssClass="paragraph">
+ You can now view the all-time statistics for each of your Dub
+ shortlinks via the "All Time" filter option.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ Note: This is a{" "}
+ <a href="https://dub.sh/pricing" target="_blank">
+ Pro-only
+ </a>{" "}
+ feature, along with the 90-day ("Last 3 months") filter.
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ <a
+ href="https://dub.sh/stats/github?interval=all"
+ target="_blank"
+ >
+ See this in action →
+ </a>
+ </MjmlText>
+
+ <Divider bottomPadding />
+ <MjmlImage
+ cssClass="hero"
+ padding="0 0 20px 0"
+ border={`1px solid ${grayLight}`}
+ borderRadius={8}
+ align="left"
+ href="https://dub.sh/changelog"
+ src="https://dub.sh/api/og/changelog"
+ />
+ <MjmlText cssClass="subtitle">Dub.sh Changelog</MjmlText>
+ <MjmlText cssClass="paragraph">
+ Here are a few other features that we shipped this month:
+ </MjmlText>
+ <MjmlText cssClass="li">
+ ◆&nbsp;&nbsp;
+ <a
+ href="https://dub.sh/changelog/sign-in-with-google"
+ target="_blank"
+ >
+ Sign In With Google
+ </a>
+ </MjmlText>
+ <MjmlText cssClass="li">
+ ◆&nbsp;&nbsp;
+ <a
+ href="https://dub.sh/changelog/improved-link-management"
+ target="_blank"
+ >
+ Archiving links
+ </a>
+ </MjmlText>
+ <MjmlText cssClass="li">◆&nbsp;&nbsp;Show my links only</MjmlText>
+ <MjmlText cssClass="li">
+ ◆&nbsp;&nbsp;Allow '/' in custom shortlinks
+ </MjmlText>
+ <MjmlText cssClass="paragraph">
+ <a href="https://dub.sh/changelog" target="_blank">
+ Read our changelog →
+ </a>
+ </MjmlText>
+ <Divider bottomPadding />
+ </MjmlColumn>
+ </MjmlSection>
+ <Footer unsubscribe />
+ </MjmlWrapper>
+ </MjmlBody>
+ </Mjml>
+ );
+}
diff --git a/emails/components/Head.tsx b/emails/components/Head.tsx
index ece99be5c6..f9ac61f83d 100644
--- a/emails/components/Head.tsx
+++ b/emails/components/Head.tsx
@@ -23,8 +23,6 @@ export default function Head(): JSX.Element {
/>
<MjmlStyle>{`
.container {
- border: solid 1px ${grayLight};
- border-radius: 8px;
background-position-y: 50%;
}
strong {
@@ -35,9 +33,10 @@ export default function Head(): JSX.Element {
}
.title > * {
font-size: 24px !important;
+ font-weight: 600;
}
.subtitle > * {
- font-size: 16px !important;
+ font-size: 18px !important;
font-weight: 700;
}
.paragraph > * {
@@ -88,9 +87,6 @@ export default function Head(): JSX.Element {
body {
background: ${black};
}
- .container {
- border: solid 1px ${grayDark};
- }
.logo > * {
filter: invert(1) !important;
}
diff --git a/emails/previews/Sequences.tsx b/emails/previews/Sequences.tsx
index 70f89a1b58..69419099c6 100644
--- a/emails/previews/Sequences.tsx
+++ b/emails/previews/Sequences.tsx
@@ -1,6 +1,7 @@
import { default as BelatedWelcomeEmail } from "../BelatedWelcome";
import { default as FeatureUpdatesEmail } from "../FeatureUpdates";
import { default as BigUpdatesEmail } from "../BigUpdates";
+import { default as MayRecapEmail } from "../MayRecap";
export function BelatedWelcome() {
return <BelatedWelcomeEmail />;
@@ -11,5 +12,9 @@ export function FeatureUpdates() {
}
export function BigUpdates() {
- return <BigUpdatesEmail slug={"steven"} />;
+ return <BigUpdatesEmail slug="steven" />;
+}
+
+export function MayRecap() {
+ return <MayRecapEmail slug="steven" />;
}
diff --git a/pages/api/auth/[...nextauth].tsx b/pages/api/auth/[...nextauth].tsx
index 013fd1b2e1..039ebd7906 100644
--- a/pages/api/auth/[...nextauth].tsx
+++ b/pages/api/auth/[...nextauth].tsx
@@ -42,6 +42,9 @@ export const authOptions: NextAuthOptions = {
},
},
},
+ pages: {
+ error: "/login",
+ },
callbacks: {
signIn: async ({ user, account, profile }) => {
if (!user.email || (await isBlacklistedEmail(user.email))) {
diff --git a/pages/app/login.tsx b/pages/app/login.tsx
index d380169cf8..c75cb372d7 100644
--- a/pages/app/login.tsx
+++ b/pages/app/login.tsx
@@ -1,5 +1,5 @@
import Link from "next/link";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { signIn } from "next-auth/react";
import Meta from "@/components/layout/meta";
import BlurImage from "#/ui/blur-image";
@@ -12,13 +12,17 @@ import { useRouter } from "next/router";
export default function Login() {
const router = useRouter();
- const { next } = router.query as { next?: string };
+ const { next, error } = router.query as { next?: string; error?: string };
const [showEmailOption, setShowEmailOption] = useState(false);
const [noSuchAccount, setNoSuchAccount] = useState(false);
const [email, setEmail] = useState("");
const [clickedGoogle, setClickedGoogle] = useState(false);
const [clickedEmail, setClickedEmail] = useState(false);
+ useEffect(() => {
+ error && toast.error(error);
+ }, [error]);
+
return (
<div className="flex h-screen w-screen justify-center">
<Meta title="Sign in to Dub" />
diff --git a/pages/app/register.tsx b/pages/app/register.tsx
index 603f448b58..dbd5d64cf3 100644
--- a/pages/app/register.tsx
+++ b/pages/app/register.tsx
@@ -15,7 +15,7 @@ export default function Register() {
const [clickedGoogle, setClickedGoogle] = useState(false);
return (
- <div className="flex h-screen w-screen justify-center bg-gray-50">
+ <div className="flex h-screen w-screen justify-center">
<Meta title="Sign up for Dub" />
<Background />
<div className="z-10 mt-[calc(30vh)] h-fit w-full max-w-md overflow-hidden border border-gray-100 sm:rounded-2xl sm:shadow-xl">