Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resend Migration #260

Merged
merged 8 commits into from Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -37,7 +37,6 @@ yarn-error.log*
next-env.d.ts

/pages/api/scripts*
.mailing
.react-email
.contentlayer
.vscode
5 changes: 3 additions & 2 deletions app/sitemap.ts
@@ -1,11 +1,12 @@
import prisma from "#/lib/prisma";
import { headers } from "next/headers";
import { getDomain } from "#/lib/utils";
import { allChangelogPosts, allLegalPosts } from "contentlayer/generated";
import { isHomeHostname } from "#/lib/utils";

export default async function Sitemap() {
const headersList = headers();
const domain = getDomain(headersList);
let domain = headersList.get("host") as string;
if (isHomeHostname(domain)) domain = "dub.sh";

const links = await prisma.link.findMany({
where: {
Expand Down
133 changes: 0 additions & 133 deletions app/ui/stats/feedback.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions app/ui/stats/feedback/action.ts
@@ -0,0 +1,13 @@
"use server";

import { log } from "#/lib/utils";

export async function submitFeedback(data: FormData) {
const email = data.get("email") as string;
const feedback = data.get("feedback") as string;

return await log({
message: `New feedback from *${email}*: ${feedback}`,
type: "cron",
});
}
5 changes: 5 additions & 0 deletions app/ui/stats/feedback/email.tsx
@@ -0,0 +1,5 @@
"use client";

import FeedbackEmail from "emails/feedback-email";

export default FeedbackEmail;
61 changes: 61 additions & 0 deletions app/ui/stats/feedback/index.tsx
@@ -0,0 +1,61 @@
import { experimental_useFormStatus as useFormStatus } from "react-dom";
import Button from "#/ui/button";
import { toast } from "sonner";
import { submitFeedback } from "./action";

export default function Feedback() {
return (
<div className="relative z-0 h-[420px] overflow-scroll border border-gray-200 bg-white px-7 py-5 scrollbar-hide sm:rounded-lg sm:border-gray-100 sm:shadow-lg">
<div className="mb-5 flex">
<h1 className="text-xl font-semibold">Feedback</h1>
</div>
<form
action={(data) =>
submitFeedback(data).then(() => {
toast.success("Feedback submitted – thank you!");
})
}
className="grid gap-5"
>
<div>
<label
htmlFor="email"
className="mb-2 block text-xs font-medium text-gray-500"
>
EMAIL
</label>
<input
name="email"
type="email"
placeholder="panic@thedis.co"
autoComplete="email"
className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
/>
</div>
<div>
<label
htmlFor="feedback"
className="mb-2 block text-xs font-medium text-gray-500"
>
FEEDBACK
</label>
<textarea
name="feedback"
id="feedback"
required={true}
rows={6}
className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"
placeholder="What other data would you like to see?"
aria-invalid="true"
/>
</div>
<FormButton />
</form>
</div>
);
}

const FormButton = () => {
const { pending } = useFormStatus();
return <Button text="Submit feedback" loading={pending} />;
};
7 changes: 5 additions & 2 deletions components/layout/meta.tsx
Expand Up @@ -4,7 +4,7 @@ import { FAVICON_FOLDER } from "#/lib/constants";
export default function Meta({
title = "Dub - Link Management for Modern Marketing Teams",
description = "Dub is an open-source link management tool for modern marketing teams to create, share, and track short links.",
image = "https://dub.sh/_static/thumbnail.png",
image = "https://public.blob.vercel-storage.com/kmKY9FhOzDRAX28c/4aNzmdW-S93Bh3Z3AJMLU90iSwq7SCLuuwIrcB.png",
}: {
title?: string;
description?: string;
Expand Down Expand Up @@ -47,7 +47,10 @@ export default function Meta({
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta itemProp="image" content={image} />
<meta property="og:logo" content="https://dub.sh/_static/logo.png"></meta>
<meta
property="og:logo"
content="https://public.blob.vercel-storage.com/kmKY9FhOzDRAX28c/diIX27B-vli9jFicKhqvO4Dzb2IrgHbaOdRLcT.png"
></meta>
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />
Expand Down
132 changes: 0 additions & 132 deletions emails/BelatedWelcome.tsx

This file was deleted.