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.

Remove unused code

Tim Wilsonee23f8d81367
diff --git a/apps/web/ui/account/upload-avatar.tsx b/apps/web/ui/account/upload-avatar.tsx
index b1ea18f654..347cc6bfe1 100644
--- a/apps/web/ui/account/upload-avatar.tsx
+++ b/apps/web/ui/account/upload-avatar.tsx
@@ -2,7 +2,7 @@
import { Button, ImageUpload } from "@dub/ui";
import { useSession } from "next-auth/react";
-import { useCallback, useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { toast } from "sonner";
export default function UploadAvatar() {
@@ -19,28 +19,6 @@ export default function UploadAvatar() {
);
}, [session]);
- const [dragActive, setDragActive] = useState(false);
-
- const onChangePicture = useCallback(
- (e) => {
- const file = e.target.files[0];
- if (file) {
- 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 {
- const reader = new FileReader();
- reader.onload = (e) => {
- setImage(e.target?.result as string);
- };
- reader.readAsDataURL(file);
- }
- }
- },
- [setImage],
- );
-
const [uploading, setUploading] = useState(false);
return (
diff --git a/apps/web/ui/layout/help/contact-form.tsx b/apps/web/ui/layout/help/contact-form.tsx
index 063d746d22..40d4e7e40e 100644
--- a/apps/web/ui/layout/help/contact-form.tsx
+++ b/apps/web/ui/layout/help/contact-form.tsx
@@ -30,8 +30,6 @@ export function ContactForm({
}[]
>([]);
- const [dragActive, setDragActive] = useState(false);
-
const handleUpload = async (file: File) => {
setImages((prev) => [...prev, { file, uploading: true }]);
diff --git a/apps/web/ui/workspaces/upload-logo.tsx b/apps/web/ui/workspaces/upload-logo.tsx
index 21002f28a4..54372fae4a 100644
--- a/apps/web/ui/workspaces/upload-logo.tsx
+++ b/apps/web/ui/workspaces/upload-logo.tsx
@@ -2,7 +2,7 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { Button, ImageUpload } from "@dub/ui";
-import { useCallback, useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { toast } from "sonner";
import { mutate } from "swr";
@@ -15,28 +15,6 @@ export default function UploadLogo() {
setImage(logo || null);
}, [logo]);
- const [dragActive, setDragActive] = useState(false);
-
- const onChangePicture = useCallback(
- (e) => {
- const file = e.target.files[0];
- if (file) {
- 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 {
- const reader = new FileReader();
- reader.onload = (e) => {
- setImage(e.target?.result as string);
- };
- reader.readAsDataURL(file);
- }
- }
- },
- [setImage],
- );
-
const [uploading, setUploading] = useState(false);
return (