feat: configable CSB_IO and CSB_SCAN
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { APP_NAME, OUR_DOMAIN } from "~/lib/env"
|
||||
import { CSB_SCAN } from "~/lib/env"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { Profile, Note } from "~/lib/types"
|
||||
import { Disclosure } from "@headlessui/react"
|
||||
@@ -40,7 +40,7 @@ export const BlockchainInfo: React.FC<{
|
||||
Blockchain Transaction
|
||||
{(
|
||||
page?.related_urls?.filter((url) =>
|
||||
url.startsWith("https://scan.crossbell.io/tx/"),
|
||||
url.startsWith(CSB_SCAN + "/tx/"),
|
||||
) || site?.metadata?.transactions
|
||||
)?.length > 1
|
||||
? "s"
|
||||
@@ -49,9 +49,7 @@ export const BlockchainInfo: React.FC<{
|
||||
<div>
|
||||
{page
|
||||
? page?.related_urls
|
||||
?.filter((url) =>
|
||||
url.startsWith("https://scan.crossbell.io/tx/"),
|
||||
)
|
||||
?.filter((url) => url.startsWith(CSB_SCAN + "/tx/"))
|
||||
.map((url) => {
|
||||
return (
|
||||
<a
|
||||
@@ -62,12 +60,10 @@ export const BlockchainInfo: React.FC<{
|
||||
key={url}
|
||||
>
|
||||
{url
|
||||
.replace("https://scan.crossbell.io/tx/", "")
|
||||
.replace(CSB_SCAN + "/tx/", "")
|
||||
.slice(0, 10)}
|
||||
...
|
||||
{url
|
||||
.replace("https://scan.crossbell.io/tx/", "")
|
||||
.slice(-10)}
|
||||
{url.replace(CSB_SCAN + "/tx/", "").slice(-10)}
|
||||
</a>
|
||||
)
|
||||
})
|
||||
@@ -77,7 +73,7 @@ export const BlockchainInfo: React.FC<{
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="inline-block mr-4 break-all"
|
||||
href={`https://scan.crossbell.io/tx/${hash}`}
|
||||
href={`${CSB_SCAN}/tx/${hash}`}
|
||||
key={hash}
|
||||
>
|
||||
{hash.slice(0, 10)}...{hash.slice(-10)}
|
||||
@@ -133,7 +129,7 @@ export const BlockchainInfo: React.FC<{
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="inline-block mr-4 break-all"
|
||||
href={`https://scan.crossbell.io/address/${
|
||||
href={`${CSB_SCAN}/address/${
|
||||
page?.metadata?.owner || site?.metadata?.owner
|
||||
}`}
|
||||
key={page?.metadata?.owner || site?.metadata?.owner}
|
||||
|
||||
@@ -20,6 +20,7 @@ import data from "@emoji-mart/data"
|
||||
import Picker from "@emoji-mart/react"
|
||||
import { Popover } from "@headlessui/react"
|
||||
import { EmojiHappyIcon } from "@heroicons/react/outline"
|
||||
import { CSB_SCAN, CSB_IO } from "~/lib/env"
|
||||
|
||||
dayjs.extend(duration)
|
||||
dayjs.extend(relativeTime)
|
||||
@@ -149,7 +150,7 @@ export const Comment: React.FC<{
|
||||
className="flex border-b border-dashed py-6"
|
||||
>
|
||||
<UniLink
|
||||
href={`https://crossbell.kindjeff.com/@${comment?.character?.handle}`}
|
||||
href={CSB_IO && `${CSB_IO}/@${comment?.character?.handle}`}
|
||||
className="align-middle mr-3"
|
||||
>
|
||||
<Avatar
|
||||
@@ -161,7 +162,7 @@ export const Comment: React.FC<{
|
||||
<div className="flex-1 flex flex-col rounded-lg">
|
||||
<div className="mb-2 text-sm">
|
||||
<UniLink
|
||||
href={`https://crossbell.kindjeff.com/@${comment?.character?.handle}`}
|
||||
href={CSB_IO && `${CSB_IO}/@${comment?.character?.handle}`}
|
||||
className="font-medium text-indigo-600"
|
||||
>
|
||||
{comment?.character?.metadata?.content?.name}
|
||||
@@ -174,9 +175,7 @@ export const Comment: React.FC<{
|
||||
)
|
||||
.humanize()}{" "}
|
||||
ago ·{" "}
|
||||
<UniLink
|
||||
href={`https://scan.crossbell.io/tx/${comment.transactionHash}`}
|
||||
>
|
||||
<UniLink href={`${CSB_SCAN}/tx/${comment.transactionHash}`}>
|
||||
<BlockchainIcon className="w-3 h-3 inline-block" />
|
||||
</UniLink>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user