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.

bumped logo size limit, fix domain card format

Steven Teyc9bbc9d02c68
diff --git a/components/app/domains/domain-card-placeholder.tsx b/components/app/domains/domain-card-placeholder.tsx
index 05e831118c..80b820591d 100644
--- a/components/app/domains/domain-card-placeholder.tsx
+++ b/components/app/domains/domain-card-placeholder.tsx
@@ -11,7 +11,7 @@ export default function DomainCardPlaceholder() {
<div className="h-9 w-24 animate-pulse rounded-md bg-gray-200" />
</div>
</div>
- <div className="flex h-10 items-center space-x-5">
+ <div className="flex h-10 flex-col space-y-2 sm:flex-row sm:items-center sm:space-x-5 sm:space-y-0">
<div className="flex items-center space-x-2">
<div className="h-6 w-6 animate-pulse rounded-full bg-gray-200" />
<div className="h-5 w-36 animate-pulse rounded-md bg-gray-200" />
diff --git a/components/app/domains/domain-card.tsx b/components/app/domains/domain-card.tsx
index f564388788..be1c3ff497 100644
--- a/components/app/domains/domain-card.tsx
+++ b/components/app/domains/domain-card.tsx
@@ -14,6 +14,7 @@ import { useAddEditDomainModal } from "../modals/add-edit-domain-modal";
import DomainConfiguration from "./domain-configuration";
import Link from "next/link";
import punycode from "punycode/";
+import Button from "#/ui/button";
export default function DomainCard({ props }: { props: DomainProps }) {
const router = useRouter();
@@ -80,28 +81,22 @@ export default function DomainCard({ props }: { props: DomainProps }) {
)}
</div>
<div className="flex space-x-3">
- <button
+ <Button
+ text="Refresh"
+ variant="secondary"
+ loading={isValidating}
onClick={() => {
mutate(`/api/projects/${slug}/domains/${domain}/verify`);
}}
- disabled={isValidating}
- className={`${
- isValidating
- ? "cursor-not-allowed bg-gray-100"
- : "bg-white hover:border-black hover:text-black"
- } h-9 w-24 rounded-md border border-gray-200 text-sm font-medium text-gray-500 transition-all duration-150 ease-in-out focus:outline-none`}
- >
- {isValidating ? <LoadingDots /> : "Refresh"}
- </button>
- <button
+ />
+ <Button
+ text="Edit"
+ variant="secondary"
onClick={() => setShowAddEditDomainModal(true)}
- className="h-9 w-24 rounded-md border border-gray-200 bg-white text-sm font-medium text-gray-500 transition-all duration-150 ease-in-out hover:border-black hover:text-black focus:outline-none"
- >
- Edit
- </button>
+ />
</div>
</div>
- <div className="flex h-10 items-center space-x-5">
+ <div className="flex h-10 flex-col space-y-2 sm:flex-row sm:items-center sm:space-x-5 sm:space-y-0">
<div className="flex items-center space-x-2">
{data ? (
data.status === "Valid Configuration" ? (
diff --git a/components/app/projects/upload-logo.tsx b/components/app/projects/upload-logo.tsx
index a07c6715a1..5b7a95ee73 100644
--- a/components/app/projects/upload-logo.tsx
+++ b/components/app/projects/upload-logo.tsx
@@ -20,8 +20,8 @@ export default function UploadLogo() {
(e) => {
const file = e.target.files[0];
if (file) {
- if (file.size / 1024 / 1024 > 5) {
- toast.error("File size too big (max 5MB)");
+ if (file.size / 1024 / 1024 > 2) {
+ toast.error("File size too big (max 2MB)");
} else if (file.type !== "image/png" && file.type !== "image/jpeg") {
toast.error("File type not supported (.png or .jpg only)");
} else {
@@ -95,8 +95,8 @@ export default function UploadLogo() {
setDragActive(false);
const file = e.dataTransfer.files && e.dataTransfer.files[0];
if (file) {
- if (file.size / 1024 / 1024 > 5) {
- toast.error("File size too big (max 5MB)");
+ if (file.size / 1024 / 1024 > 2) {
+ toast.error("File size too big (max 2MB)");
} else if (
file.type !== "image/png" &&
file.type !== "image/jpeg"
@@ -153,7 +153,7 @@ export default function UploadLogo() {
<div className="flex items-center justify-between rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10">
<p className="text-sm text-gray-500">
Square image recommended. Accepted file types: .png, .jpg. Max file
- size: 5MB.
+ size: 2MB.
</p>
<div>
<Button
diff --git a/pages/api/projects/[slug]/logo.ts b/pages/api/projects/[slug]/logo.ts
index 019a1bf4cf..fed32d4b5d 100644
--- a/pages/api/projects/[slug]/logo.ts
+++ b/pages/api/projects/[slug]/logo.ts
@@ -2,6 +2,14 @@ import { withProjectAuth } from "#/lib/auth";
import cloudinary from "cloudinary";
import prisma from "#/lib/prisma";
+export const config = {
+ api: {
+ bodyParser: {
+ sizeLimit: "2mb",
+ },
+ },
+};
+
export default withProjectAuth(async (req, res, project) => {
// POST /api/projects/[slug]/logo – upload a new logo
if (req.method === "POST") {