@adland/react 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @adland/react
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b035828: add displayName for fc profiles
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [b035828]
|
|
12
|
+
- @adland/data@0.13.0
|
|
13
|
+
|
|
14
|
+
## 0.11.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 830019b: add symbols in ad for token & profile
|
|
19
|
+
|
|
3
20
|
## 0.11.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adland/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/react-dom": "^18.3.1",
|
|
34
34
|
"lucide-react": "0.561.0",
|
|
35
35
|
"tsup": "^8.0.1",
|
|
36
|
-
"@adland/data": "0.
|
|
36
|
+
"@adland/data": "0.13.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
|
@@ -34,9 +34,9 @@ const FarcasterProfileAdContent = ({ data }: { data: FarcasterProfileAd }) => {
|
|
|
34
34
|
</div>
|
|
35
35
|
)}
|
|
36
36
|
<div className="flex flex-row items-center gap-1">
|
|
37
|
-
{profileMetadata?.username ? (
|
|
37
|
+
{profileMetadata?.displayName || profileMetadata?.username ? (
|
|
38
38
|
<p className="text-sm font-bold text-primary truncate">
|
|
39
|
-
{profileMetadata.username}
|
|
39
|
+
{profileMetadata.displayName || `@${profileMetadata.username}`}
|
|
40
40
|
</p>
|
|
41
41
|
) : (
|
|
42
42
|
<p className="text-sm font-bold text-primary">FID: {fid}</p>
|
|
@@ -47,6 +47,11 @@ const FarcasterProfileAdContent = ({ data }: { data: FarcasterProfileAd }) => {
|
|
|
47
47
|
</span>
|
|
48
48
|
)}
|
|
49
49
|
</div>
|
|
50
|
+
{profileMetadata?.displayName && profileMetadata?.username && (
|
|
51
|
+
<p className="text-xs text-muted-foreground/80 truncate">
|
|
52
|
+
@{profileMetadata.username}
|
|
53
|
+
</p>
|
|
54
|
+
)}
|
|
50
55
|
{profileMetadata?.bio ? (
|
|
51
56
|
<p className="text-xs text-muted-foreground/80 line-clamp-1">
|
|
52
57
|
{profileMetadata.bio}
|
|
@@ -3,33 +3,10 @@ import sdk from "@farcaster/miniapp-sdk";
|
|
|
3
3
|
import BasicAdBody from "../BasicAdBody";
|
|
4
4
|
import { adCardIcon } from "../../utils/constants";
|
|
5
5
|
|
|
6
|
-
// Token Ad Component
|
|
7
6
|
const TokenAdContent = ({ data }: { data: TokenAd }) => {
|
|
8
7
|
const Icon = adCardIcon["token"];
|
|
9
8
|
const { data: tokenData, metadata: tokenMetadata } = data;
|
|
10
9
|
|
|
11
|
-
// Build block explorer URL based on chainId
|
|
12
|
-
const getTokenUrl = () => {
|
|
13
|
-
const address = tokenData.address;
|
|
14
|
-
const chainId = tokenData.chainId;
|
|
15
|
-
|
|
16
|
-
// Common block explorers by chainId
|
|
17
|
-
const explorers: Record<number, string> = {
|
|
18
|
-
1: "https://etherscan.io/token/",
|
|
19
|
-
8453: "https://basescan.org/token/",
|
|
20
|
-
42161: "https://arbiscan.io/token/",
|
|
21
|
-
10: "https://optimistic.etherscan.io/token/",
|
|
22
|
-
137: "https://polygonscan.com/token/",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const baseUrl = explorers[chainId];
|
|
26
|
-
if (baseUrl) {
|
|
27
|
-
return `${baseUrl}${address}`;
|
|
28
|
-
}
|
|
29
|
-
// Fallback to Etherscan if chain not recognized
|
|
30
|
-
return `https://etherscan.io/token/${address}`;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
10
|
return (
|
|
34
11
|
<BasicAdBody
|
|
35
12
|
name={"TOKEN"}
|
|
@@ -56,7 +33,7 @@ const TokenAdContent = ({ data }: { data: TokenAd }) => {
|
|
|
56
33
|
)}
|
|
57
34
|
{tokenMetadata?.symbol ? (
|
|
58
35
|
<p className="text-sm font-bold text-primary truncate">
|
|
59
|
-
{tokenMetadata.symbol.toUpperCase()}
|
|
36
|
+
${tokenMetadata.symbol.toUpperCase()}
|
|
60
37
|
</p>
|
|
61
38
|
) : (
|
|
62
39
|
<p className="text-sm font-bold text-primary">TOKEN</p>
|