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.

Reorganize links dashboard more dropdown

Tim Wilson1a6e7fb3a3df
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
index 40c3abadc5..a6567e8244 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
@@ -12,7 +12,6 @@ import { useExportLinksModal } from "@/ui/modals/export-links-modal";
import { ThreeDots } from "@/ui/shared/icons";
import { SearchBoxPersisted } from "@/ui/shared/search-box";
import {
- AnimatedSizeContainer,
Button,
Filter,
IconMenu,
@@ -23,7 +22,7 @@ import {
useMediaQuery,
useRouterStuff,
} from "@dub/ui";
-import { CloudUpload, Download, TableIcon, Tag } from "@dub/ui/src/icons";
+import { Download, TableIcon, Tag } from "@dub/ui/src/icons";
import { useSession } from "next-auth/react";
import { useRouter } from "next/navigation";
import posthog from "posthog-js";
@@ -180,111 +179,97 @@ const MoreLinkOptions = () => {
<ExportLinksModal />
<Popover
content={
- <AnimatedSizeContainer
- width={!isMobile}
- height
- className="max-sm:!w-full"
- >
- <div className="w-full divide-y divide-gray-200 md:w-52">
- {state === "default" && (
- <div className="p-2">
- <button
- onClick={() => setState("import")}
- className="w-full rounded-md p-2 hover:bg-gray-100 active:bg-gray-200"
- >
- <IconMenu
- text="Import links"
- icon={<CloudUpload className="h-4 w-4" />}
+ <div className="w-full md:w-52">
+ <div className="grid gap-px p-2">
+ <p className="mb-1.5 mt-1 flex items-center gap-2 px-1 text-xs font-medium text-gray-500">
+ Import Links
+ </p>
+ <ImportOption
+ onClick={() => {
+ setOpenPopover(false);
+ router.push(`/${slug}?import=bitly`);
+ }}
+ setOpenPopover={setOpenPopover}
+ >
+ <IconMenu
+ text="Import from Bitly"
+ icon={
+ <img
+ src="/_static/icons/bitly.svg"
+ alt="Bitly logo"
+ className="h-4 w-4"
/>
- </button>
- <button
- onClick={() => {
- setOpenPopover(false);
- setShowExportLinksModal(true);
- }}
- className="w-full rounded-md p-2 hover:bg-gray-100 active:bg-gray-200"
- >
- <IconMenu
- text="Export links"
- icon={<Download className="h-4 w-4" />}
+ }
+ />
+ </ImportOption>
+ <ImportOption
+ onClick={() => {
+ setOpenPopover(false);
+ router.push(`/${slug}?import=rebrandly`);
+ }}
+ setOpenPopover={setOpenPopover}
+ >
+ <IconMenu
+ text="Import from Rebrandly"
+ icon={
+ <img
+ src="/_static/icons/rebrandly.svg"
+ alt="Rebrandly logo"
+ className="h-4 w-4"
/>
- </button>
- </div>
- )}
- {state === "import" && (
- <>
- <div className="p-2">
- <ImportOption
- onClick={() => {
- setOpenPopover(false);
- router.push(`/${slug}?import=bitly`);
- }}
- setOpenPopover={setOpenPopover}
- >
- <IconMenu
- text="Import from Bitly"
- icon={
- <img
- src="/_static/icons/bitly.svg"
- alt="Bitly logo"
- className="h-4 w-4"
- />
- }
- />
- </ImportOption>
- <ImportOption
- onClick={() => {
- setOpenPopover(false);
- router.push(`/${slug}?import=rebrandly`);
- }}
- setOpenPopover={setOpenPopover}
- >
- <IconMenu
- text="Import from Rebrandly"
- icon={
- <img
- src="/_static/icons/rebrandly.svg"
- alt="Rebrandly logo"
- className="h-4 w-4"
- />
- }
- />
- </ImportOption>
- <ImportOption
- onClick={() => {
- setOpenPopover(false);
- router.push(`/${slug}?import=short`);
- }}
- setOpenPopover={setOpenPopover}
- >
- <IconMenu
- text="Import from Short.io"
- icon={
- <img
- src="/_static/icons/short.svg"
- alt="Short.io logo"
- className="h-4 w-4"
- />
- }
- />
- </ImportOption>
- <ImportOption
- onClick={() => {
- setOpenPopover(false);
- router.push(`/${slug}?import=csv`);
- }}
- setOpenPopover={setOpenPopover}
- >
- <IconMenu
- text="Import from CSV"
- icon={<TableIcon className="size-4" />}
- />
- </ImportOption>
- </div>
- </>
- )}
+ }
+ />
+ </ImportOption>
+ <ImportOption
+ onClick={() => {
+ setOpenPopover(false);
+ router.push(`/${slug}?import=short`);
+ }}
+ setOpenPopover={setOpenPopover}
+ >
+ <IconMenu
+ text="Import from Short.io"
+ icon={
+ <img
+ src="/_static/icons/short.svg"
+ alt="Short.io logo"
+ className="h-4 w-4"
+ />
+ }
+ />
+ </ImportOption>
+ <ImportOption
+ onClick={() => {
+ setOpenPopover(false);
+ router.push(`/${slug}?import=csv`);
+ }}
+ setOpenPopover={setOpenPopover}
+ >
+ <IconMenu
+ text="Import from CSV"
+ icon={<TableIcon className="size-4" />}
+ />
+ </ImportOption>
</div>
- </AnimatedSizeContainer>
+ <div className="border-t border-gray-200" />
+ <div className="grid gap-px p-2">
+ <p className="mb-1.5 mt-1 flex items-center gap-2 px-1 text-xs font-medium text-gray-500">
+ Export Links
+ </p>
+ <button
+ onClick={() => {
+ setOpenPopover(false);
+ setShowExportLinksModal(true);
+ }}
+ className="w-full rounded-md p-2 hover:bg-gray-100 active:bg-gray-200"
+ >
+ <IconMenu
+ text="Export as CSV"
+ icon={<Download className="h-4 w-4" />}
+ />
+ </button>
+ </div>
+ </div>
}
openPopover={openPopover}
setOpenPopover={setOpenPopover}