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.

fixed mobile link cards, added line-clamp

Steven Teya83e7d0d0eda
diff --git a/components/app/link-card.tsx b/components/app/link-card.tsx
index 3489c2287b..3d493299a9 100644
--- a/components/app/link-card.tsx
+++ b/components/app/link-card.tsx
@@ -35,7 +35,7 @@ export default function LinkCard({
});
return (
- <div className="flex justify-between items-center border border-gray-200 dark:border-gray-600 bg-white dark:bg-black p-4 rounded-md transition-all">
+ <div className="flex flex-col sm:flex-row justify-between items-start sm:items-center space-y-5 sm:space-y-0 border border-gray-200 dark:border-gray-600 bg-white dark:bg-black p-4 rounded-md transition-all">
<EditLinkModal />
<div className="relative flex items-center space-x-4">
<BlurImage
@@ -69,7 +69,7 @@ export default function LinkCard({
</a>
</Link>
</div>
- <h3 className="text-sm font-medium text-gray-700 dark:text-gray-200 truncate max-w-sm">
+ <h3 className="text-sm font-medium text-gray-700 dark:text-gray-200 line-clamp-1">
{title}
</h3>
</div>
diff --git a/components/shared/max-width-wrapper.tsx b/components/shared/max-width-wrapper.tsx
index 4df68d04ab..1b85150c80 100644
--- a/components/shared/max-width-wrapper.tsx
+++ b/components/shared/max-width-wrapper.tsx
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
export default function MaxWidthWrapper({ children }: { children: ReactNode }) {
return (
- <div className="w-full max-w-screen-xl mx-auto px-5 sm:px-20">
+ <div className="w-full max-w-screen-xl mx-auto px-2.5 sm:px-20">
{children}
</div>
);
diff --git a/package-lock.json b/package-lock.json
index 0cbed3193b..bace8e838d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38,6 +38,7 @@
"use-debounce": "^8.0.4"
},
"devDependencies": {
+ "@tailwindcss/line-clamp": "^0.4.2",
"@types/ms": "^0.7.31",
"@types/node": "17.0.35",
"@types/react": "18.0.9",
@@ -739,6 +740,15 @@
"tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1"
}
},
+ "node_modules/@tailwindcss/line-clamp": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz",
+ "integrity": "sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw==",
+ "dev": true,
+ "peerDependencies": {
+ "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1"
+ }
+ },
"node_modules/@types/d3-color": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.4.2.tgz",
@@ -5630,6 +5640,13 @@
"mini-svg-data-uri": "^1.2.3"
}
},
+ "@tailwindcss/line-clamp": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz",
+ "integrity": "sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw==",
+ "dev": true,
+ "requires": {}
+ },
"@types/d3-color": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.4.2.tgz",
diff --git a/package.json b/package.json
index 22093d592e..36f1f5b17a 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"use-debounce": "^8.0.4"
},
"devDependencies": {
+ "@tailwindcss/line-clamp": "^0.4.2",
"@types/ms": "^0.7.31",
"@types/node": "17.0.35",
"@types/react": "18.0.9",
diff --git a/tailwind.config.js b/tailwind.config.js
index 18cbb84f6c..d792b27e41 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -38,5 +38,9 @@ module.exports = {
},
},
},
- plugins: [require("@tailwindcss/forms"), require("tailwind-scrollbar-hide")],
+ plugins: [
+ require("@tailwindcss/forms"),
+ require("tailwind-scrollbar-hide"),
+ require("@tailwindcss/line-clamp"),
+ ],
};
diff --git a/yarn.lock b/yarn.lock
index 8f948118d6..ae2b1d62ed 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -502,6 +502,11 @@
dependencies:
"mini-svg-data-uri" "^1.2.3"
+"@tailwindcss/line-clamp@^0.4.2":
+ "integrity" "sha512-HFzAQuqYCjyy/SX9sLGB1lroPzmcnWv1FHkIpmypte10hptf4oPUfucryMKovZh2u0uiS9U5Ty3GghWfEJGwVw=="
+ "resolved" "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.2.tgz"
+ "version" "0.4.2"
+
"@tootallnate/once@2":
"version" "2.0.0"
@@ -2600,7 +2605,7 @@
"resolved" "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-1.1.7.tgz"
"version" "1.1.7"
-"tailwindcss@^3.1.2", "tailwindcss@>=3.0.0 || >= 3.0.0-alpha.1":
+"tailwindcss@^3.1.2", "tailwindcss@>=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1", "tailwindcss@>=3.0.0 || >= 3.0.0-alpha.1":
"integrity" "sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g=="
"resolved" "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.1.8.tgz"
"version" "3.1.8"