Skip to content

Commit 8758a33

Browse files
committed
add: csb faucet
1 parent e29b4d9 commit 8758a33

File tree

7 files changed

+47
-4
lines changed

7 files changed

+47
-4
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"use client"
2+
3+
import { useTranslations } from "next-intl"
4+
5+
import { useWalletClaimCSBModal } from "@crossbell/connect-kit"
6+
7+
import { Button } from "~/components/ui/Button"
8+
9+
export function ClaimCSBButton() {
10+
const t = useTranslations()
11+
const claimCSBModal = useWalletClaimCSBModal()
12+
return (
13+
<Button
14+
onClick={() => claimCSBModal.show()}
15+
aria-label="claim csb"
16+
isAutoWidth
17+
>
18+
{t("Claim CSB")}
19+
</Button>
20+
)
21+
}

src/components/common/ConnectButton.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,15 @@ export const ConnectButton = ({
276276
</div>
277277
}
278278
></Menu>
279+
<i
280+
className={cn(
281+
"i-mingcute-currency-euro-line",
282+
`${
283+
size === "base" ? "size-6 ml-2" : "size-5 ml-1"
284+
} text-zinc-500 cursor-pointer hidden sm:block`,
285+
)}
286+
onClick={() => csbDetailModal.show()}
287+
/>
279288
<div className="h-full w-[2px] py-1 ml-2">
280289
<div className="size-full bg-zinc-200 rounded-full"></div>
281290
</div>

src/components/home/HomeSidebar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import getQueryClient from "~/lib/query-client"
1111
import { getShowcase } from "~/queries/home.server"
1212
import { getBlockNumber } from "~/queries/site.server"
1313

14+
import { ClaimCSBButton } from "../common/ClaimCSBButton"
1415
import { FollowAllButton } from "../common/FollowAllButton"
1516
import { BlockNumber } from "./BlockNumber"
1617
import PromotionLinks from "./PromotionLinks"
@@ -91,6 +92,10 @@ export async function HomeSidebar({ hideSearch }: { hideSearch?: boolean }) {
9192
</>
9293
</ShowMoreContainer>
9394
</div>
95+
<div className="text-center text-zinc-700 space-y-3">
96+
<p className="font-bold text-lg">{t("Need More CSB?")}</p>
97+
<ClaimCSBButton />
98+
</div>
9499
</Hydrate>
95100
)
96101
}

src/messages/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,7 @@
117117
"zh": "Chinese",
118118
"zh-TW": "Traditional Chinese",
119119
"Confirmed by {blockNumber} blocks": "Confirmed by {blockNumber} blocks",
120-
"Become a patron of {name}": "Become a patron of {name}"
120+
"Become a patron of {name}": "Become a patron of {name}",
121+
"Need More CSB?": "Need More CSB?",
122+
"Claim CSB": "Claim CSB"
121123
}

src/messages/ja.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,7 @@
220220
"en": "英語",
221221
"ja": "日本語",
222222
"zh": "中国語",
223-
"zh-TW": "繁体字中国語"
223+
"zh-TW": "繁体字中国語",
224+
"Need More CSB?": "もっと CSB が必要ですか?",
225+
"Claim CSB": "CSB を請求"
224226
}

src/messages/zh-TW.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,5 +411,7 @@
411411
"New Short": "新增圖文",
412412
"Publishing": "你發佈的內容",
413413
"Support Markdown": "支援 Markdown 語法",
414-
"on-chain posting on": "條鏈上發布於"
414+
"on-chain posting on": "條鏈上發布於",
415+
"Need More CSB?": "需要更多 CSB?",
416+
"Claim CSB": "領取 CSB"
415417
}

src/messages/zh.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,5 +436,7 @@
436436
"zh-TW": "繁体中文",
437437
"Footer": "页脚",
438438
"Support Markdown": "支持 Markdown",
439-
"on-chain posting on": "条链上发布于"
439+
"on-chain posting on": "条链上发布于",
440+
"Need More CSB?": "需要更多 CSB?",
441+
"Claim CSB": "领取 CSB"
440442
}

0 commit comments

Comments
 (0)