feat: use mingcute icon

This commit is contained in:
DIYgod 2023-03-15 23:34:50 +00:00
parent d4aa0a028b
commit c170ae113c
No known key found for this signature in database
47 changed files with 163 additions and 436 deletions

View File

@ -33,14 +33,7 @@
"@floating-ui/react": "^0.20.1",
"@headlessui/react": "1.7.12",
"@heroicons/react": "2.0.16",
"@iconify-json/akar-icons": "1.1.13",
"@iconify-json/bi": "^1.1.15",
"@iconify-json/bxs": "^1.1.6",
"@iconify-json/carbon": "^1.1.16",
"@iconify-json/fluent": "^1.1.18",
"@iconify-json/mdi": "^1.1.50",
"@iconify-json/mingcute": "^1.1.5",
"@iconify-json/tabler": "1.1.63",
"@monaco-editor/react": "4.4.6",
"@tanstack/react-query": "4.24.10",
"@tanstack/react-query-devtools": "4.24.12",

View File

@ -17,14 +17,7 @@ specifiers:
'@floating-ui/react': ^0.20.1
'@headlessui/react': 1.7.12
'@heroicons/react': 2.0.16
'@iconify-json/akar-icons': 1.1.13
'@iconify-json/bi': ^1.1.15
'@iconify-json/bxs': ^1.1.6
'@iconify-json/carbon': ^1.1.16
'@iconify-json/fluent': ^1.1.18
'@iconify-json/mdi': ^1.1.50
'@iconify-json/mingcute': ^1.1.5
'@iconify-json/tabler': 1.1.63
'@monaco-editor/react': 4.4.6
'@next/bundle-analyzer': 13.2.3
'@playwright/test': 1.31.1
@ -151,14 +144,7 @@ dependencies:
'@floating-ui/react': 0.20.1_zula6vjvt3wdocc4mwcxqa6nzi
'@headlessui/react': 1.7.12_biqbaboplfbrettd7655fr4n2y
'@heroicons/react': 2.0.16_react@18.2.0
'@iconify-json/akar-icons': 1.1.13
'@iconify-json/bi': 1.1.15
'@iconify-json/bxs': 1.1.6
'@iconify-json/carbon': 1.1.16
'@iconify-json/fluent': 1.1.18
'@iconify-json/mdi': 1.1.50
'@iconify-json/mingcute': 1.1.5
'@iconify-json/tabler': 1.1.63
'@monaco-editor/react': 4.4.6_biqbaboplfbrettd7655fr4n2y
'@tanstack/react-query': 4.24.10_biqbaboplfbrettd7655fr4n2y
'@tanstack/react-query-devtools': 4.24.12_636dldj5wfr5vkyyqzs5k363kq
@ -2780,54 +2766,12 @@ packages:
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true
/@iconify-json/akar-icons/1.1.13:
resolution: {integrity: sha512-PyQwbPEp52/Wik0b6IzfmjaJ8C6fD5fa0BgX6dNEL8oiSpkhoMTnI2adWu+EFcDoenrPMz64LJSnGRfFpLK8Og==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/bi/1.1.15:
resolution: {integrity: sha512-NsbDeTVIYwgPLyAT0UgzuaCl79V65Z+M319BjbdEwdnbDGuaYgmAMBJUIWrnBEVoEg7rtouAuvaZRb3nIYIRcA==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/bxs/1.1.6:
resolution: {integrity: sha512-HTn+klVO4TtO/+2kTcFWFzD71aZr6H8rTybkMjuebYwdTEBlMCnjCu/3xdZr+x3Dtpd81WVwZfkZQk14VgNbRA==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/carbon/1.1.16:
resolution: {integrity: sha512-AD8bcnRSGA0WfcGEass2FbA0sagrUzrpFx5WchuDy3uf7yKBWumdypdQK121DH321fQDl5+zZQ26T6gC9knwUQ==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/fluent/1.1.18:
resolution: {integrity: sha512-tdfnNxTJW39t5FhGzf+LPMJyaW9lTIhVYpHReGbbK7Ivt/GksbbOFpXntUgAgrMqglxSmSOz7u0xBARS1a3waQ==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/mdi/1.1.50:
resolution: {integrity: sha512-SgbT5w5eHCdOG74ZWPz7HlTGk6VsifIJhNi6lAsxj/5Nlqt6Cz4LlQmSa9eecU9p075Jub2aAx/o7YI+GCahRQ==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/mingcute/1.1.5:
resolution: {integrity: sha512-k2CaSPbi3YXvV2O0U+PLPJzjLF+5WqcqTGc1apEle06tj5GPqAwRjCpaZsHjWo8jYhnmi6YyjXJmS/VX+5Kx9g==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify-json/tabler/1.1.63:
resolution: {integrity: sha512-WvIsUJsil2+U1lPbguzbjG4v5sYqMkHp5P0PDXjwz/3XqS4mlFSicxmtSQcthRdQBbX2hMfXamtvqUYrNc2sCQ==}
dependencies:
'@iconify/types': 2.0.0
dev: false
/@iconify/types/2.0.0:
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}

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(

View File

@ -71,6 +71,7 @@ export const CharacterList: React.FC<{
"/tx/" +
(sub.metadata?.proof || sub.transactionHash)
}
className="flex items-center"
>
<BlockchainIcon />
</UniLink>

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

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

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>

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>
)

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>
</>

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>

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}

View File

@ -20,7 +20,6 @@ import { useUserRole } from "~/hooks/useUserRole"
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
import { useTranslation } from "react-i18next"
import { Logo } from "~/components/common/Logo"
import { QuestionMarkCircleIcon } from "@heroicons/react/24/outline"
import { getStorage } from "~/lib/storage"
import { useGetPagesBySite } from "~/queries/page"
@ -96,45 +95,49 @@ export function DashboardLayout({
{
href: `/dashboard/${subdomain}`,
isActive: ({ href, pathname }) => href === pathname,
icon: "i-bi-grid",
icon: "i-mingcute-grid-line",
text: "Dashboard",
},
{
href: `/dashboard/${subdomain}/posts`,
isActive: ({ href, pathname }) => href === pathname,
icon: "i-bi-layout-text-sidebar",
icon: "i-mingcute-news-line",
text: "Posts",
},
{
href: `/dashboard/${subdomain}/pages`,
isActive: ({ href, pathname }) => href === pathname,
icon: "i-bi-window-stack",
icon: "i-mingcute-file-line",
text: "Pages",
},
{
onClick: showNotificationModal,
isActive: ({ href, pathname }) => href === pathname,
icon: isAllRead ? "i-bi:bell" : "i-bi:bell-fill",
text: isAllRead ? "Notifications" : "Unread notifications",
},
{
href: `/dashboard/${subdomain}/events`,
isActive: ({ href, pathname }) => href === pathname,
icon: isEventsAllRead ? "i-bi-gift" : "i-bi-gift-fill",
text: isEventsAllRead ? "Events" : "New Events",
},
{
href: `/dashboard/${subdomain}/import`,
isActive: ({ pathname }) =>
pathname.startsWith(`/dashboard/${subdomain}/import`),
icon: "i-bi-hdd",
icon: "i-mingcute:file-import-line",
text: "Import",
},
{
onClick: showNotificationModal,
isActive: ({ href, pathname }) => href === pathname,
icon: isAllRead
? "i-mingcute:notification-line"
: "i-mingcute:notification-fill",
text: isAllRead ? "Notifications" : "Unread notifications",
},
{
href: `/dashboard/${subdomain}/events`,
isActive: ({ href, pathname }) => href === pathname,
icon: isEventsAllRead
? "i-mingcute-flag-4-line"
: "i-mingcute-flag-4-fill",
text: isEventsAllRead ? "Events" : "New Events",
},
{
href: `/dashboard/${subdomain}/settings/general`,
isActive: ({ pathname }) =>
pathname.startsWith(`/dashboard/${subdomain}/settings`),
icon: "i-bi-gear",
icon: "i-mingcute-settings-3-line",
text: "Settings",
},
]
@ -220,7 +223,7 @@ export function DashboardLayout({
)}
onClick={link.onClick}
>
<span className={cn(link.icon, "text-lg")}></span>
<span className={cn(link.icon, "text-xl")}></span>
{isOpen && <span>{t(link.text)}</span>}
</UniLink>
)
@ -232,7 +235,7 @@ export function DashboardLayout({
href={DISCORD_LINK}
className="space-x-1 text-zinc-500 hover:text-zinc-800 flex w-full h-12 items-center justify-center transition-colors mb-2"
>
<QuestionMarkCircleIcon className="w-5 h-5" />
<i className="i-mingcute:question-line text-lg" />
{isOpen && <span>{t("Need help?")}</span>}
</UniLink>
<UniLink
@ -241,7 +244,7 @@ export function DashboardLayout({
})}
className="space-x-2 border rounded-lg bg-slate-100 border-slate-200 text-accent hover:scale-105 transition-transform flex w-full h-12 items-center justify-center"
>
<span className="i-bi:box-arrow-up-right"></span>
<span className="i-mingcute:home-1-line"></span>
{isOpen && <span>{t("View Site")}</span>}
</UniLink>
</div>

View File

@ -1,4 +1,3 @@
import { ChevronRightIcon, ChevronLeftIcon } from "@heroicons/react/20/solid"
import { useState, useEffect, useMemo } from "react"
import { setStorage, getStorage } from "~/lib/storage"
@ -29,13 +28,13 @@ export const DashboardSidebar: React.FC<{
{children(isOpen)}
<div className="w-[1px] bg-border absolute top-0 right-0 bottom-0"></div>
<div
className="absolute top-5 -right-3 bg-accent rounded-full cursor-pointer"
className="absolute top-5 -right-3 bg-accent rounded-full cursor-pointer text-white w-6 h-6"
onClick={() => setIsOpen(!isOpen)}
>
{isOpen ? (
<ChevronLeftIcon className="w-6 h-6 text-white" />
<i className="i-mingcute:left-line text-2xl inline-block w-6 h-6" />
) : (
<ChevronRightIcon className="w-6 h-6 text-white" />
<i className="i-mingcute:right-line text-2xl inline-block w-6 h-6" />
)}
</div>
</div>

View File

@ -16,13 +16,11 @@ import {
useDeletePage,
useCreateOrUpdatePage,
} from "~/queries/page"
import { EllipsisHorizontalIcon } from "@heroicons/react/20/solid"
import { delStorage, getStorage, setStorage } from "~/lib/storage"
import { useQueryClient } from "@tanstack/react-query"
import { Button } from "../ui/Button"
import { UniLink } from "../ui/UniLink"
import { nanoid } from "nanoid"
import { renderPageContent } from "~/markdown"
import { Tooltip } from "../ui/Tooltip"
import { APP_NAME } from "~/lib/env"
import { Trans, useTranslation } from "next-i18next"
@ -132,20 +130,7 @@ export const PagesManager: React.FC<{
return [
{
text: "Edit",
icon: (
<svg
className="w-4 h-4"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M12 20h9"></path>
<path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
</svg>
),
icon: <span className="i-mingcute:edit-line inline-block"></span>,
onClick() {
router.push(getPageEditLink(page))
},
@ -158,7 +143,7 @@ export const PagesManager: React.FC<{
: isPost
? "Page"
: "Post"),
icon: <span className="i-tabler:transform inline-block"></span>,
icon: <span className="i-mingcute:transfer-3-line inline-block"></span>,
onClick() {
const toastId = toast.loading("Converting...")
if (isCrossbell) {
@ -201,22 +186,7 @@ export const PagesManager: React.FC<{
},
{
text: "Delete",
icon: (
<svg
className="w-4 h-4"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
),
icon: <span className="i-mingcute:delete-2-line inline-block"></span>,
onClick() {
if (!page.metadata) {
const toastId = toast.loading("Deleting...")
@ -332,18 +302,7 @@ export const PagesManager: React.FC<{
)
}
>
<svg
className="w-4 h-4"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M12 20h9"></path>
<path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
</svg>
<span className="i-mingcute:add-line inline-block"></span>
<span>{t(`New ${isPost ? "Post" : "Page"}`)}</span>
</Button>
<span className="hidden sm:inline-flex">
@ -352,7 +311,7 @@ export const PagesManager: React.FC<{
placement="bottom"
>
<Button className={cn(`space-x-2`)} onClick={importFile}>
<span className="i-bxs:duplicate inline-block"></span>
<span className="i-mingcute:file-import-line inline-block"></span>
<span>{t("Import")}</span>
</Button>
</Tooltip>
@ -415,7 +374,7 @@ export const PagesManager: React.FC<{
e.stopPropagation()
}}
>
<EllipsisHorizontalIcon className="w-5 h-5" />
<i className="i-mingcute:more-1-line text-2xl" />
</button>
</Menu.Button>
<Menu.Items className="text-sm absolute z-20 right-0 bg-white shadow-modal rounded-lg overflow-hidden py-2 w-64">

View File

@ -1,18 +1,15 @@
import React from "react"
import { cn } from "~/lib/utils"
export const BlockchainIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
export const BlockchainIcon = ({ className }: { className?: string }) => {
return (
<svg
width="1em"
height="1em"
{...props}
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
<span
className={cn(
className,
"xlog-site-blockchain-icon text-green-600 inline-flex items-center",
)}
>
<path d="M912.290909 0c-61.607564 0-111.709091 50.101527-111.709091 111.709091 0 19.269818 4.896582 37.403927 13.5168 53.248l-182.998109 182.998109a147.884218 147.884218 0 0 0-182.365091-0.018618l-142.782836-142.782837A73.485964 73.485964 0 0 0 316.509091 167.563636c0-41.071709-33.401018-74.472727-74.472727-74.472727S167.563636 126.491927 167.563636 167.563636s33.401018 74.472727 74.472728 74.472728c13.777455 0 26.512291-4.002909 37.590109-10.556509l142.782836 142.782836a148.0704 148.0704 0 0 0 0 182.365091L186.628655 792.427055A111.169164 111.169164 0 0 0 111.709091 763.345455c-61.607564 0-111.709091 50.101527-111.709091 111.70909s50.101527 111.709091 111.709091 111.709091 111.709091-50.101527 111.709091-111.709091a111.076073 111.076073 0 0 0-13.5168-53.248l238.852654-238.852654a148.0704 148.0704 0 0 0 72.573673 30.142836v189.160728c-52.745309 8.899491-93.090909 54.774691-93.090909 110.033454 0 61.607564 50.101527 111.709091 111.709091 111.709091s111.709091-50.101527 111.709091-111.709091c0-55.240145-40.3456-101.115345-93.090909-110.033454V613.096727a148.0704 148.0704 0 0 0 72.573672-30.142836l142.782837 142.782836A73.448727 73.448727 0 0 0 763.345455 763.345455c0 41.071709 33.401018 74.472727 74.472727 74.472727s74.472727-33.401018 74.472727-74.472727-33.401018-74.472727-74.472727-74.472728c-13.777455 0-26.512291 4.002909-37.590109 10.556509l-142.782837-142.782836a148.0704 148.0704 0 0 0 0-182.365091l179.944728-179.944727A111.094691 111.094691 0 0 0 912.290909 223.418182c61.607564 0 111.709091-50.101527 111.709091-111.709091s-50.101527-111.709091-111.709091-111.709091zM204.8 167.563636c0-20.535855 16.700509-37.236364 37.236364-37.236363s37.236364 16.700509 37.236363 37.236363-16.700509 37.236364-37.236363 37.236364-37.236364-16.700509-37.236364-37.236364zM111.709091 949.527273c-41.071709 0-74.472727-33.401018-74.472727-74.472728s33.401018-74.472727 74.472727-74.472727 74.472727 33.401018 74.472727 74.472727-33.401018 74.472727-74.472727 74.472728z m502.690909-37.236364c0 41.071709-33.401018 74.472727-74.472727 74.472727s-74.472727-33.401018-74.472728-74.472727 33.401018-74.472727 74.472728-74.472727 74.472727 33.401018 74.472727 74.472727z m-74.472727-335.127273c-61.607564 0-111.709091-50.101527-111.709091-111.709091s50.101527-111.709091 111.709091-111.70909 111.709091 50.101527 111.709091 111.70909-50.101527 111.709091-111.709091 111.709091z m335.127272 186.181819c0 20.535855-16.700509 37.236364-37.236363 37.236363s-37.236364-16.700509-37.236364-37.236363 16.700509-37.236364 37.236364-37.236364 37.236364 16.700509 37.236363 37.236364z m37.236364-577.163637c-41.071709 0-74.472727-33.401018-74.472727-74.472727s33.401018-74.472727 74.472727-74.472727 74.472727 33.401018 74.472727 74.472727-33.401018 74.472727-74.472727 74.472727z"></path>
</svg>
<i className="i-mingcute:safety-certificate-line text-lg max-w-full max-h-full inline-block" />
</span>
)
}

View File

@ -1,49 +0,0 @@
import React from "react"
export const CrossbellIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
return (
<svg
{...props}
width="20"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_1030_5486)">
<path
d="M12.8444 18.4185C12.8444 19.292 11.5709 20 10 20C8.42915 20 7.15491 19.292 7.15491 18.4185H12.8444Z"
fill="#E7B75B"
></path>
<path
d="M7.74317 7.8273L3.12109 8.70508C3.12109 3.8976 5.94982 0 9.43955 0L9.41103 6.32202L7.74317 7.8273Z"
fill="#E7B75B"
></path>
<path
d="M9.17857 11.0255L8.92971 13.6439L8.59172 17.2028C8.56391 17.2071 8.53538 17.2099 8.50686 17.2128C7.37238 17.3312 5.78082 16.9703 4.19212 16.151C2.27184 15.1592 0.891347 13.7751 0.560486 12.6413C1.04525 12.6043 1.51472 12.4549 1.93171 12.2049C2.50786 11.8719 2.93427 11.4206 3.13322 10.987C3.16147 10.9258 3.1853 10.8627 3.20452 10.7981C3.25558 10.6455 3.26975 10.483 3.24588 10.3239L7.73818 9.58301L9.17857 11.0255Z"
fill="#E7B75B"
></path>
<path
d="M12.2547 7.8273L16.8768 8.70508C16.8789 3.8976 14.0495 0 10.5605 0L10.589 6.32202L12.2547 7.8273Z"
fill="#E7B75B"
></path>
<path
d="M10.8215 11.0255L11.0703 13.6439L11.4083 17.2028C11.4361 17.2071 11.4647 17.2099 11.4932 17.2128C12.6277 17.3312 14.2192 16.9703 15.8079 16.151C17.7296 15.1592 19.1087 13.7751 19.4396 12.6413C18.9548 12.6043 18.4853 12.4549 18.0683 12.2049C17.4922 11.8719 17.0658 11.4206 16.8668 10.987C16.8386 10.9258 16.8147 10.8627 16.7955 10.7981C16.7445 10.6455 16.7303 10.483 16.7542 10.3239L12.2619 9.58301L10.8215 11.0255Z"
fill="#E7B75B"
></path>
</g>
<defs>
<clipPath id="clip0_1030_5486">
<rect
width="18.8791"
height="20"
fill="white"
transform="translate(0.560486)"
></rect>
</clipPath>
</defs>
</svg>
)
}

View File

@ -1,18 +0,0 @@
import React from "react"
export const DashboardIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
return (
<svg width="1em" height="1em" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M3 3h7v9H3zm11 0h7v5h-7zm0 9h7v9h-7zM3 16h7v5H3z"
></path>
</svg>
)
}

View File

@ -1,21 +0,0 @@
import React from "react"
export const LaughIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
return (
<svg
width="1em"
height="1em"
{...props}
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M512 16C238 16 16 238 16 512s222 496 496 496 496-222 496-496S786 16 512 16z m282.8 778.8c-75.6 75.6-176 117.2-282.8 117.2s-207.2-41.6-282.8-117.2S112 618.8 112 512s41.6-207.2 117.2-282.8S405.2 112 512 112s207.2 41.6 282.8 117.2S912 405.2 912 512s-41.6 207.2-117.2 282.8zM672 448c35.4 0 64-28.6 64-64s-28.6-64-64-64-64 28.6-64 64 28.6 64 64 64z m-320 0c35.4 0 64-28.6 64-64s-28.6-64-64-64-64 28.6-64 64 28.6 64 64 64z m388.8 128H283.2c-16.4 0-29 14-27 30 15 118.4 117.8 210 242.2 210h27.2c124.4 0 227.2-91.6 242.2-210 2-16-10.6-30-27-30z"
p-id="2265"
></path>
</svg>
)
}

View File

@ -1,22 +0,0 @@
import React from "react"
export const LoveIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
return (
<svg
width="1em"
height="1em"
{...props}
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M921.6 288.341333a42.666667 42.666667 0 0 1-81.066667 26.666667 163.669333 163.669333 0 0 0-40.405333-64.682667c-66.346667-66.346667-174.592-66.261333-241.408 0.085334l-16.213333 16.597333a43.818667 43.818667 0 0 1-61.013334 0l-16.64-17.066667a171.221333 171.221333 0 0 0-240.981333 0.384 171.221333 171.221333 0 0 0 0 241.749334L512 780.202667l18.944-18.901334a42.624 42.624 0 1 1 60.330667 60.330667l-49.109334 49.066667a42.496 42.496 0 0 1-60.330666 0l-318.293334-318.293334a256.597333 256.597333 0 0 1 0-362.410666c95.146667-95.189333 247.850667-99.413333 348.501334-12.544 101.034667-86.784 253.354667-82.517333 348.416 12.544A248.149333 248.149333 0 0 1 921.6 288.341333zM768 384a42.666667 42.666667 0 1 1-85.333333 0 42.666667 42.666667 0 1 1 85.333333 0z m85.333333 0a42.666667 42.666667 0 1 1 0 85.333333 42.666667 42.666667 0 1 1 0-85.333333z m-213.333333 42.666667a42.666667 42.666667 0 1 1-85.333333 0 42.666667 42.666667 0 1 1 85.333333 0z m85.333333 42.666666c94.122667 0 170.666667 76.544 170.666667 170.666667 0 47.061333-38.272 85.333333-85.333333 85.333333h-170.666667c-47.061333 0-85.333333-38.272-85.333333-85.333333 0-94.122667 76.544-170.666667 170.666666-170.666667z m-85.333333 170.666667h170.538667c0.128-47.104-38.144-85.333333-85.205334-85.333333-47.061333 0-85.333333 38.272-85.333333 85.333333z"
fill="#000000"
p-id="14000"
></path>
</svg>
)
}

View File

@ -1,20 +0,0 @@
import React from "react"
export const PlanetIcon: React.FC<React.ComponentPropsWithoutRef<"svg">> = (
props,
) => {
return (
<svg
width="1em"
height="1em"
{...props}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16.4341517,5.34027649 C19.5526401,4.82550436 21.9775728,5.30066885 22.7613144,6.98140814 C23.5450164,8.66206251 22.3504571,10.824965 19.951836,12.8828831 C19.5123956,16.8857302 16.1198862,20 12,20 C10.359675,20 8.83465517,19.5063199 7.56541555,18.6594348 C4.44608523,19.1746732 2.02039254,18.6996452 1.23650448,17.0185919 C0.452540248,15.3373751 1.64816139,13.1735876 4.04839101,11.1150512 C4.48877158,7.11319839 7.88082257,4 12,4 C13.6401386,4 15.1649982,4.49356789 16.4341517,5.34027649 Z M18.3526801,7.13687265 C19.0478987,8.04366602 19.553342,9.10361155 19.8096504,10.2573495 C20.759634,9.23569807 21.1931253,8.35081879 20.9486988,7.82664467 C20.7041658,7.30224176 19.7469377,7.06554811 18.3526801,7.13687265 Z M5.64723739,16.8630198 C4.95168113,15.9557542 4.44609504,14.8951833 4.1899293,13.7407574 C3.23872065,14.7632088 2.80454268,15.6488575 3.04912005,16.1733553 C3.29377581,16.6980213 4.25184178,16.9346893 5.64723739,16.8630198 Z M17.998801,11.8788388 C17.9342721,8.62105818 15.2732265,6 12,6 C8.6862915,6 6,8.6862915 6,12 C6,13.8017545 6.79417414,15.4180196 8.05156374,16.5178367 C9.61918795,16.1740501 11.4219878,15.5791568 13.2667642,14.7189234 C15.1123744,13.8583012 16.727532,12.8591526 17.998801,11.8788388 Z M17.3040733,14.8073455 C16.3274273,15.4175193 15.2552552,15.9984306 14.1120008,16.5315389 C12.9695057,17.0642931 11.8360704,17.5119809 10.7415499,17.8678087 C11.1473536,17.9544194 11.5683538,18 12,18 C14.2994717,18 16.2968203,16.7064576 17.3040733,14.8073455 Z"
fillRule="evenodd"
/>
</svg>
)
}

View File

@ -69,17 +69,17 @@ export function MainLayout({
<span className="text-zinc-700 ml-2 inline-flex items-center space-x-5 align-middle">
{GITHUB_LINK && (
<UniLink className="flex items-center" href={GITHUB_LINK}>
<span className="inline-block i-mdi-github text-2xl hover:text-zinc-900"></span>
<span className="inline-block i-mingcute:github-fill text-2xl hover:text-accent"></span>
</UniLink>
)}
{DISCORD_LINK && (
<UniLink className="flex items-center" href={DISCORD_LINK}>
<span className="inline-block i-mdi-discord text-2xl hover:text-accent"></span>
<span className="inline-block i-mingcute:discord-fill text-2xl hover:text-accent"></span>
</UniLink>
)}
{TWITTER_LINK && (
<UniLink className="flex items-center" href={TWITTER_LINK}>
<span className="inline-block i-mdi-twitter text-2xl hover:text-accent"></span>
<span className="inline-block i-mingcute:twitter-fill text-2xl hover:text-accent"></span>
</UniLink>
)}
</span>

View File

@ -1,6 +1,5 @@
import { Image } from "~/components/ui/Image"
import { UniLink } from "~/components/ui/UniLink"
import { PlanetIcon } from "~/components/icons/PlanetIcon"
import { Tooltip } from "~/components/ui/Tooltip"
import { cn } from "~/lib/utils"
@ -100,8 +99,8 @@ export const Platform: React.FC<{
{syncMap[platform]?.icon ? (
<Image fill src={syncMap[platform]?.icon} alt={platform} />
) : (
<span className="rounded-md inline-flex fill-white justify-center items-center bg-zinc-300 w-6 h-6">
<PlanetIcon className="w-5 h-5" />
<span className="rounded-md inline-flex text-white justify-center items-center bg-zinc-300 w-6 h-6">
<i className="i-mingcute:planet-line text-xl" />
</span>
)}
</span>

View File

@ -6,11 +6,6 @@ import { useEffect, useState } from "react"
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
import { getSiteLink } from "~/lib/helpers"
import { Avatar } from "~/components/ui/Avatar"
import {
EyeIcon,
PencilSquareIcon,
LightBulbIcon,
} from "@heroicons/react/24/outline"
import { useUserRole } from "~/hooks/useUserRole"
import { useTranslation } from "next-i18next"
import { useDate } from "~/hooks/useDate"
@ -74,7 +69,7 @@ export const PostMeta: React.FC<{
</>
) : null}
<span className="xlog-post-views inline-flex items-center">
<EyeIcon className="w-4 h-4 inline-block mr-[2px]" />
<i className="i-mingcute:eye-line mr-[2px]" />
<span>{page.views}</span>
</span>
{author?.username && site?.username !== author?.username && (
@ -100,7 +95,7 @@ export const PostMeta: React.FC<{
</>
)}
<UniLink
className="xlog-post-blockchain inline-block"
className="xlog-post-blockchain inline-flex items-center"
href={
page.related_urls?.filter((url) =>
url.startsWith(CSB_SCAN + "/tx/"),
@ -116,14 +111,14 @@ export const PostMeta: React.FC<{
page.id
}&type=${page.tags?.includes("post") ? "post" : "page"}`}
>
<PencilSquareIcon className="w-4 h-4 mx-1 inline-block" /> Edit
<i className="i-mingcute:edit-line mx-1" /> Edit
</UniLink>
)}
</div>
{(summary.isLoading || summary.data) && (
<div className="xlog-post-summary border rounded-xl mt-4 p-4 space-y-2">
<div className="font-bold text-zinc-700 flex items-center">
<LightBulbIcon className="inline w-4 h-4 mr-2 stroke-[2]" />
<i className="i-mingcute:android-2-line mr-2 text-lg" />
{t("AI-generated summary")}
</div>
<div className="text-zinc-500 leading-loose text-sm">

View File

@ -8,7 +8,6 @@ import { UniLink } from "../ui/UniLink"
import { Profile } from "~/lib/types"
import { ConnectButton } from "../common/ConnectButton"
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
import { EllipsisHorizontalIcon } from "@heroicons/react/20/solid"
import { Image } from "~/components/ui/Image"
import { FollowingButton } from "~/components/common/FollowingButton"
import { FollowingCount } from "~/components/common/FollowingCount"
@ -90,7 +89,7 @@ export const SiteHeader: React.FC<{
},
{
text: "View on Crossbell Scan",
icon: <BlockchainIcon className="fill-[#c09526]" />,
icon: <BlockchainIcon className="fill-[#c09526] w-full h-full" />,
url: `${CSB_SCAN}/address/${site?.metadata?.owner}`,
},
{
@ -221,9 +220,9 @@ export const SiteHeader: React.FC<{
<Button
variant="text"
aria-label="more"
className="-mx-2"
className="-mx-2 text-zinc-600"
>
<EllipsisHorizontalIcon className="w-5 h-5 text-zinc-600" />
<i className="i-mingcute:more-1-line text-2xl" />
</Button>
}
dropdown={

View File

@ -5,7 +5,6 @@ import { EmptyState } from "../ui/EmptyState"
import { useRouter } from "next/router"
import { Image } from "~/components/ui/Image"
import { Button } from "~/components/ui/Button"
import { EyeIcon } from "@heroicons/react/24/outline"
import { useTranslation } from "next-i18next"
import { useEffect, useState } from "react"
@ -79,7 +78,7 @@ export const SiteHome: React.FC<{
</span>
)}
<span className="xlog-post-views inline-flex items-center">
<EyeIcon className="w-4 h-4 inline-block mr-[2px]" />
<i className="i-mingcute:eye-line mr-[2px]" />
<span>{post.views}</span>
</span>
</div>

View File

@ -1,7 +1,7 @@
export const EmptyState: React.FC<{ resource?: string }> = ({ resource }) => {
return (
<div className="text-center py-10 mb-10 text-2xl text-zinc-300 font-medium flex justify-center flex-col items-center">
<span className="i-mdi:ghost-outline text-5xl mb-2"></span>
<span className="i-mingcute:ghost-line text-5xl mb-2"></span>
<div className="">
{" "}
No <span className="capitalize">{resource || "posts"}</span> Yet.

View File

@ -4,7 +4,6 @@ import { useState } from "react"
import { useUploadFile } from "~/hooks/useUploadFile"
import { toGateway } from "~/lib/ipfs-parser"
import { Image } from "~/components/ui/Image"
import { XMarkIcon } from "@heroicons/react/20/solid"
const getBase64 = (img: File, callback: (url: string) => void) => {
const reader = new FileReader()
@ -19,7 +18,6 @@ export const ImageUploader = forwardRef(function ImageUploader(
uploadStart,
uploadEnd,
withMimeType,
hasClose,
...inputProps
}: {
className?: string
@ -136,14 +134,6 @@ export const ImageUploader = forwardRef(function ImageUploader(
type="file"
className="absolute top-0 bottom-0 left-0 right-0 opacity-0"
/>
{imageUrl && hasClose && (
<div
onClick={clear}
className="w-8 h-8 absolute top-4 right-4 shadow bg-white rounded-full cursor-pointer"
>
<XMarkIcon />
</div>
)}
{loading && (
<div className="absolute top-0 bottom-0 left-0 right-0 flex justify-center items-center bg-gray-500 opacity-50">
<div className="loading flex justify-center items-center relative text-white"></div>

View File

@ -158,12 +158,12 @@ a {
@apply text-gray-500 fill-gray-500;
}
.button.is-tip:hover {
color: #f87171;
fill: #f87171;
color: #ef4444;
fill: #ef4444;
}
.button.is-tip.active {
color: #f87171;
fill: #f87171;
color: #ef4444;
fill: #ef4444;
}
.button.is-crossbell {

View File

@ -4,7 +4,7 @@ import { ICommand, wrapExecute } from "."
export const Bold: ICommand = {
name: "bold",
label: "Bold",
icon: "i-bi:type-bold",
icon: "i-mingcute:bold-line",
execute: (view) => {
wrapExecute({ view, prepend: "**", append: "**" })
},

View File

@ -4,7 +4,7 @@ import { ICommand, wrapExecute } from "."
export const Code: ICommand = {
name: "code",
label: "Inline Code",
icon: "i-bi:code",
icon: "i-mingcute:code-line",
execute: (view) => {
wrapExecute({ view, prepend: "`", append: "`" })
},

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const CodeBlock: ICommand = {
name: "codeblock",
label: "Code Block",
icon: "i-bi:body-text",
icon: "i-mingcute:web-line",
execute: (view) => {
wrapExecute({ view, prepend: "```\n", append: "\n```" })
},

View File

@ -3,8 +3,8 @@ import { ICommand, prependExecute } from "."
export const Heading: ICommand = {
name: "heading",
label: "Heading",
icon: "i-bi:type-h3",
icon: "i-mingcute:heading-2-line",
execute: (view) => {
prependExecute({ view, prepend: "### " })
prependExecute({ view, prepend: "## " })
},
}

View File

@ -1,11 +1,32 @@
import { EditorSelection } from "@codemirror/state"
import { ICommand, prependExecute, wrapExecute } from "."
import { UploadFile } from "~/lib/upload-file"
import toast from "react-hot-toast"
export const Image: ICommand = {
name: "image",
label: "Image",
icon: "i-bi:image",
name: "upload-image",
label: "Upload Image",
icon: "i-mingcute:photo-album-line",
execute: (view) => {
wrapExecute({ view, prepend: "![", append: "]()" })
const input = document.createElement("input")
input.type = "file"
input.addEventListener("change", async (e: any) => {
const toastId = toast.loading("Uploading...")
const file = e.target?.files?.[0]
try {
const { key } = await UploadFile(file)
wrapExecute({ view, prepend: "", append: `![${file.name}](${key})` })
toast.success("Uploaded!", {
id: toastId,
})
} catch (error) {
if (error instanceof Error) {
toast.error(error.message, { id: toastId })
}
}
})
input.click()
},
}

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const Italic: ICommand = {
name: "italic",
label: "Italic",
icon: "i-bi:type-italic",
icon: "i-mingcute:italic-line",
execute: (view) => {
wrapExecute({ view, prepend: "_", append: "_" })
},

View File

@ -4,7 +4,7 @@ import { ICommand, prependExecute, wrapExecute } from "."
export const Link: ICommand = {
name: "link",
label: "Link",
icon: "i-bi:link",
icon: "i-mingcute:link-2-line",
execute: (view) => {
wrapExecute({ view, prepend: "[", append: "]()" })
},

View File

@ -4,7 +4,7 @@ import { ICommand, wrapExecute } from "."
export const ListOrdered: ICommand = {
name: "list-ordered",
label: "Ordered List",
icon: "i-bi:list-ol",
icon: "i-mingcute:list-ordered-line",
execute: (view) => {
wrapExecute({ view, prepend: "1. ", append: "\n" })
},

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const ListUnordered: ICommand = {
name: "list-unordered",
label: "Unordered List",
icon: "i-bi:list-ul",
icon: "i-mingcute:list-check-line",
execute: (view) => {
wrapExecute({ view, prepend: "- ", append: "\n" })
},

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const Quote: ICommand = {
name: "quote",
label: "Quote",
icon: "i-bi:quote",
icon: "i-mingcute:quote-left-fill",
execute: (view) => {
wrapExecute({ view, prepend: "> ", append: "\n" })
},

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const Strikethrough: ICommand = {
name: "strikethrough",
label: "Strikethrough",
icon: "i-bi:type-strikethrough",
icon: "i-mingcute:strikethrough-line",
execute: (view) => {
wrapExecute({ view, prepend: "~~", append: "~~" })
},

View File

@ -3,7 +3,7 @@ import { ICommand, wrapExecute } from "."
export const Underline: ICommand = {
name: "underline",
label: "Underline",
icon: "i-bi:type-underline",
icon: "i-mingcute:underline-line",
execute: (view) => {
wrapExecute({ view, prepend: "<u>", append: "</u>" })
},

View File

@ -1,32 +0,0 @@
import { EditorSelection } from "@codemirror/state"
import { ICommand, prependExecute, wrapExecute } from "."
import { UploadFile } from "~/lib/upload-file"
import toast from "react-hot-toast"
export const UploadImage: ICommand = {
name: "upload-image",
label: "Upload Image",
icon: "i-carbon:cloud-upload",
execute: (view) => {
const input = document.createElement("input")
input.type = "file"
input.addEventListener("change", async (e: any) => {
const toastId = toast.loading("Uploading...")
const file = e.target?.files?.[0]
try {
const { key } = await UploadFile(file)
wrapExecute({ view, prepend: "", append: `![${file.name}](${key})` })
toast.success("Uploaded!", {
id: toastId,
})
} catch (error) {
if (error instanceof Error) {
toast.error(error.message, { id: toastId })
}
}
})
input.click()
},
}

View File

@ -6,7 +6,6 @@ import { Code } from "./Code"
import { CodeBlock } from "./CodeBlock"
import { Heading } from "./Heading"
import { Image } from "./Image"
import { UploadImage } from "./UploadImage"
import { Italic } from "./Italic"
import { Link } from "./Link"
import { ListOrdered } from "./ListOrdered"
@ -128,5 +127,4 @@ export const toolbars: ICommand[] = [
ListOrdered,
Link,
Image,
UploadImage,
]

View File

@ -126,7 +126,7 @@ export const renderPageContent = (
type: "element",
tagName: "span",
properties: {
className: ["i-akar-icons:link-chain"],
className: ["i-mingcute:link-line"],
},
children: [],
},

View File

@ -23,7 +23,7 @@ export const rehypeWrapCode: Plugin<Array<void>, Root> = () => {
u("element", {
tagName: "span",
properties: {
className: "i-bxs-copy",
className: "i-mingcute:copy-2-line",
},
children: [],
}),

View File

@ -14,7 +14,6 @@ import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
import { useEffect, useState } from "react"
import { Avatar } from "~/components/ui/Avatar"
import { cn } from "~/lib/utils"
import { ChevronRightIcon } from "@heroicons/react/20/solid"
import { getSiteLink } from "~/lib/helpers"
import { getStorage, setStorage } from "~/lib/storage"
@ -78,8 +77,8 @@ export default function EventsPage() {
return (
<DashboardMain title="Events">
<div className="min-w-[270px] flex flex-col xl:flex-row space-y-8 xl:space-y-0">
<div className="grid gap-4 grid-cols-1 sm:grid-cols-4">
<div className="min-w-[270px] max-w-screen-xl flex flex-col xl:flex-row space-y-8 xl:space-y-0">
<div className="grid gap-4 grid-cols-1 sm:grid-cols-2">
{pages.data?.pages[0]?.list.map((item) => {
let status
if (item.metadata?.frontMatter?.EndTime < new Date()) {
@ -177,7 +176,7 @@ export default function EventsPage() {
}
>
{t("Learn more")}{" "}
<ChevronRightIcon className="w-5 h-5 inline ml-1" />
<i className="i-mingcute:right-line text-xl ml-1" />
</UniLink>
</div>
</div>

View File

@ -151,7 +151,6 @@ export default function SiteSettingsGeneralPage() {
setBannerUploading(false)
}}
withMimeType={true}
hasClose={true}
{...(field as any)}
/>
)}

View File

@ -1,10 +1,7 @@
import { GetServerSideProps } from "next"
import { useState } from "react"
import { DashboardIcon } from "~/components/icons/DashboardIcon"
import { MainLayout } from "~/components/main/MainLayout"
import { UniLink } from "~/components/ui/UniLink"
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
import { LaughIcon } from "~/components/icons/LaughIcon"
import { Button } from "~/components/ui/Button"
import { useAccountState, useConnectedAction } from "@crossbell/connect-kit"
import { useRefCallback } from "@crossbell/util-hooks"
@ -19,12 +16,7 @@ import { useGetSites } from "~/queries/site"
import showcase from "../../showcase.json"
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
import { useAccountSites, useSubscribeToSites } from "~/queries/site"
import {
BoltIcon,
FingerPrintIcon,
RssIcon,
EllipsisHorizontalIcon,
} from "@heroicons/react/24/outline"
import { RssIcon } from "@heroicons/react/24/outline"
import { Tooltip } from "~/components/ui/Tooltip"
import {
XCharLogo,
@ -265,7 +257,7 @@ export default function Home() {
{features.map((feature) => (
<span
key={feature.title}
className={`text-feature text-feature-${feature.title.toLocaleLowerCase()} block sm:inline-block sm:mr-1`}
className={`text-feature text-feature-${feature.title.toLocaleLowerCase()} block sm:inline-block sm:mr-1 mb-2`}
>
{t(feature.title)}
{t(".")}
@ -291,16 +283,16 @@ export default function Home() {
blogging community for everyone.
</Trans>
</h3>
<div className="my-6 sm:my-12">
<div className="my-6 sm:my-12 flex items-center justify-center sm:flex-row flex-col">
<Button
className="text-accent h-10 mt-4 block sm:inline-block"
className="text-accent h-10 mt-4 flex items-center"
onClick={tryNow}
size="2xl"
variantColor="black"
>
{isConnected ? (
<>
<span className="i-bi-grid text-lg mr-2 inline-block"></span>
<span className="i-mingcute-grid-line text-xl mr-2 inline-block"></span>
<span>{t("Dashboard")}</span>
</>
) : (
@ -308,7 +300,7 @@ export default function Home() {
)}
</Button>
<Button
className="text-accent h-10 sm:ml-4 mt-4 block sm:inline-block"
className="text-accent h-10 sm:ml-4 mt-4 flex"
size="2xl"
variant="outline"
variantColor="gradient"
@ -335,7 +327,7 @@ export default function Home() {
spy={true}
smooth={true}
duration={500}
className="cursor-pointer inline-block i-fluent:ios-arrow-rtl-24-filled text-3xl rotate-90"
className="cursor-pointer inline-block i-mingcute:down-line text-3xl"
></Link>
</div>
</div>
@ -586,7 +578,7 @@ export default function Home() {
</li>
))}
<li className="flex items-center justify-center">
<EllipsisHorizontalIcon className="w-12 h-12" />
<i className="i-mingcute:more-1-line text-5xl" />
</li>
</ul>
</div>