feat: use mingcute icon

This commit is contained in:
DIYgod
2023-03-15 23:34:50 +00:00
parent d4aa0a028b
commit c170ae113c
47 changed files with 163 additions and 436 deletions
+3 -5
View File
@@ -1,8 +1,6 @@
import { CSB_IO, CSB_SCAN } from "~/lib/env"
import { UniLink } from "../ui/UniLink"
import { Profile, Note } from "~/lib/types"
import { Disclosure } from "@headlessui/react"
import { ChevronUpIcon } from "@heroicons/react/20/solid"
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
import { toIPFS, toGateway } from "~/lib/ipfs-parser"
import { IPFS_GATEWAY } from "~/lib/env"
@@ -24,9 +22,9 @@ export const BlockchainInfo: React.FC<{
className="flex w-full justify-between items-center rounded-lg px-4 py-2 text-left text-gray-900 hover:bg-hover transition-colors md:rounded-xl"
aria-label="toggle chain info"
>
<span>
<BlockchainIcon className="w-4 h-4 inline-block align-middle mr-2" />
<span className="align-middle">
<span className="flex items-center">
<BlockchainIcon className="mr-1" />
<span>
{t("signed and stored on the blockchain", {
ns: "site",
name: t(
+1
View File
@@ -71,6 +71,7 @@ export const CharacterList: React.FC<{
"/tx/" +
(sub.metadata?.proof || sub.transactionHash)
}
className="flex items-center"
>
<BlockchainIcon />
</UniLink>
+2 -3
View File
@@ -10,7 +10,6 @@ import { useCommentPage } from "~/queries/page"
import { useRouter } from "next/router"
import { EmojiPicker } from "./EmojiPicker"
import { Popover } from "@headlessui/react"
import { FaceSmileIcon } from "@heroicons/react/24/outline"
import { useTranslation } from "next-i18next"
export const CommentInput: React.FC<{
@@ -87,8 +86,8 @@ export const CommentInput: React.FC<{
<Popover className="relative flex justify-center">
{({ open }: { open: boolean }) => (
<>
<Popover.Button className="group inline-flex items-center rounded-md px-2 text-xl">
<FaceSmileIcon className="w-6 h-6 text-zinc-400 hover:text-zinc-500" />
<Popover.Button className="group inline-flex items-center rounded-md px-2 text-xl text-zinc-400 hover:text-zinc-500">
<span className="i-mingcute:emoji-2-line text-2xl"></span>
</Popover.Button>
<Popover.Panel className="absolute left-0 top-full z-10">
<EmojiPicker
+10 -7
View File
@@ -53,7 +53,7 @@ export const CommentItem: React.FC<{
</CharacterFloatCard>
</div>
<div className="flex-1 flex flex-col rounded-lg">
<div className="mb-1 text-sm">
<div className="mb-1 text-sm flex items-center space-x-1">
<UniLink
href={
comment?.character?.handle &&
@@ -64,8 +64,8 @@ export const CommentItem: React.FC<{
className="font-medium text-accent"
>
{comment?.character?.metadata?.content?.name}
</UniLink>{" "}
·{" "}
</UniLink>
<span>·</span>
<time dateTime={date.formatToISO(comment?.createdAt)}>
{t("ago", {
time: date.dayjs
@@ -75,10 +75,13 @@ export const CommentItem: React.FC<{
)
.humanize(),
})}
</time>{" "}
·{" "}
<UniLink href={`${CSB_SCAN}/tx/${comment.transactionHash}`}>
<BlockchainIcon className="w-3 h-3 inline-block" />
</time>
<span>·</span>
<UniLink
href={`${CSB_SCAN}/tx/${comment.transactionHash}`}
className="inline-flex items-center h-full"
>
<BlockchainIcon className="inline-block" />
</UniLink>
</div>
<PageContent
+10 -17
View File
@@ -13,20 +13,12 @@ import {
import { useAccountSites } from "~/queries/site"
import { Avatar } from "~/components/ui/Avatar"
import { Button, type VariantColor, type Variant } from "~/components/ui/Button"
import { DashboardIcon } from "../icons/DashboardIcon"
import { UniLink } from "../ui/UniLink"
import { useEffect, useState } from "react"
import {
Square2StackIcon,
ArrowRightOnRectangleIcon,
BellIcon,
CurrencyDollarIcon,
UsersIcon,
FaceFrownIcon,
FaceSmileIcon,
ArrowUpCircleIcon,
ArrowPathRoundedSquareIcon,
ChevronDownIcon,
} from "@heroicons/react/24/outline"
import { BellAlertIcon } from "@heroicons/react/24/solid"
import { SITE_URL } from "~/lib/env"
@@ -37,6 +29,7 @@ import {
} from "@crossbell/notification"
import { Menu } from "~/components/ui/Menu"
import { useTranslation } from "next-i18next"
import { cn } from "~/lib/utils"
type HeaderLinkType = {
icon?: React.ReactNode
@@ -114,19 +107,19 @@ export const ConnectButton: React.FC<{
const dropdownLinks: HeaderLinkType[] = [
{
icon: <DashboardIcon />,
icon: "i-mingcute:grid-line",
label: t("Dashboard") || "",
url: `${SITE_URL}/dashboard`,
},
{
icon: <Square2StackIcon className="w-4 h-4" />,
icon: "i-mingcute:copy-2-line",
label: t(copyLabelDisplay) || "",
onClick: copyLabel,
},
...(account?.type === "wallet"
? [
{
icon: <UsersIcon className="w-4 h-4" />,
icon: "i-mingcute:seal-line",
label: (
<>
{t("Operator Sign")} (
@@ -147,7 +140,7 @@ export const ConnectButton: React.FC<{
},
},
{
icon: <CurrencyDollarIcon className="w-4 h-4" />,
icon: "i-mingcute:currency-euro-line",
label: (
<span className={InsufficientBalance ? "text-red-400" : ""}>
{balance?.formatted.replace(/\.(\d{5})\d*$/, ".$1") ||
@@ -158,20 +151,20 @@ export const ConnectButton: React.FC<{
onClick: csbDetailModal.show,
},
{
icon: <ArrowPathRoundedSquareIcon className="w-4 h-4" />,
icon: "i-mingcute:repeat-line",
label: t("Switch Characters") || "",
onClick: selectCharactersModal.show,
},
]
: [
{
icon: <ArrowUpCircleIcon className="w-4 h-4" />,
icon: "i-mingcute:vip-2-line",
label: t("Upgrade to Wallet") || "",
onClick: upgradeAccountModal.show,
},
]),
{
icon: <ArrowRightOnRectangleIcon className="w-4 h-4" />,
icon: "i-mingcute:exit-line",
label: t("Disconnect") || "",
onClick: disconnect,
},
@@ -278,7 +271,7 @@ export const ConnectButton: React.FC<{
</span>
)}
</div>
<ChevronDownIcon className="w-4 h-4 ml-[2px] stroke-2" />
<i className="i-mingcute:down-line text-xl ml-[2px]" />
</>
)}
</button>
@@ -303,7 +296,7 @@ export const ConnectButton: React.FC<{
aria-label={link.label}
>
<span className="mr-2 flex justify-center">
{link.icon}
<i className={cn(link.icon, "text-base")} />
</span>
{link.label}
</UniLink>
+13 -5
View File
@@ -67,7 +67,7 @@ export const FollowingButton: React.FC<{
onClick={handleClickSubscribe}
className={cn(
className,
"align-middle space-x-1 group border-accent border text-sm sm:text-base",
"align-middle group border-accent border text-sm sm:text-base",
{
"text-accent": subscription.data,
"opacity-60": subscription.data,
@@ -85,14 +85,22 @@ export const FollowingButton: React.FC<{
aria-label="follow"
isAutoWidth
>
<span className="i-bxs:bell"></span>
{subscription.data ? (
<>
<span className="group-hover:hidden">{t("Following")}</span>
<span className="hidden group-hover:block">{t("Unfollow")}</span>
<span className="group-hover:hidden inline-flex items-center">
<span className="i-mingcute:user-follow-fill inline-block mr-2"></span>{" "}
{t("Following")}
</span>
<span className="hidden group-hover:inline-flex items-center">
<span className="i-mingcute:user-remove-fill inline-block mr-2"></span>{" "}
{t("Unfollow")}
</span>
</>
) : (
<span className="">{t("Follow")}</span>
<span className="inline-flex items-center">
<span className="i-mingcute:user-add-fill inline-block mr-2"></span>{" "}
{t("Follow")}
</span>
)}
</Button>
)
+2 -4
View File
@@ -1,9 +1,7 @@
import { Button } from "~/components/ui/Button"
import { Profile } from "~/lib/types"
import { useTranslation } from "next-i18next"
import { HeartIcon } from "@heroicons/react/24/solid"
import { cn } from "~/lib/utils"
import { Modal } from "~/components/ui/Modal"
import { useState } from "react"
import { PatronModal } from "~/components/common/PatronModal"
@@ -23,10 +21,10 @@ export const PatronButton: React.FC<{
variant="text"
aria-label={"Patron"}
key={t("Patron")}
className={cn(className, "-mx-2")}
className={cn(className, "-mx-2 text-red-400")}
onClick={() => setOpen(true)}
>
<HeartIcon className="text-red-400 flex w-5 h-5 -mb-[1px]" />
<i className="i-mingcute:heart-fill text-red-400 text-xl -mb-[1px]" />
<span className="text-zinc-500 ml-1">{t("Patron")}</span>
</Button>
</>
+6 -4
View File
@@ -1,11 +1,9 @@
import { Button } from "~/components/ui/Button"
import { Note, Profile } from "~/lib/types"
import { useTranslation } from "next-i18next"
import { HeartIcon } from "@heroicons/react/24/solid"
import { Modal } from "~/components/ui/Modal"
import { useEffect, useRef, useState } from "react"
import { BoxRadio } from "~/components/ui/BoxRadio"
import { QuestionMarkCircleIcon } from "@heroicons/react/24/outline"
import { Tabs } from "../ui/Tabs"
import { useTipCharacter, useGetTips } from "~/queries/site"
import { useAccountState } from "@crossbell/connect-kit"
@@ -118,7 +116,11 @@ export const PatronModal: React.FC<{
open={open}
setOpen={setOpen}
title={title}
titleIcon={<HeartIcon className="text-red-500 flex w-6 h-6 -mb-[1px]" />}
titleIcon={
<span className="text-red-500 flex w-6 h-6 -mb-[1px]">
<i className="i-mingcute:heart-fill text-2xl -mb-[1px]" />
</span>
}
size="lg"
>
<div className="px-5 py-4 space-y-4">
@@ -218,7 +220,7 @@ export const PatronModal: React.FC<{
<div className="text-zinc-500 text-xs space-y-1 mt-2">
<p>1 Mira ≈ 1 USDC</p>
<p className="flex items-center">
<QuestionMarkCircleIcon className="w-4 h-4 inline-block mr-1" />
<i className="i-mingcute:question-line mr-1 text-sm" />
{t("What is Mira? Where can I get some?")}
</p>
</div>
+6 -5
View File
@@ -7,7 +7,7 @@ import {
useToggleLikePage,
useGetLikeCounts,
} from "~/queries/page"
import { useAccountSites, useGetTips } from "~/queries/site"
import { useGetTips } from "~/queries/site"
import { useState, useEffect, useRef } from "react"
import { Button } from "../ui/Button"
import { CSB_SCAN, CSB_XCHAR } from "~/lib/env"
@@ -15,14 +15,13 @@ import { UniLink } from "~/components/ui/UniLink"
import { Modal } from "~/components/ui/Modal"
import { Avatar } from "../ui/Avatar"
import { MintIcon } from "~/components/icons/MintIcon"
import { getMints, parsePageId } from "~/models/page.model"
import { parsePageId } from "~/models/page.model"
import { CharacterList } from "~/components/common/CharacterList"
import { cn } from "~/lib/utils"
import { Tooltip } from "~/components/ui/Tooltip"
import confetti from "canvas-confetti"
import { Trans, useTranslation } from "next-i18next"
import { Note, Profile } from "~/lib/types"
import { HeartIcon } from "@heroicons/react/24/solid"
import { useAccountState } from "@crossbell/connect-kit"
import { PatronModal } from "~/components/common/PatronModal"
@@ -172,7 +171,7 @@ export const Reactions: React.FC<{
<span
className={cn(
"i-mingcute:thumb-up-2-fill mr-1",
size === "sm" ? "text-base" : "text-[40px]",
size === "sm" ? "text-base" : "text-[38px]",
)}
></span>
)
@@ -285,7 +284,9 @@ export const Reactions: React.FC<{
ref={tipRef}
>
{(() => {
const inner = <HeartIcon className={cn("w-10 h-10")} />
const inner = (
<i className="i-mingcute:heart-fill text-[40px]" />
)
return (
<Tooltip label={t("Tip")} placement="top">
{inner}