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.

make link filters modal mobile only

Steven Teyc083bab4ea12
diff --git a/components/app/modals/link-filters-modal.tsx b/components/app/modals/link-filters-modal.tsx
index 15f2f6deb7..bba103f463 100644
--- a/components/app/modals/link-filters-modal.tsx
+++ b/components/app/modals/link-filters-modal.tsx
@@ -21,6 +21,7 @@ function LinkFiltersModal({
<Modal
showModal={showLinkFiltersModal}
setShowModal={setShowLinkFiltersModal}
+ mobileOnly
>
<div className="inline-block w-full transform overflow-hidden bg-white pb-20 align-middle shadow-xl transition-all sm:max-w-md sm:rounded-2xl sm:border sm:border-gray-200">
<LinkFilters />
diff --git a/components/shared/modal.tsx b/components/shared/modal.tsx
index d52c8bb4ec..91a2b18457 100644
--- a/components/shared/modal.tsx
+++ b/components/shared/modal.tsx
@@ -15,12 +15,14 @@ export default function Modal({
setShowModal,
bgColor = "bg-white",
closeWithX,
+ mobileOnly,
}: {
children: React.ReactNode;
showModal: boolean;
setShowModal: Dispatch<SetStateAction<boolean>>;
bgColor?: string;
closeWithX?: boolean;
+ mobileOnly?: boolean;
}) {
const router = useRouter();
const { key } = router.query;
@@ -99,21 +101,23 @@ export default function Modal({
</div>
{children}
</motion.div>
- <motion.div
- ref={desktopModalRef}
- key="desktop-modal"
- className="fixed inset-0 z-40 hidden min-h-screen items-center justify-center sm:flex"
- initial={{ scale: 0.95 }}
- animate={{ scale: 1 }}
- exit={{ scale: 0.95 }}
- onMouseDown={(e) => {
- if (desktopModalRef.current === e.target) {
- closeModal(closeWithX);
- }
- }}
- >
- {children}
- </motion.div>
+ {!mobileOnly && (
+ <motion.div
+ ref={desktopModalRef}
+ key="desktop-modal"
+ className="fixed inset-0 z-40 hidden min-h-screen items-center justify-center sm:flex"
+ initial={{ scale: 0.95 }}
+ animate={{ scale: 1 }}
+ exit={{ scale: 0.95 }}
+ onMouseDown={(e) => {
+ if (desktopModalRef.current === e.target) {
+ closeModal(closeWithX);
+ }
+ }}
+ >
+ {children}
+ </motion.div>
+ )}
<motion.div
key="backdrop"
className="fixed inset-0 z-30 bg-gray-100 bg-opacity-10 backdrop-blur"