feat: use site links

This commit is contained in:
DIYgod
2022-09-16 22:56:50 +01:00
parent 0505cb9128
commit bdc789ccf3
3 changed files with 20 additions and 6 deletions
+5 -2
View File
@@ -3,9 +3,10 @@ import { Modal } from "~/components/ui/Modal"
import InfiniteScroll from "react-infinite-scroller"
import { Button } from "../ui/Button"
import { UniLink } from "../ui/UniLink"
import { CSB_SCAN, CSB_IO } from "~/lib/env"
import { CSB_SCAN } from "~/lib/env"
import { Avatar } from "../ui/Avatar"
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
import { getSiteLink } from "~/lib/helpers"
export const CharacterList: React.FC<{
open: boolean
@@ -35,7 +36,9 @@ export const CharacterList: React.FC<{
key={index}
>
<UniLink
href={CSB_IO && `${CSB_IO}/@${sub?.character?.handle}`}
href={getSiteLink({
subdomain: sub?.character?.handle,
})}
className="flex items-center space-x-2 text-sm"
>
<Avatar
+14 -3
View File
@@ -20,7 +20,8 @@ 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"
import { CSB_SCAN } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
dayjs.extend(duration)
dayjs.extend(relativeTime)
@@ -151,7 +152,12 @@ export const Comment: React.FC<{
className="flex border-b border-dashed py-6"
>
<UniLink
href={CSB_IO && `${CSB_IO}/@${comment?.character?.handle}`}
href={
comment?.character?.handle &&
getSiteLink({
subdomain: comment.character.handle,
})
}
className="align-middle mr-3"
>
<Avatar
@@ -163,7 +169,12 @@ export const Comment: React.FC<{
<div className="flex-1 flex flex-col rounded-lg">
<div className="mb-2 text-sm">
<UniLink
href={CSB_IO && `${CSB_IO}/@${comment?.character?.handle}`}
href={
comment?.character?.handle &&
getSiteLink({
subdomain: comment.character.handle,
})
}
className="font-medium text-theme-color"
>
{comment?.character?.metadata?.content?.name}
+1 -1
View File
@@ -15,7 +15,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit"
import { useState, useEffect } from "react"
import { Button } from "../ui/Button"
import { useRouter } from "next/router"
import { SITE_URL, CSB_SCAN, CSB_IO } from "~/lib/env"
import { SITE_URL, CSB_SCAN } from "~/lib/env"
import { DuplicateIcon } from "@heroicons/react/solid"
import { Comment } from "~/components/common/Comment"
import { UniLink } from "~/components/ui/UniLink"