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.

added datetime picker (expiresAt works now), replaced headlessui dropdown with radix popover

Steven Tey4431338aa7f3
diff --git a/components/app/link-card.tsx b/components/app/link-card.tsx
index 923d501001..9be07f890f 100644
--- a/components/app/link-card.tsx
+++ b/components/app/link-card.tsx
@@ -20,7 +20,7 @@ import { useDeleteLinkModal } from "./modals/delete-link-modal";
import { useLinkQRModal } from "./modals/link-qr-modal";
export default function LinkCard({ props }: { props: LinkProps }) {
- const { key, url, title, createdAt } = props;
+ const { key, url, createdAt, expiresAt } = props;
const apexDomain = getApexDomain(url);
@@ -58,8 +58,11 @@ export default function LinkCard({ props }: { props: LinkProps }) {
<AddEditLinkModal />
<DeleteLinkModal />
<LinkQRModal />
- <li className="flex flex-col sm:flex-row justify-between items-start sm:items-center space-y-5 sm:space-y-0 bg-white p-4 rounded-lg shadow hover:shadow-md transition-all">
- <div className="relative flex items-center space-x-4">
+ <li className="relative flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-4 rounded-lg shadow hover:shadow-md transition-all">
+ {expiresAt && new Date() > new Date(expiresAt) ? (
+ <div className="absolute top-0 left-0 rounded-t-lg w-full h-1.5 bg-amber-500" />
+ ) : null}
+ <div className="relative flex items-center space-x-4 mb-3 sm:mb-0">
<BlurImage
src={`https://www.google.com/s2/favicons?sz=64&domain_url=${apexDomain}`}
alt={apexDomain}
@@ -100,7 +103,7 @@ export default function LinkCard({ props }: { props: LinkProps }) {
</Link>
</div>
<h3 className="text-sm font-medium text-gray-700 line-clamp-1">
- {title || url}
+ {url}
</h3>
</div>
</div>
diff --git a/components/app/modals/add-edit-link-modal.tsx b/components/app/modals/add-edit-link-modal.tsx
index 30677aaded..adc989ae99 100644
--- a/components/app/modals/add-edit-link-modal.tsx
+++ b/components/app/modals/add-edit-link-modal.tsx
@@ -13,17 +13,19 @@ import { useDebounce } from "use-debounce";
import BlurImage from "@/components/shared/blur-image";
import {
AlertCircleFill,
+ Calendar,
ChevronRight,
LoadingCircle,
LoadingDots,
UploadCloud,
} from "@/components/shared/icons";
import Modal from "@/components/shared/modal";
+import Popover from "@/components/shared/popover";
import Tooltip, { TooltipContent } from "@/components/shared/tooltip";
import useProject from "@/lib/swr/use-project";
import useUsage from "@/lib/swr/use-usage";
import { LinkProps } from "@/lib/types";
-import { getApexDomain, linkConstructor } from "@/lib/utils";
+import { getApexDomain, getDateTimeLocal, linkConstructor } from "@/lib/utils";
function AddEditLinkModal({
showAddEditLinkModal,
@@ -287,7 +289,7 @@ function AdvancedSettings({
const [generatingTitle, setGeneratingTitle] = useState(false);
const [generatingDescription, setGeneratingDescription] = useState(false);
- const { url, title, description, image, password } = data;
+ const { url, title, description, image, password, expiresAt } = data;
const generateTitleFromUrl = async () => {
setGeneratingTitle(true);
@@ -489,6 +491,28 @@ function AdvancedSettings({
/>
</div>
</div>
+
+ {/* Expire Link */}
+ <div>
+ <label
+ htmlFor="expiresAt"
+ className="block text-sm font-medium text-gray-700"
+ >
+ Auto-expire Link
+ </label>
+ <input
+ type="datetime-local"
+ id="expiresAt"
+ name="expiresAt"
+ min={getDateTimeLocal()}
+ value={expiresAt ? getDateTimeLocal(expiresAt) : ""}
+ step="60" // need to add step to prevent weird date bug (https://stackoverflow.com/q/19284193/10639526)
+ onChange={(e) => {
+ setData({ ...data, expiresAt: new Date(e.target.value) });
+ }}
+ className="flex space-x-2 justify-center items-center mt-1 rounded-md shadow-sm border border-gray-300 text-gray-500 hover:border-gray-800 px-5 py-2 w-full focus:outline-none sm:text-sm transition-all"
+ />
+ </div>
</div>
)}
</div>
diff --git a/components/home/demo.tsx b/components/home/demo.tsx
index 83b9b80c48..ec3255254c 100644
--- a/components/home/demo.tsx
+++ b/components/home/demo.tsx
@@ -21,15 +21,12 @@ const Demo = () => {
onSubmit={async (e) => {
e.preventDefault();
setSaving(true);
- fetch(
- `/api/edge/links?url=${encodeURIComponent(url)}&hostname=dub.sh`,
- {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
+ fetch(`/api/edge/links?url=${encodeURIComponent(url)}`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
},
- ).then(async (response) => {
+ }).then(async (response) => {
setSaving(false);
if (response.ok) {
const json = await response.json();
diff --git a/components/layout/app/index.tsx b/components/layout/app/index.tsx
index 54436c23d9..40eeff8a1b 100644
--- a/components/layout/app/index.tsx
+++ b/components/layout/app/index.tsx
@@ -6,7 +6,7 @@ import { ReactNode } from "react";
import { Toaster } from "react-hot-toast";
import { Divider, Logo } from "@/components/shared/icons";
import Meta from "../meta";
-import ListBox from "./list-box";
+import ProjectSelect from "./project-select";
import UserDropdown from "./user-dropdown";
const CRISP_SCRIPT = `window.$crisp=[];window.CRISP_WEBSITE_ID="2c09b1ee-14c2-46d1-bf72-1dbb998a19e0";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();`;
@@ -45,7 +45,7 @@ export default function AppLayout({ children }: { children: ReactNode }) {
</a>
</Link>
<Divider className="h-8 w-8 ml-3 text-gray-200" />
- <ListBox />
+ <ProjectSelect />
{key && slug && (
<>
<Divider className="h-8 w-8 mr-3 text-gray-200" />
diff --git a/components/layout/app/list-box.tsx b/components/layout/app/list-box.tsx
deleted file mode 100644
index 9f0c1fc570..0000000000
--- a/components/layout/app/list-box.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import { useRouter } from "next/router";
-import { Fragment, useMemo } from "react";
-import { Listbox, Transition } from "@headlessui/react";
-import { useSession } from "next-auth/react";
-import useSWR from "swr";
-import { useAddProjectModal } from "@/components/app/modals/add-project-modal";
-import BlurImage from "@/components/shared/blur-image";
-import { ChevronUpDown, PlusCircle, Tick } from "@/components/shared/icons";
-import useUsage from "@/lib/swr/use-usage";
-import { ProjectProps } from "@/lib/types";
-import { fetcher } from "@/lib/utils";
-
-export default function ListBox() {
- const { data: projects } = useSWR<ProjectProps[]>("/api/projects", fetcher);
- const { plan } = useUsage();
-
- const { setShowAddProjectModal, AddProjectModal } = useAddProjectModal({});
-
- const router = useRouter();
-
- const { data: session } = useSession();
-
- const selected = useMemo(() => {
- const { slug } = router.query;
- return (
- projects?.find((project) => project.slug === slug) || {
- name: session?.user?.name || session?.user?.email || "User",
- slug: "/",
- domain: "dub.sh",
- logo:
- session?.user?.image ||
- `https://avatars.dicebear.com/api/micah/${session?.user?.email}.svg`,
- }
- );
- }, [router, projects, session]);
-
- if (!projects || !router.isReady)
- return (
- <div className="w-52 h-9 px-2 rounded-lg bg-gray-100 animate-pulse flex justify-end items-center">
- <ChevronUpDown className="h-4 w-4 text-gray-400" aria-hidden="true" />
- </div>
- );
-
- return (
- <div className="w-52 -mt-1">
- <AddProjectModal />
- <Listbox
- value={selected}
- onChange={(e) => {
- if (e.slug !== "Add a new project") {
- router.push(`/${e.slug}`);
- }
- }}
- >
- <div className="relative mt-1">
- <Listbox.Button className="relative w-full rounded-lg bg-white hover:bg-gray-100 py-1.5 pl-3 pr-10 text-left focus:outline-none text-sm active:scale-95 transition-all duration-75">
- <div className="flex justify-start items-center space-x-3">
- <BlurImage
- src={
- selected.logo ||
- `https://www.google.com/s2/favicons?sz=64&domain_url=${selected.domain}`
- }
- alt={selected.slug}
- className="w-8 h-8 flex-shrink-0 rounded-full overflow-hidden border border-gray-300"
- width={48}
- height={48}
- />
- <span className="block truncate font-medium text-sm">
- {selected.name}
- </span>
- </div>
- <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
- <ChevronUpDown
- className="h-4 w-4 text-gray-400"
- aria-hidden="true"
- />
- </span>
- </Listbox.Button>
- <Transition
- as={Fragment}
- enter="transition ease-out duration-100"
- enterFrom="transform opacity-0 scale-95"
- enterTo="transform opacity-100 scale-100"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95"
- >
- <Listbox.Options className="absolute mt-1 max-h-60 w-60 overflow-auto rounded-md bg-white p-2 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm">
- {projects.map(({ name, slug, domain, logo }) => (
- <Listbox.Option
- key={slug}
- className={`relative flex items-center space-x-2 cursor-pointer p-2 rounded-md hover:bg-gray-100 active:scale-95 ${
- selected.slug === slug ? "font-medium" : ""
- } transition-all duration-75`}
- value={{ name, slug }}
- >
- <BlurImage
- src={
- logo ||
- `https://www.google.com/s2/favicons?sz=64&domain_url=${domain}`
- }
- alt={slug}
- className="w-7 h-7 rounded-full overflow-hidden"
- width={48}
- height={48}
- />
- <span
- className={`block truncate text-sm ${
- selected.slug === slug ? "font-medium" : "font-normal"
- }`}
- >
- {name}
- </span>
- {selected.slug === slug ? (
- <span className="absolute inset-y-0 right-0 flex items-center pr-3 text-black">
- <Tick className="h-5 w-5" aria-hidden="true" />
- </span>
- ) : null}
- </Listbox.Option>
- ))}
- {!(plan === "Free" && projects.length >= 1) && (
- <Listbox.Option
- key="add"
- onClick={() => setShowAddProjectModal(true)}
- value={{
- name: "Add a new project",
- slug: "Add a new project",
- }}
- className="flex items-center space-x-2 w-full cursor-pointer p-2 rounded-md hover:bg-gray-100 active:scale-95 transition-all duration-75"
- >
- <PlusCircle className="w-7 h-7 text-gray-600" />
- <span className="block truncate">Add a new project</span>
- </Listbox.Option>
- )}
- </Listbox.Options>
- </Transition>
- </div>
- </Listbox>
- </div>
- );
-}
diff --git a/components/layout/app/project-select.tsx b/components/layout/app/project-select.tsx
new file mode 100644
index 0000000000..1a07acd993
--- /dev/null
+++ b/components/layout/app/project-select.tsx
@@ -0,0 +1,145 @@
+import { useRouter } from "next/router";
+import { useMemo } from "react";
+import { useSession } from "next-auth/react";
+import useSWR from "swr";
+import { useAddProjectModal } from "@/components/app/modals/add-project-modal";
+import BlurImage from "@/components/shared/blur-image";
+import { ChevronUpDown, PlusCircle, Tick } from "@/components/shared/icons";
+import Popover from "@/components/shared/popover";
+import useUsage from "@/lib/swr/use-usage";
+import { ProjectProps } from "@/lib/types";
+import { fetcher } from "@/lib/utils";
+
+export default function ProjectSelect() {
+ const { data: projects } = useSWR<ProjectProps[]>("/api/projects", fetcher);
+ const { AddProjectModal, setShowAddProjectModal } = useAddProjectModal({});
+
+ const router = useRouter();
+
+ const { data: session } = useSession();
+
+ const selected = useMemo(() => {
+ const { slug } = router.query;
+ return (
+ projects?.find((project) => project.slug === slug) || {
+ name: session?.user?.name || session?.user?.email || "User",
+ slug: "/",
+ domain: "dub.sh",
+ logo:
+ session?.user?.image ||
+ `https://avatars.dicebear.com/api/micah/${session?.user?.email}.svg`,
+ }
+ );
+ }, [router, projects, session]);
+
+ if (!projects || !router.isReady)
+ return (
+ <div className="w-60 h-12 px-2 rounded-lg bg-gray-100 animate-pulse flex justify-end items-center">
+ <ChevronUpDown className="h-4 w-4 text-gray-400" aria-hidden="true" />
+ </div>
+ );
+
+ return (
+ <div className="w-60">
+ <AddProjectModal />
+ <Popover
+ content={
+ <ProjectList
+ selected={selected}
+ projects={projects}
+ setShowAddProjectModal={setShowAddProjectModal}
+ />
+ }
+ >
+ <div className="relative cursor-pointer w-60 rounded-lg bg-white hover:bg-gray-100 py-1.5 pl-3 pr-10 text-left focus:outline-none text-sm transition-all duration-75">
+ <div className="flex justify-start items-center space-x-3">
+ <BlurImage
+ src={
+ selected.logo ||
+ `https://www.google.com/s2/favicons?sz=64&domain_url=${selected.domain}`
+ }
+ alt={selected.slug}
+ className="w-8 h-8 flex-shrink-0 rounded-full overflow-hidden border border-gray-300"
+ width={48}
+ height={48}
+ />
+ <span className="block truncate font-medium text-sm">
+ {selected.name}
+ </span>
+ </div>
+ <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
+ <ChevronUpDown
+ className="h-4 w-4 text-gray-400"
+ aria-hidden="true"
+ />
+ </span>
+ </div>
+ </Popover>
+ </div>
+ );
+}
+
+function ProjectList({
+ selected,
+ projects,
+ setShowAddProjectModal,
+}: {
+ selected: {
+ name: string;
+ slug: string;
+ domain: string;
+ logo?: string;
+ };
+ projects: ProjectProps[];
+ setShowAddProjectModal?: (show: boolean) => void;
+}) {
+ const router = useRouter();
+ const { plan } = useUsage();
+
+ return (
+ <div className="relative mt-1 max-h-60 w-full sm:w-60 overflow-auto rounded-md bg-white p-2 text-base sm:shadow-lg sm:text-sm">
+ {projects.map(({ name, slug, domain, logo }) => (
+ <button
+ key={slug}
+ className={`relative flex items-center space-x-2 p-2 rounded-md w-full hover:bg-gray-100 ${
+ selected.slug === slug ? "font-medium" : ""
+ } transition-all duration-75`}
+ onClick={() => router.push(`/${slug}`)}
+ >
+ <BlurImage
+ src={
+ logo ||
+ `https://www.google.com/s2/favicons?sz=64&domain_url=${domain}`
+ }
+ alt={slug}
+ className="w-7 h-7 rounded-full overflow-hidden"
+ width={48}
+ height={48}
+ />
+ <span
+ className={`block truncate text-sm ${
+ selected.slug === slug ? "font-medium" : "font-normal"
+ }`}
+ >
+ {name}
+ </span>
+ {selected.slug === slug ? (
+ <span className="absolute inset-y-0 right-0 flex items-center pr-3 text-black">
+ <Tick className="h-5 w-5" aria-hidden="true" />
+ </span>
+ ) : null}
+ </button>
+ ))}
+ {!(plan === "Free" && projects.length >= 5) && (
+ <button
+ key="add"
+ onClick={() => setShowAddProjectModal(true)}
+ className="flex items-center space-x-2 w-full cursor-pointer p-2 rounded-md hover:bg-gray-100 transition-all duration-75"
+ >
+ <PlusCircle className="w-7 h-7 text-gray-600" />
+ <span className="block truncate">Add a new project</span>
+ </button>
+ )}
+ </div>
+ );
+}
diff --git a/components/layout/app/user-dropdown.tsx b/components/layout/app/user-dropdown.tsx
index a36448e161..36fb138877 100644
--- a/components/layout/app/user-dropdown.tsx
+++ b/components/layout/app/user-dropdown.tsx
@@ -1,41 +1,33 @@
import { Fragment } from "react";
-import { Menu, Transition } from "@headlessui/react";
import { signOut, useSession } from "next-auth/react";
+import Popover from "@/components/shared/popover";
export default function UserDropdown() {
const { data: session } = useSession();
return (
- <Menu as="div" className="relative inline-block text-left">
- <div>
- <Menu.Button className="rounded-full overflow-hidden border border-gray-300 w-10 h-10 flex justify-center items-center active:scale-95 focus:outline-none transition-all duration-75">
+ <div className="relative inline-block text-left">
+ <Popover
+ content={
+ <div className="p-1 w-full sm:w-56 rounded-md bg-white">
+ <button
+ className="relative p-2 rounded-md w-full hover:bg-gray-100 transition-all duration-75"
+ onClick={() => signOut()}
+ >
+ Logout
+ </button>
+ </div>
+ }
+ align="end"
+ >
+ <div className="rounded-full overflow-hidden border border-gray-300 w-10 h-10 flex justify-center items-center active:scale-95 focus:outline-none transition-all duration-75">
{session && (
<img
alt={session?.user?.email || "Avatar for logged in user"}
src={`https://avatars.dicebear.com/api/micah/${session?.user?.email}.svg`}
/>
)}
- </Menu.Button>
- </div>
- <Transition
- as={Fragment}
- enter="transition ease-out duration-100"
- enterFrom="transform opacity-0 scale-95"
- enterTo="transform opacity-100 scale-100"
- leave="transition ease-in duration-75"
- leaveFrom="transform opacity-100 scale-100"
- leaveTo="transform opacity-0 scale-95"
- >
- <Menu.Items className="absolute right-0 mt-2 p-1 w-56 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
- <Menu.Item>
- <button
- className="text-gray-900 hover:bg-gray-100 group flex w-full items-center rounded-md px-2 py-2 text-sm"
- onClick={() => signOut()}
- >
- Logout
- </button>
- </Menu.Item>
- </Menu.Items>
- </Transition>
- </Menu>
+ </div>
+ </Popover>
+ </div>
);
}
diff --git a/components/shared/icons/calendar.tsx b/components/shared/icons/calendar.tsx
new file mode 100644
index 0000000000..a429c8d4a7
--- /dev/null
+++ b/components/shared/icons/calendar.tsx
@@ -0,0 +1,21 @@
+export default function Calendar({ className }: { className: string }) {
+ return (
+ <svg
+ fill="none"
+ shapeRendering="geometricPrecision"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ viewBox="0 0 24 24"
+ width="24"
+ height="24"
+ className={className}
+ >
+ <rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
+ <path d="M16 2v4" />
+ <path d="M8 2v4" />
+ <path d="M3 10h18" />
+ </svg>
+ );
+}
diff --git a/components/shared/icons/index.tsx b/components/shared/icons/index.tsx
index 1544dfee43..b93674aea2 100644
--- a/components/shared/icons/index.tsx
+++ b/components/shared/icons/index.tsx
@@ -29,3 +29,4 @@ export { default as UploadCloud } from "./upload-cloud";
export { default as Lock } from "./lock";
export { default as QR } from "./qr";
export { default as Download } from "./download";
+export { default as Calendar } from "./calendar";
diff --git a/components/shared/popover.tsx b/components/shared/popover.tsx
new file mode 100644
index 0000000000..06ec1974cc
--- /dev/null
+++ b/components/shared/popover.tsx
@@ -0,0 +1,128 @@
+import { useRouter } from "next/router";
+import { ReactNode, useEffect, useRef, useState } from "react";
+import * as PopoverPrimitive from "@radix-ui/react-popover";
+import { AnimatePresence, motion, useAnimation } from "framer-motion";
+import useViewportSize from "@/lib/hooks/use-viewport-size";
+
+export default function Popover({
+ children,
+ content,
+ align = "center",
+}: {
+ children: ReactNode;
+ content: ReactNode | string;
+ align?: "center" | "start" | "end";
+}) {
+ const [openPopover, setOpenPopover] = useState(false);
+ const router = useRouter();
+
+ const mobileTooltipRef = useRef(null);
+ const controls = useAnimation();
+ const transitionProps = { type: "spring", stiffness: 500, damping: 30 };
+
+ async function handleDragEnd(_, info) {
+ const offset = info.offset.y;
+ const velocity = info.velocity.y;
+ const height = mobileTooltipRef.current.getBoundingClientRect().height;
+ if (offset > height / 2 || velocity > 800) {
+ await controls.start({ y: "100%", transition: transitionProps });
+ setOpenPopover(false);
+ } else {
+ controls.start({ y: 0, transition: transitionProps });
+ }
+ }
+ const { width } = useViewportSize();
+
+ // workaround to make popover close when route changes on desktop
+ useEffect(() => {
+ setOpenPopover(false);
+ }, [router.asPath]);
+
+ return (
+ <>
+ <button
+ className="inline-flex sm:hidden"
+ type="button"
+ onClick={() => setOpenPopover(true)}
+ >
+ {children}
+ </button>
+ <AnimatePresence>
+ {openPopover && (
+ <>
+ <motion.div
+ ref={mobileTooltipRef}
+ key="mobile-tooltip"
+ className="group fixed bottom-0 inset-x-0 z-40 w-screen sm:hidden cursor-grab active:cursor-grabbing"
+ initial={{ y: "100%" }}
+ animate={{
+ y: openPopover ? 0 : "100%",
+ transition: transitionProps,
+ }}
+ exit={{ y: "100%" }}
+ transition={transitionProps}
+ drag="y"
+ dragDirectionLock
+ onDragEnd={handleDragEnd}
+ dragElastic={{ top: 0, bottom: 1 }}
+ dragConstraints={{ top: 0, bottom: 0 }}
+ >
+ <div
+ className={`h-7 bg-white w-full flex items-center justify-center rounded-t-4xl border-t border-gray-200 -mb-1`}
+ >
+ <div className="rounded-full h-1 w-6 -mr-1 bg-gray-300 group-active:rotate-12 transition-all" />
+ <div className="rounded-full h-1 w-6 bg-gray-300 group-active:-rotate-12 transition-all" />
+ </div>
+ <div className="flex items-center justify-center w-full overflow-hidden align-middle bg-white shadow-xl min-h-[150px]">
+ {typeof content === "string" ? (
+ <span className="block text-sm text-center text-gray-700 max-w-xs">
+ {content}
+ </span>
+ ) : (
+ content
+ )}
+ </div>
+ </motion.div>
+ <motion.div
+ key="mobile-tooltip-backdrop"
+ className="fixed inset-0 z-30 bg-gray-100 bg-opacity-10 backdrop-blur sm:hidden"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ exit={{ opacity: 0 }}
+ onClick={() => setOpenPopover(false)}
+ />
+ </>
+ )}
+ </AnimatePresence>
+ <PopoverPrimitive.Root
+ // workaround to make popover work on mobile (without this it'll automatically close on click without changing route)
+ open={width > 640 && openPopover}
+ onOpenChange={width > 640 && setOpenPopover}
+ >
+ <PopoverPrimitive.Trigger className="hidden sm:inline-flex" asChild>
+ <button type="button" onClick={() => setOpenPopover(!openPopover)}>
+ {children}
+ </button>
+ </PopoverPrimitive.Trigger>
+ <PopoverPrimitive.Content
+ sideOffset={4}
+ side="top"
+ align={align}
+ className="hidden sm:block animate-slide-up-fade items-center rounded-md overflow-hidden z-20 bg-white border border-gray-200 drop-shadow-lg"
+ >
+ <PopoverPrimitive.Arrow className="fill-current text-white" />
+ {typeof content === "string" ? (
+ <div className="p-5">
+ <span className="block text-sm text-center text-gray-700 max-w-xs">
+ {content}
+ </span>
+ </div>
+ ) : (
+ content
+ )}
+ <PopoverPrimitive.Arrow className="fill-current text-white" />
+ </PopoverPrimitive.Content>
+ </PopoverPrimitive.Root>
+ </>
+ );
+}
diff --git a/lib/api/links.ts b/lib/api/links.ts
index 77e7507277..9c8c9ea7ca 100644
--- a/lib/api/links.ts
+++ b/lib/api/links.ts
@@ -27,6 +27,15 @@ export async function getLinksForProject({
});
}
+export async function getLinkCountForProject(domain: string) {
+ return await prisma.link.count({
+ where: {
+ domain,
+ archived: false,
+ },
+ });
+}
+
export async function checkIfKeyExists(domain: string, key: string) {
if (
domain === "dub.sh" &&
@@ -48,9 +57,10 @@ export async function checkIfKeyExists(domain: string, key: string) {
export async function addLink(link: LinkProps) {
const { domain, key, url, expiresAt, password, title, description, image } =
link;
- const hasPassword = password && password.length > 0;
+ const hasPassword = password && password.length > 0 ? true : false;
const proxy = title && description && image ? true : false;
- const exat = expiresAt ? expiresAt.getTime() : null;
+ const exat = expiresAt ? new Date(expiresAt).getTime() / 1000 : null;
+ console.log(expiresAt, exat);
const exists = await checkIfKeyExists(domain, key);
if (exists) return null;
diff --git a/lib/hooks/use-viewport-size.ts b/lib/hooks/use-viewport-size.ts
new file mode 100644
index 0000000000..247e891b2b
--- /dev/null
+++ b/lib/hooks/use-viewport-size.ts
@@ -0,0 +1,34 @@
+import { useEffect, useState } from "react";
+
+interface ViewportSize {
+ width: number;
+ height: number;
+}
+
+function getViewportSize(): ViewportSize {
+ const { innerWidth: width, innerHeight: height } = window;
+ return {
+ width,
+ height,
+ };
+}
+
+export default function useViewportSize(): ViewportSize {
+ const [viewportSize, setViewportSize] = useState<ViewportSize>({
+ width: 0,
+ height: 0,
+ });
+
+ useEffect(() => {
+ setViewportSize(getViewportSize());
+
+ function handleResize() {
+ setViewportSize(getViewportSize());
+ }
+
+ window.addEventListener("resize", handleResize);
+ return () => window.removeEventListener("resize", handleResize);
+ }, []);
+
+ return viewportSize;
+}
diff --git a/lib/utils.ts b/lib/utils.ts
index c8601b10da..8a96be3d86 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -113,6 +113,22 @@ export const timeAgo = (timestamp: Date): string => {
return `${ms(Date.now() - new Date(timestamp).getTime())} ago`;
};
+export const getDateTimeLocal = (timestamp?: Date): string => {
+ if (!timestamp) {
+ const d = new Date();
+ return new Date(d.getTime() - d.getTimezoneOffset() * 60000)
+ .toISOString()
+ .split(":")
+ .slice(0, 2)
+ .join(":");
+ }
+ return new Date(timestamp.getTime() - timestamp.getTimezoneOffset() * 60000)
+ .toISOString()
+ .split(":")
+ .slice(0, 2)
+ .join(":");
+};
+
export const generateSlugFromName = (name: string) => {
const normalizedName = name.toLowerCase().replaceAll(" ", "-");
if (normalizedName.length < 3) {
diff --git a/package.json b/package.json
index d9b399468d..88b558c27c 100644
--- a/package.json
+++ b/package.json
@@ -12,9 +12,9 @@
"start": "next start"
},
"dependencies": {
- "@headlessui/react": "^1.6.6",
"@next-auth/prisma-adapter": "^1.0.4",
"@prisma/client": "^4.3.1",
+ "@radix-ui/react-popover": "^1.0.2",
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
diff --git a/pages/api/projects/[slug]/domains/[domain]/links/count.ts b/pages/api/projects/[slug]/domains/[domain]/links/count.ts
index c7b8c46148..57f5272aa3 100644
--- a/pages/api/projects/[slug]/domains/[domain]/links/count.ts
+++ b/pages/api/projects/[slug]/domains/[domain]/links/count.ts
@@ -1,6 +1,6 @@
import { NextApiRequest, NextApiResponse } from "next";
+import { getLinkCountForProject } from "@/lib/api/links";
import { withProjectAuth } from "@/lib/auth";
-import { getLinkCountForProject } from "@/lib/upstash";
export default withProjectAuth(
async (req: NextApiRequest, res: NextApiResponse) => {
diff --git a/yarn.lock b/yarn.lock
index 732e99fb81..862cbbc796 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -303,11 +303,6 @@
resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
-"@headlessui/react@^1.6.6":
- version "1.6.6"
- resolved "https://registry.npmjs.org/@headlessui/react/-/react-1.6.6.tgz"
- integrity sha512-MFJtmj9Xh/hhBMhLccGbBoSk+sk61BlP6sJe4uQcVMtXZhCgGqd2GyIQzzmsdPdTEWGSF434CBi8mnhR6um46Q==
-
"@isaacs/string-locale-compare@^1.1.0":
version "1.1.0"
resolved "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz"
@@ -730,6 +725,14 @@
"@babel/runtime" "^7.13.10"
"@radix-ui/react-primitive" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.1.tgz#5246adf79e97f89e819af68da51ddcf349ecf1c4"
+ integrity sha512-1yientwXqXcErDHEv8av9ZVNEBldH8L9scVR3is20lL+jOCfcJyMFZFEY5cgIrgexsq1qggSXqiEL/d/4f+QXA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-primitive" "1.0.1"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-1.0.0.tgz#0ec4c72fabd35a03b5787075ac799e3b17ca5710"
@@ -774,6 +777,35 @@
"@radix-ui/react-use-callback-ref" "1.0.0"
"@radix-ui/react-use-escape-keydown" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.2.tgz#f04d1061bddf00b1ca304148516b9ddc62e45fb2"
+ integrity sha512-WjJzMrTWROozDqLB0uRWYvj4UuXsM/2L19EmQ3Au+IJWqwvwq9Bwd+P8ivo0Deg9JDPArR1I6MbWNi1CmXsskg==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.0"
+ "@radix-ui/react-compose-refs" "1.0.0"
+ "@radix-ui/react-primitive" "1.0.1"
+ "@radix-ui/react-use-callback-ref" "1.0.0"
+ "@radix-ui/react-use-escape-keydown" "1.0.2"
+
+"@radix-ui/[email protected]":
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.0.tgz#339c1c69c41628c1a5e655f15f7020bf11aa01fa"
+ integrity sha512-UagjDk4ijOAnGu4WMUPj9ahi7/zJJqNZ9ZAiGPp7waUWJO0O1aWXi/udPphI0IUjvrhBsZJGSN66dR2dsueLWQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.1.tgz#faea8c25f537c5a5c38c50914b63722db0e7f951"
+ integrity sha512-Ej2MQTit8IWJiS2uuujGUmxXjF/y5xZptIIQnyd2JHLwtV0R2j9NRVoRj/1j/gJ7e3REdaBw4Hjf4a1ImhkZcQ==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-compose-refs" "1.0.0"
+ "@radix-ui/react-primitive" "1.0.1"
+ "@radix-ui/react-use-callback-ref" "1.0.0"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.0.tgz"
@@ -793,6 +825,28 @@
"@radix-ui/react-id" "1.0.0"
"@radix-ui/react-primitive" "1.0.0"
+"@radix-ui/react-popover@^1.0.2":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.0.2.tgz#f761c8aafb61519522b8e80501c589e619073a2c"
+ integrity sha512-4tqZEl9w95R5mlZ/sFdgBnfhCBOEPepLIurBA5kt/qaAhldJ1tNQd0ngr0ET0AHbPotT4mwxMPr7a+MA/wbK0g==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.0"
+ "@radix-ui/react-compose-refs" "1.0.0"
+ "@radix-ui/react-context" "1.0.0"
+ "@radix-ui/react-dismissable-layer" "1.0.2"
+ "@radix-ui/react-focus-guards" "1.0.0"
+ "@radix-ui/react-focus-scope" "1.0.1"
+ "@radix-ui/react-id" "1.0.0"
+ "@radix-ui/react-popper" "1.0.1"
+ "@radix-ui/react-portal" "1.0.1"
+ "@radix-ui/react-presence" "1.0.0"
+ "@radix-ui/react-primitive" "1.0.1"
+ "@radix-ui/react-slot" "1.0.1"
+ "@radix-ui/react-use-controllable-state" "1.0.0"
+ aria-hidden "^1.1.1"
+ react-remove-scroll "2.5.5"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.0.0.tgz"
@@ -809,6 +863,22 @@
"@radix-ui/react-use-size" "1.0.0"
"@radix-ui/rect" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.0.1.tgz#9fa8a6a493404afa225866a5cd75af23d141baa0"
+ integrity sha512-J4Vj7k3k+EHNWgcKrE+BLlQfpewxA7Zd76h5I0bIa+/EqaIZ3DuwrbPj49O3wqN+STnXsBuxiHLiF0iU3yfovw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@floating-ui/react-dom" "0.7.2"
+ "@radix-ui/react-arrow" "1.0.1"
+ "@radix-ui/react-compose-refs" "1.0.0"
+ "@radix-ui/react-context" "1.0.0"
+ "@radix-ui/react-primitive" "1.0.1"
+ "@radix-ui/react-use-layout-effect" "1.0.0"
+ "@radix-ui/react-use-rect" "1.0.0"
+ "@radix-ui/react-use-size" "1.0.0"
+ "@radix-ui/rect" "1.0.0"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.0.tgz"
@@ -817,6 +887,14 @@
"@babel/runtime" "^7.13.10"
"@radix-ui/react-primitive" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.1.tgz#169c5a50719c2bb0079cf4c91a27aa6d37e5dd33"
+ integrity sha512-NY2vUWI5WENgAT1nfC6JS7RU5xRYBfjZVLq0HmgEN1Ezy3rk/UruMV4+Rd0F40PEaFC5SrLS1ixYvcYIQrb4Ig==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-primitive" "1.0.1"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.0.tgz"
@@ -834,6 +912,14 @@
"@babel/runtime" "^7.13.10"
"@radix-ui/react-slot" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.1.tgz#c1ebcce283dd2f02e4fbefdaa49d1cb13dbc990a"
+ integrity sha512-fHbmislWVkZaIdeF6GZxF0A/NH/3BjrGIYj+Ae6eTmTCr7EB0RQAAVEiqsXK6p3/JcRqVSBQoceZroj30Jj3XA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-slot" "1.0.1"
+
"@radix-ui/react-slider@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@radix-ui/react-slider/-/react-slider-1.0.0.tgz#4cabadd243aa088eb45ac710cd7cdc518fafb07e"
@@ -860,6 +946,14 @@
"@babel/runtime" "^7.13.10"
"@radix-ui/react-compose-refs" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.1.tgz#e7868c669c974d649070e9ecbec0b367ee0b4d81"
+ integrity sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-compose-refs" "1.0.0"
+
"@radix-ui/react-switch@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@radix-ui/react-switch/-/react-switch-1.0.0.tgz#f714eb81da7b16dae7f5ab6e774e3194d8f009b6"
@@ -917,6 +1011,14 @@
"@babel/runtime" "^7.13.10"
"@radix-ui/react-use-callback-ref" "1.0.0"
+"@radix-ui/[email protected]":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.2.tgz#09ab6455ab240b4f0a61faf06d4e5132c4d639f6"
+ integrity sha512-DXGim3x74WgUv+iMNCF+cAo8xUHHeqvjx8zs7trKf+FkQKPQXLk2sX7Gx1ysH7Q76xCpZuxIJE7HLPxRE+Q+GA==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/react-use-callback-ref" "1.0.0"
+
"@radix-ui/[email protected]":
version "1.0.0"
resolved "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.0.tgz"
@@ -1707,6 +1809,13 @@ arg@^5.0.2:
resolved "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz"
integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==
+aria-hidden@^1.1.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.1.tgz#ad8c1edbde360b454eb2bf717ea02da00bfee0f8"
+ integrity sha512-PN344VAf9j1EAi+jyVHOJ8XidQdPVssGco39eNcsGdM4wcsILtxrKLkbuiMfLWYROK1FjRQasMWCBttrhjnr6A==
+ dependencies:
+ tslib "^2.0.0"
+
asap@^2.0.0:
version "2.0.6"
resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
@@ -2469,6 +2578,11 @@ depd@^1.1.2:
resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz"
integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==
+detect-node-es@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493"
+ integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==
+
version "2.0.4"
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c"
@@ -3031,6 +3145,11 @@ get-intrinsic@^1.0.2:
has "^1.0.3"
has-symbols "^1.0.3"
+get-nonce@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3"
+ integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==
+
get-uri@3:
version "3.0.2"
resolved "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz"
@@ -3338,6 +3457,13 @@ internmap@^1.0.0:
resolved "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz"
integrity sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==
+invariant@^2.2.4:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
+ integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
+ dependencies:
+ loose-envify "^1.0.0"
+
ip-regex@^4.1.0:
version "4.3.0"
resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz"
@@ -3711,7 +3837,7 @@ [email protected], lodash@^4.17.15, lodash@^4.17.21:
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
-loose-envify@^1.1.0, loose-envify@^1.4.0:
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -5223,6 +5349,25 @@ react-reconciler@^0.26.1:
object-assign "^4.1.1"
scheduler "^0.20.2"
+react-remove-scroll-bar@^2.3.3:
+ version "2.3.4"
+ resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz#53e272d7a5cb8242990c7f144c44d8bd8ab5afd9"
+ integrity sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==
+ dependencies:
+ react-style-singleton "^2.2.1"
+ tslib "^2.0.0"
+
+ version "2.5.5"
+ resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77"
+ integrity sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==
+ dependencies:
+ react-remove-scroll-bar "^2.3.3"
+ react-style-singleton "^2.2.1"
+ tslib "^2.1.0"
+ use-callback-ref "^1.3.0"
+ use-sidecar "^1.1.2"
+
react-spring@^9.5.4:
version "9.5.4"
resolved "https://registry.npmjs.org/react-spring/-/react-spring-9.5.4.tgz"
@@ -5235,6 +5380,15 @@ react-spring@^9.5.4:
"@react-spring/web" "~9.5.4"
"@react-spring/zdog" "~9.5.4"
+react-style-singleton@^2.2.1:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4"
+ integrity sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==
+ dependencies:
+ get-nonce "^1.0.0"
+ invariant "^2.2.4"
+ tslib "^2.0.0"
+
react-textarea-autosize@^8.3.4:
version "8.3.4"
resolved "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz"
@@ -5849,7 +6003,7 @@ treeverse@^2.0.0:
resolved "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz"
integrity sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==
[email protected], tslib@^2.0.1, tslib@^2.0.3, tslib@^2.2.0, tslib@^2.3.1, tslib@^2.4.0:
[email protected], tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.1, tslib@^2.4.0:
version "2.4.0"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
@@ -5942,6 +6096,13 @@ url-parse@^1.5.3:
querystringify "^2.1.1"
requires-port "^1.0.0"
+use-callback-ref@^1.3.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.0.tgz#772199899b9c9a50526fedc4993fc7fa1f7e32d5"
+ integrity sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==
+ dependencies:
+ tslib "^2.0.0"
+
use-composed-ref@^1.3.0:
version "1.3.0"
resolved "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.3.0.tgz"
@@ -5964,6 +6125,14 @@ use-latest@^1.2.1:
dependencies:
use-isomorphic-layout-effect "^1.1.1"
+use-sidecar@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2"
+ integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==
+ dependencies:
+ detect-node-es "^1.1.0"
+ tslib "^2.0.0"
+
[email protected], use-sync-external-store@^1.1.0:
version "1.2.0"
resolved "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz"