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 more testimonials + reorder testimonials

Steven Teyb419a5e5ec29
diff --git a/components/home/testimonials.tsx b/components/home/testimonials.tsx
index e8630ebd69..90f5d3a850 100644
--- a/components/home/testimonials.tsx
+++ b/components/home/testimonials.tsx
@@ -22,7 +22,7 @@ export default function Testimonials({
Don't take it from us - here's what our users have to say about Dub.
</p>
</div>
- <div className="space-y-6 py-8 sm:columns-2 sm:gap-6 xl:columns-3">
+ <div className="block space-y-6 py-8 sm:columns-2 sm:gap-6 xl:columns-3">
{tweets.map((tweet, idx) => (
<Tweet
key={tweet.id}
diff --git a/components/shared/tweet.tsx b/components/shared/tweet.tsx
index cb2baa1d3c..d92c908264 100644
--- a/components/shared/tweet.tsx
+++ b/components/shared/tweet.tsx
@@ -1,5 +1,5 @@
import BlurImage from "@/components/shared/blur-image";
-import { nFormatter } from "@/lib/utils";
+import { nFormatter, truncate } from "@/lib/utils";
import { Heart, Message, Repeat, Twitter } from "./icons";
import Tilt from "react-parallax-tilt";
@@ -85,7 +85,7 @@ export default function Tweet({
<div
className={`${
className || ""
- } rounded-lg border border-gray-300 bg-white/10 p-6 pb-4 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.3)] backdrop-blur-sm`}
+ } break-inside-avoid rounded-lg border border-gray-300 bg-white/10 p-6 pb-4 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.3)] backdrop-blur-sm`}
>
{/* User info, verified badge, twitter logo, text, etc. */}
<div>
@@ -107,7 +107,7 @@ export default function Tweet({
rel="noreferrer"
className="flex items-center font-semibold text-gray-900"
>
- {author.name}
+ {truncate(author.name, 20)}
{author.verified ? (
<svg
aria-label="Verified Account"
@@ -127,7 +127,7 @@ export default function Tweet({
rel="noreferrer"
className="text-sm text-gray-500 transition-all duration-75 hover:text-gray-900"
>
- @{author.username}
+ @{truncate(author.username, 16)}
</a>
<p>·</p>
<a
diff --git a/lib/twitter/index.ts b/lib/twitter/index.ts
index 3abb5a6fdb..c0ba80a7d3 100644
--- a/lib/twitter/index.ts
+++ b/lib/twitter/index.ts
@@ -7,8 +7,11 @@ export default function getTweetsMetadata(ids: string[]) {
export const homepageTweets = [
"1574639172605816832",
"1573744854655533069",
- "1581017931043196928",
- "1580891783277395970",
+ "1585994819146391553",
+ "1586745532386578433",
"1582956754425421825",
- "1574164441498894339",
+ "1580891783277395970",
+ "1581017931043196928",
+ "1586262340949139456",
+ "1580479816071270401",
];
diff --git a/lib/utils.ts b/lib/utils.ts
index 965c32c3da..9e9bc3756f 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -267,3 +267,8 @@ export const getQueryString = (router: NextRouter) => {
const queryString = new URLSearchParams(queryWithoutSlug).toString();
return `${queryString ? "?" : ""}${queryString}`;
};
+
+export const truncate = (str: string, length: number) => {
+ if (str.length <= length) return str;
+ return `${str.slice(0, length)}...`;
+};