diff --git a/src/app/markets/components/PairsCard.tsx b/src/app/markets/components/PairsCard.tsx
index ba62ff1..370ef8d 100644
--- a/src/app/markets/components/PairsCard.tsx
+++ b/src/app/markets/components/PairsCard.tsx
@@ -41,7 +41,18 @@ export default function PairsCard({ title }: { title: string }) {
diff --git a/src/app/markets/components/TokenCard.tsx b/src/app/markets/components/TokenCard.tsx
index 9ba14dd..642afe8 100644
--- a/src/app/markets/components/TokenCard.tsx
+++ b/src/app/markets/components/TokenCard.tsx
@@ -1,5 +1,6 @@
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
+import { humanizeNumber } from "@/lib/renderUtils";
import { cn } from "@/lib/utils";
import { Token, TokenLiveData } from "@/modules/tokens/types";
import {
@@ -12,10 +13,13 @@ import {
GhostIcon,
IconNode,
LucideIcon,
+ UserIcon,
UsersIcon,
UserStarIcon,
ZapIcon,
} from "lucide-react";
+import Link from "next/link";
+import { useRouter } from "next/navigation";
export default function TokenCard({ token }: { token: Token }) {
const live: TokenLiveData = {
@@ -26,8 +30,16 @@ export default function TokenCard({ token }: { token: Token }) {
bundleHold: 3,
};
+ const router = useRouter();
+
return (
-
+
router.push(`/token/${token.mint}`)}
+ onContextMenu={() =>
+ window.open(`/token/${token.mint}`, "_blank", "noopener,noreferrer")
+ }
+ >
{token.logoURI ? (
-
+
{token.symbol}
-
+
{
+ e.preventDefault();
+ e.stopPropagation();
+ navigator.clipboard.writeText(token.mint);
+ }}
+ >
{token.name}
@@ -60,6 +79,28 @@ export default function TokenCard({ token }: { token: Token }) {
10
+
+ {token.twitterPost ? (
+ <>
+
{
+ e.stopPropagation();
+ }}
+ >
+ by @{token.twitterPost.author?.username}
+
+
+
+ {humanizeNumber(token.twitterPost.author?.followers)}
+
+ >
+ ) : (
+
by @username
+ )}
+
@@ -71,7 +112,13 @@ export default function TokenCard({ token }: { token: Token }) {
-
diff --git a/src/lib/renderUtils.ts b/src/lib/renderUtils.ts
new file mode 100644
index 0000000..ab706a0
--- /dev/null
+++ b/src/lib/renderUtils.ts
@@ -0,0 +1,6 @@
+export const humanizeNumber = (num: number) => {
+ return new Intl.NumberFormat("en", {
+ notation: "compact",
+ maximumFractionDigits: 1,
+ }).format(num);
+};
diff --git a/src/modules/tokens/types.ts b/src/modules/tokens/types.ts
index 958be07..8a3f3fb 100644
--- a/src/modules/tokens/types.ts
+++ b/src/modules/tokens/types.ts
@@ -3,6 +3,13 @@ export interface Token {
symbol: string;
name: string;
logoURI?: string;
+ twitterPost: {
+ link: string;
+ author: {
+ username: string;
+ followers: number;
+ };
+ };
}
export interface TokenLiveData {