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.

small updates

Steven Teyb3810bdc22e3
diff --git a/apps/web/app/app.dub.co/(dashboard)/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/layout.tsx
index 7053a7680c..1da25661e8 100644
--- a/apps/web/app/app.dub.co/(dashboard)/layout.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/layout.tsx
@@ -20,10 +20,10 @@ export default function Layout({ children }: { children: ReactNode }) {
<MaxWidthWrapper>
<div className="flex h-16 items-center justify-between">
<div className="flex items-center">
- <Link href="/">
+ <Link href="/" className="hidden sm:block">
<Logo className="h-8 w-8 transition-all duration-75 active:scale-95" />
</Link>
- <Divider className="h-8 w-8 text-gray-200 sm:ml-3" />
+ <Divider className="hidden h-8 w-8 text-gray-200 sm:ml-3 sm:block" />
<ProjectSelect />
<UpgradeBanner />
</div>
diff --git a/apps/web/ui/layout/user-dropdown.tsx b/apps/web/ui/layout/user-dropdown.tsx
index 42e72a6fe5..6cb9ff53ac 100644
--- a/apps/web/ui/layout/user-dropdown.tsx
+++ b/apps/web/ui/layout/user-dropdown.tsx
@@ -53,7 +53,11 @@ export default function UserDropdown() {
<Popover
content={
<div className="flex w-full flex-col space-y-px rounded-md bg-white p-3 sm:w-56">
- <div className="p-2">
+ <Link
+ href="/"
+ className="p-2"
+ onClick={() => setOpenPopover(false)}
+ >
{session?.user?.name && (
<p className="truncate text-sm font-medium text-gray-900">
{session?.user?.name}
@@ -62,11 +66,11 @@ export default function UserDropdown() {
<p className="truncate text-sm text-gray-500">
{session?.user?.email}
</p>
- </div>
+ </Link>
<Link
href={`${HOME_DOMAIN}/help`}
+ onClick={() => setOpenPopover(false)}
target="_blank"
- rel="noopener noreferrer"
className="w-full rounded-md p-2 text-sm transition-all duration-75 hover:bg-gray-100 active:bg-gray-200"
>
<IconMenu
@@ -95,6 +99,7 @@ export default function UserDropdown() {
</button>
<Link
href="/settings"
+ onClick={() => setOpenPopover(false)}
className="block w-full rounded-md p-2 text-sm transition-all duration-75 hover:bg-gray-100 active:bg-gray-200"
>
<IconMenu
@@ -106,9 +111,10 @@ export default function UserDropdown() {
href={`${HOME_DOMAIN}/changelog`}
target="_blank"
rel="noopener noreferrer"
- onClick={() =>
- Cookies.set("lastReadChangelog", new Date().toISOString())
- }
+ onClick={() => {
+ Cookies.set("lastReadChangelog", new Date().toISOString());
+ setOpenPopover(false);
+ }}
className="flex w-full justify-between rounded-md p-2 text-sm transition-all duration-75 hover:bg-gray-100 active:bg-gray-200"
>
<IconMenu text="Changelog" icon={<Edit3 className="h-4 w-4" />} />
diff --git a/apps/web/ui/projects/upload-logo.tsx b/apps/web/ui/projects/upload-logo.tsx
index 08981b21d0..bdcabd1428 100644
--- a/apps/web/ui/projects/upload-logo.tsx
+++ b/apps/web/ui/projects/upload-logo.tsx
@@ -3,14 +3,12 @@
import useProject from "@/lib/swr/use-project";
import { Button } from "@dub/ui";
import { UploadCloud } from "lucide-react";
-import { useRouter } from "next/navigation";
import { useCallback, useEffect, useState } from "react";
import { toast } from "sonner";
import { mutate } from "swr";
export default function UploadLogo() {
- const router = useRouter();
- const { slug, logo } = useProject();
+ const { slug, logo, isOwner } = useProject();
const [image, setImage] = useState<string | null>();
@@ -63,7 +61,8 @@ export default function UploadLogo() {
} else if (res.status === 413) {
toast.error("File size too big (max 2MB)");
} else {
- toast.error("Something went wrong");
+ const errorMessage = await res.text();
+ toast.error(errorMessage || "Something went wrong");
}
setUploading(false);
});
@@ -167,7 +166,11 @@ export default function UploadLogo() {
<Button
text="Save changes"
loading={uploading}
- disabled={!image || logo === image}
+ disabled={!isOwner || !image || logo === image}
+ {...(!isOwner && {
+ disabledTooltip:
+ "Only project owners can change the project logo.",
+ })}
/>
</div>
</div>