style: eslint config and prettier for dx
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import type { AchievementSection } from "~/models/site.model"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { AchievementModal } from "~/components/common/AchievementModal"
|
||||
import { useState } from "react"
|
||||
import { Indicator } from "@mantine/core"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
|
||||
import { Indicator } from "@mantine/core"
|
||||
|
||||
import { AchievementModal } from "~/components/common/AchievementModal"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import type { AchievementSection } from "~/models/site.model"
|
||||
|
||||
export const Badge = ({
|
||||
media,
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { Modal, Stepper } from "@mantine/core"
|
||||
import type { AchievementSection } from "~/models/site.model"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import Tilt from "react-parallax-tilt"
|
||||
import { Badge } from "~/components/common/AchievementItem"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { useMintAchievement } from "~/queries/site"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import Tilt from "react-parallax-tilt"
|
||||
|
||||
import { Modal, Stepper } from "@mantine/core"
|
||||
|
||||
import { Badge } from "~/components/common/AchievementItem"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { cn } from "~/lib/utils"
|
||||
import type { AchievementSection } from "~/models/site.model"
|
||||
import { useMintAchievement } from "~/queries/site"
|
||||
|
||||
export const AchievementModal: React.FC<{
|
||||
opened: boolean
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { CSB_IO, CSB_SCAN } from "~/lib/env"
|
||||
import { Profile, Note } from "~/lib/types"
|
||||
import { Disclosure } from "@headlessui/react"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { toIPFS, toGateway } from "~/lib/ipfs-parser"
|
||||
import { IPFS_GATEWAY } from "~/lib/env"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
import { Disclosure } from "@headlessui/react"
|
||||
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { CSB_IO, CSB_SCAN, IPFS_GATEWAY } from "~/lib/env"
|
||||
import { toGateway, toIPFS } from "~/lib/ipfs-parser"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const BlockchainInfo: React.FC<{
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useState } from "react"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
|
||||
import { FollowingButton } from "~/components/common/FollowingButton"
|
||||
import { FollowingCount } from "~/components/common/FollowingCount"
|
||||
import * as siteModel from "~/models/site.model"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import type { Profile } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
import * as siteModel from "~/models/site.model"
|
||||
|
||||
export const CharacterCard: React.FC<{
|
||||
siteId?: string
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import { useState } from "react"
|
||||
|
||||
import {
|
||||
offset,
|
||||
flip,
|
||||
shift,
|
||||
autoUpdate,
|
||||
useFloating,
|
||||
useInteractions,
|
||||
useHover,
|
||||
useFocus,
|
||||
useRole,
|
||||
flip,
|
||||
offset,
|
||||
shift,
|
||||
useDismiss,
|
||||
useFloating,
|
||||
useHover,
|
||||
useInteractions,
|
||||
useRole,
|
||||
useTransitionStyles,
|
||||
} from "@floating-ui/react"
|
||||
|
||||
import { CharacterCard } from "~/components/common/CharacterCard"
|
||||
|
||||
export const CharacterFloatCard: React.FC<{
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import InfiniteScroll from "react-infinite-scroller"
|
||||
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { CSB_SCAN } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
|
||||
import { Avatar } from "../ui/Avatar"
|
||||
import { Button } from "../ui/Button"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { CSB_SCAN } from "~/lib/env"
|
||||
import { Avatar } from "../ui/Avatar"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
export const CharacterList: React.FC<{
|
||||
open: boolean
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { Note } from "~/lib/types"
|
||||
import { useGetComments } from "~/queries/page"
|
||||
import { CommentItem } from "~/components/common/CommentItem"
|
||||
import { CommentInput } from "~/components/common/CommentInput"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import InfiniteScroll from "react-infinite-scroller"
|
||||
|
||||
import { CommentInput } from "~/components/common/CommentInput"
|
||||
import { CommentItem } from "~/components/common/CommentItem"
|
||||
import { Note } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useGetComments } from "~/queries/page"
|
||||
|
||||
export const Comment: React.FC<{
|
||||
page?: Note | null
|
||||
className?: string
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import { Profile } from "~/lib/types"
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { Input } from "~/components/ui/Input"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { useState, useEffect } from "react"
|
||||
import { useCommentPage, useUpdateComment } from "~/queries/page"
|
||||
import { useRouter } from "next/router"
|
||||
import { EmojiPicker } from "./EmojiPicker"
|
||||
import { Popover } from "@headlessui/react"
|
||||
import { CharacterEntity, NoteEntity } from "crossbell.js"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { NoteEntity, CharacterEntity } from "crossbell.js"
|
||||
import { useRouter } from "next/router"
|
||||
import { useEffect, useState } from "react"
|
||||
import { useForm } from "react-hook-form"
|
||||
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { Popover } from "@headlessui/react"
|
||||
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Input } from "~/components/ui/Input"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { useCommentPage, useUpdateComment } from "~/queries/page"
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
|
||||
import { EmojiPicker } from "./EmojiPicker"
|
||||
|
||||
export const CommentInput: React.FC<{
|
||||
pageId?: string
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { CharacterEntity, NoteEntity } from "crossbell.js"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { CommentInput } from "~/components/common/CommentInput"
|
||||
import { PageContent } from "~/components/common/PageContent"
|
||||
import { Reactions } from "~/components/common/Reactions"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { CSB_SCAN } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { PageContent } from "~/components/common/PageContent"
|
||||
import { NoteEntity, CharacterEntity } from "crossbell.js"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Reactions } from "~/components/common/Reactions"
|
||||
import { useState } from "react"
|
||||
import { CommentInput } from "~/components/common/CommentInput"
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
|
||||
export const CommentItem: React.FC<{
|
||||
comment: NoteEntity & {
|
||||
|
||||
@@ -1,36 +1,39 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import {
|
||||
useConnectModal,
|
||||
useAccountState,
|
||||
useDisconnectModal,
|
||||
GeneralAccount,
|
||||
useAccountBalance,
|
||||
useAccountState,
|
||||
useConnectModal,
|
||||
useCsbDetailModal,
|
||||
useDisconnectModal,
|
||||
useIsOpSignEnabled,
|
||||
useOpSignSettingsModal,
|
||||
useUpgradeAccountModal,
|
||||
useSelectCharactersModal,
|
||||
useAccountBalance,
|
||||
useUpgradeAccountModal,
|
||||
} from "@crossbell/connect-kit"
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { Button, type VariantColor, type Variant } from "~/components/ui/Button"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { useEffect, useState } from "react"
|
||||
import {
|
||||
useNotifications,
|
||||
useShowNotificationModal,
|
||||
} from "@crossbell/notification"
|
||||
import { useRefCallback } from "@crossbell/util-hooks"
|
||||
import {
|
||||
BellIcon,
|
||||
FaceFrownIcon,
|
||||
FaceSmileIcon,
|
||||
} from "@heroicons/react/24/outline"
|
||||
import { BellAlertIcon } from "@heroicons/react/24/solid"
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
import { useRefCallback } from "@crossbell/util-hooks"
|
||||
import {
|
||||
useShowNotificationModal,
|
||||
useNotifications,
|
||||
} from "@crossbell/notification"
|
||||
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { Button, type Variant, type VariantColor } from "~/components/ui/Button"
|
||||
import { Menu } from "~/components/ui/Menu"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
type HeaderLinkType = {
|
||||
icon?: React.ReactNode
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Switch } from "@headlessui/react"
|
||||
|
||||
import { useDarkModeSwitch, useIsDark } from "~/hooks/useDarkMode"
|
||||
|
||||
export const DarkModeSwitch = () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useRef } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { useIsDark } from "~/hooks/useDarkMode"
|
||||
|
||||
export const EmojiPicker: React.FC<{
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import { Trans, useTranslation } from "next-i18next"
|
||||
import { useEffect } from "react"
|
||||
import { toast } from "react-hot-toast"
|
||||
|
||||
import { useConnectedAction } from "@crossbell/connect-kit"
|
||||
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import type { Variant } from "~/components/ui/Button"
|
||||
import { useEffect } from "react"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
import {
|
||||
useAccountSites,
|
||||
useGetSubscription,
|
||||
useSubscribeToSite,
|
||||
useUnsubscribeFromSite,
|
||||
useAccountSites,
|
||||
} from "~/queries/site"
|
||||
import { useConnectedAction } from "@crossbell/connect-kit"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { Trans, useTranslation } from "next-i18next"
|
||||
import { toast } from "react-hot-toast"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
|
||||
export const FollowingButton: React.FC<{
|
||||
site: Profile | undefined | null
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
|
||||
import { CharacterList } from "~/components/common/CharacterList"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import {
|
||||
useGetSiteSubscriptions,
|
||||
useGetSiteToSubscriptions,
|
||||
} from "~/queries/site"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
|
||||
export const FollowingCount: React.FC<{
|
||||
siteId?: string
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import React, { useRef } from "react"
|
||||
import Lottie, { type LottieRefCurrentProps } from "lottie-react"
|
||||
import LogoLottieJSON from "../../../public/assets/logo.json"
|
||||
import React, { useRef } from "react"
|
||||
|
||||
import { Image } from "~/components/ui/Image"
|
||||
|
||||
import LogoLottieJSON from "../../../public/assets/logo.json"
|
||||
|
||||
export const Logo: React.FC<{
|
||||
type: "svg" | "png" | "lottie"
|
||||
width?: number
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import Editor, { EditorProps } from "@monaco-editor/react"
|
||||
import { useMonacoTheme } from "./use-theme"
|
||||
|
||||
import { useIsDark } from "~/hooks/useDarkMode"
|
||||
|
||||
import { useMonacoTheme } from "./use-theme"
|
||||
|
||||
export function MonacoEditor(props: EditorProps) {
|
||||
const isDark = useIsDark()
|
||||
useMonacoTheme(isDark)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { useMonaco } from "@monaco-editor/react"
|
||||
import { useEffect } from "react"
|
||||
|
||||
import { useMonaco } from "@monaco-editor/react"
|
||||
|
||||
import Dark from "./theme/dark.json"
|
||||
import Light from "./theme/light.json"
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useCodeCopy } from "~/hooks/useCodeCopy"
|
||||
import { renderPageContent } from "~/markdown"
|
||||
import { PostToc } from "~/components/site/PostToc"
|
||||
import { MutableRefObject, useMemo } from "react"
|
||||
|
||||
import { PostToc } from "~/components/site/PostToc"
|
||||
import { useCodeCopy } from "~/hooks/useCodeCopy"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { renderPageContent } from "~/markdown"
|
||||
|
||||
export const PageContent: React.FC<{
|
||||
content?: string
|
||||
className?: string
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
|
||||
import { PatronModal } from "~/components/common/PatronModal"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useState } from "react"
|
||||
import { PatronModal } from "~/components/common/PatronModal"
|
||||
|
||||
export const PatronButton: React.FC<{
|
||||
site: Profile | undefined | null
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { BoxRadio } from "~/components/ui/BoxRadio"
|
||||
import { Tabs } from "../ui/Tabs"
|
||||
import { useTipCharacter, useGetTips } from "~/queries/site"
|
||||
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
|
||||
import { toast } from "react-hot-toast"
|
||||
import confetti from "canvas-confetti"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { toast } from "react-hot-toast"
|
||||
|
||||
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
|
||||
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { CharacterFloatCard } from "./CharacterFloatCard"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { BoxRadio } from "~/components/ui/BoxRadio"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { CSB_SCAN, MIRA_LINK } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { parsePageId } from "~/models/page.model"
|
||||
import { useGetTips, useTipCharacter } from "~/queries/site"
|
||||
|
||||
import { Tabs } from "../ui/Tabs"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { CharacterFloatCard } from "./CharacterFloatCard"
|
||||
|
||||
export const PatronModal: React.FC<{
|
||||
site: Profile | undefined | null
|
||||
|
||||
@@ -1,29 +1,32 @@
|
||||
import {
|
||||
useMintPage,
|
||||
useGetLikes,
|
||||
useCheckLike,
|
||||
useGetMints,
|
||||
useCheckMint,
|
||||
useToggleLikePage,
|
||||
useGetLikeCounts,
|
||||
} from "~/queries/page"
|
||||
import { useGetTips } from "~/queries/site"
|
||||
import { useState, useEffect, useRef } from "react"
|
||||
import { Button } from "../ui/Button"
|
||||
import { CSB_SCAN, CSB_XCHAR } from "~/lib/env"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { Avatar } from "../ui/Avatar"
|
||||
import { MintIcon } from "~/components/icons/MintIcon"
|
||||
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 { useEffect, useRef, useState } from "react"
|
||||
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
|
||||
import { CharacterList } from "~/components/common/CharacterList"
|
||||
import { PatronModal } from "~/components/common/PatronModal"
|
||||
import { MintIcon } from "~/components/icons/MintIcon"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { CSB_SCAN, CSB_XCHAR } from "~/lib/env"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { parsePageId } from "~/models/page.model"
|
||||
import {
|
||||
useCheckLike,
|
||||
useCheckMint,
|
||||
useGetLikeCounts,
|
||||
useGetLikes,
|
||||
useGetMints,
|
||||
useMintPage,
|
||||
useToggleLikePage,
|
||||
} from "~/queries/page"
|
||||
import { useGetTips } from "~/queries/site"
|
||||
|
||||
import { Avatar } from "../ui/Avatar"
|
||||
import { Button } from "../ui/Button"
|
||||
|
||||
export const Reactions: React.FC<{
|
||||
className?: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Head from "next/head"
|
||||
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
|
||||
export const SEOHead: React.FC<{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useForm } from "react-hook-form"
|
||||
import { useRouter } from "next/router"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useRouter } from "next/router"
|
||||
import { useForm } from "react-hook-form"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const SearchInput: React.FC<{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
import data from "../../../data/titles.json"
|
||||
import { Tooltip } from "../ui/Tooltip"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
||||
|
||||
import { languageDetector } from "~/lib/language-detector"
|
||||
|
||||
export const getServerSideProps = async (ctx: any) => {
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useRouter } from "next/router"
|
||||
import React, { useEffect } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { DISCORD_LINK, APP_NAME } from "~/lib/env"
|
||||
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
|
||||
import {
|
||||
useNotifications,
|
||||
useShowNotificationModal,
|
||||
} from "@crossbell/notification"
|
||||
|
||||
import { ConnectButton } from "~/components/common/ConnectButton"
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { useIsMobileLayout } from "~/hooks/useMobileLayout"
|
||||
import { useUserRole } from "~/hooks/useUserRole"
|
||||
import { APP_NAME, DISCORD_LINK } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { getStorage } from "~/lib/storage"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useGetPagesBySite } from "~/queries/page"
|
||||
import { useAccountSites, useGetSite } from "~/queries/site"
|
||||
|
||||
import { SEOHead } from "../common/SEOHead"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { DashboardSidebar } from "./DashboardSidebar"
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
import { ConnectButton } from "~/components/common/ConnectButton"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import {
|
||||
useShowNotificationModal,
|
||||
useNotifications,
|
||||
} from "@crossbell/notification"
|
||||
import { useUserRole } from "~/hooks/useUserRole"
|
||||
import { useAccountState, useConnectModal } from "@crossbell/connect-kit"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import { getStorage } from "~/lib/storage"
|
||||
import { useGetPagesBySite } from "~/queries/page"
|
||||
import { DashboardTopbar } from "./DashboardTopbar"
|
||||
import { useIsMobileLayout } from "~/hooks/useMobileLayout"
|
||||
|
||||
export function DashboardLayout({
|
||||
children,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
import { useIsMobileLayout } from "~/hooks/useMobileLayout"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const DashboardMain: React.FC<{
|
||||
children: React.ReactNode
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect, useMemo } from "react"
|
||||
import { setStorage, getStorage } from "~/lib/storage"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { getStorage, setStorage } from "~/lib/storage"
|
||||
|
||||
export const DashboardSidebar: React.FC<{
|
||||
children: (isOpen: boolean) => React.ReactNode
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useState, useEffect, useMemo, Fragment } from "react"
|
||||
import { setStorage, getStorage } from "~/lib/storage"
|
||||
import { Fragment, useState } from "react"
|
||||
|
||||
import { Bars3Icon, ChevronDownIcon } from "@heroicons/react/24/outline"
|
||||
import { Logo } from "../common/Logo"
|
||||
import { Popover, Transition } from "@headlessui/react"
|
||||
import { Bars3Icon } from "@heroicons/react/24/outline"
|
||||
|
||||
import { Logo } from "../common/Logo"
|
||||
|
||||
export const DashboardTopbar: React.FC<{
|
||||
children: (open: boolean) => React.ReactNode
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { Modal } from "../ui/Modal"
|
||||
|
||||
import { Button } from "../ui/Button"
|
||||
import { Modal } from "../ui/Modal"
|
||||
|
||||
export const DeleteConfirmationModal: React.FC<{
|
||||
open: boolean
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import type { NoteMetadata } from "crossbell.js"
|
||||
import { useState } from "react"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { PageContent } from "../common/PageContent"
|
||||
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
|
||||
import { PageContent } from "../common/PageContent"
|
||||
|
||||
export const ImportPreview: React.FC<{
|
||||
note: NoteMetadata
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Menu, Popover, Transition } from "@headlessui/react"
|
||||
import { Dispatch, Fragment, SetStateAction, useState } from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { Menu, Popover, Transition } from "@headlessui/react"
|
||||
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
import { DeleteConfirmationModal } from "./DeleteConfirmationModal"
|
||||
|
||||
export const OptionsButton: React.FC<{
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
import { Fragment, useMemo } from "react"
|
||||
import { getPageVisibility } from "~/lib/page-helpers"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { TabItem, Tabs } from "../ui/Tabs"
|
||||
import { Menu } from "@headlessui/react"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { DashboardMain } from "./DashboardMain"
|
||||
import { useRouter } from "next/router"
|
||||
import Link from "next/link"
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { useGetPagesBySite } from "~/queries/page"
|
||||
import { 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 { Tooltip } from "../ui/Tooltip"
|
||||
import { Trans, useTranslation } from "next-i18next"
|
||||
import Link from "next/link"
|
||||
import { useRouter } from "next/router"
|
||||
import { Fragment, useMemo } from "react"
|
||||
|
||||
import { Menu } from "@headlessui/react"
|
||||
import { useQueryClient } from "@tanstack/react-query"
|
||||
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { getPageVisibility } from "~/lib/page-helpers"
|
||||
import { readFiles } from "~/lib/read-files"
|
||||
import { setStorage } from "~/lib/storage"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useGetPagesBySite } from "~/queries/page"
|
||||
|
||||
import { Button } from "../ui/Button"
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { TabItem, Tabs } from "../ui/Tabs"
|
||||
import { Tooltip } from "../ui/Tooltip"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { DashboardMain } from "./DashboardMain"
|
||||
import { PagesManagerMenu } from "./PagesManagerMenu"
|
||||
|
||||
export const PagesManager: React.FC<{
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { FC, useEffect, useState } from "react"
|
||||
import { Menu } from "@headlessui/react"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useRouter } from "next/router"
|
||||
import { FC, useEffect, useState } from "react"
|
||||
import toast from "react-hot-toast"
|
||||
import type { Note } from "unidata.js"
|
||||
import { useDeletePage, useCreateOrUpdatePage } from "~/queries/page"
|
||||
import { delStorage, getStorage, setStorage } from "~/lib/storage"
|
||||
|
||||
import { Menu } from "@headlessui/react"
|
||||
import { useQueryClient } from "@tanstack/react-query"
|
||||
import { APP_NAME } from "~/lib/env"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
import { useGetState } from "~/hooks/useGetState"
|
||||
import { APP_NAME } from "~/lib/env"
|
||||
import { getNoteSlugFromNote, getSiteLink } from "~/lib/helpers"
|
||||
import { delStorage, getStorage, setStorage } from "~/lib/storage"
|
||||
import { useCreateOrUpdatePage, useDeletePage } from "~/queries/page"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
|
||||
const usePageEditLink = (page: { id: string }, isPost: boolean) => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import useOnClickOutside from "use-onclickoutside"
|
||||
|
||||
import { Button, ButtonGroup } from "../ui/Button"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
export const PublishButton: React.FC<{
|
||||
save: (published: boolean) => void
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useRouter } from "next/router"
|
||||
import React from "react"
|
||||
|
||||
import { type TabItem, Tabs } from "../ui/Tabs"
|
||||
import { DashboardMain } from "./DashboardMain"
|
||||
import { useTranslation } from "next-i18next"
|
||||
|
||||
export const SettingsLayout: React.FC<{
|
||||
title: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from "react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const BlockchainIcon = ({ className }: { className?: string }) => {
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
import Link from "next/link"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { useRouter } from "next/router"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useGetFeed } from "~/queries/home"
|
||||
import type { FeedType, SearchType } from "~/models/home.model"
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import InfiniteScroll from "react-infinite-scroller"
|
||||
import { ExpandedNote } from "~/lib/types"
|
||||
import Link from "next/link"
|
||||
import { useRouter } from "next/router"
|
||||
import { useEffect, useState } from "react"
|
||||
import { Switch } from "@headlessui/react"
|
||||
import { setStorage, getStorage } from "~/lib/storage"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
import { Tabs } from "~/components/ui/Tabs"
|
||||
import InfiniteScroll from "react-infinite-scroller"
|
||||
import reactStringReplace from "react-string-replace"
|
||||
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { Switch } from "@headlessui/react"
|
||||
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { Titles } from "~/components/common/Titles"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { Tabs } from "~/components/ui/Tabs"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { getStorage, setStorage } from "~/lib/storage"
|
||||
import { ExpandedNote } from "~/lib/types"
|
||||
import type { FeedType, SearchType } from "~/models/home.model"
|
||||
import { useGetFeed } from "~/queries/home"
|
||||
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
|
||||
const Post = ({
|
||||
post,
|
||||
filtering,
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useRouter } from "next/router"
|
||||
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import {
|
||||
APP_DESCRIPTION,
|
||||
APP_NAME,
|
||||
GITHUB_LINK,
|
||||
DISCORD_LINK,
|
||||
GITHUB_LINK,
|
||||
TWITTER_LINK,
|
||||
} from "~/lib/env"
|
||||
import { SEOHead } from "../common/SEOHead"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { ConnectButton } from "../common/ConnectButton"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import { useRouter } from "next/router"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { Image } from "../ui/Image"
|
||||
|
||||
import { ConnectButton } from "../common/ConnectButton"
|
||||
import { DarkModeSwitch } from "../common/DarkModeSwitch"
|
||||
import { SEOHead } from "../common/SEOHead"
|
||||
import { Image } from "../ui/Image"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useState } from "react"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
|
||||
import { useConnectedAction } from "@crossbell/connect-kit"
|
||||
import { useRefCallback } from "@crossbell/util-hooks"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useGetSites } from "~/queries/site"
|
||||
import showcase from "../../../data/showcase.json"
|
||||
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { useAccountSites, useSubscribeToSites } from "~/queries/site"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import topics from "../../../data/topics.json"
|
||||
import { SearchInput } from "~/components/common/SearchInput"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import {
|
||||
useAccountSites,
|
||||
useGetSites,
|
||||
useSubscribeToSites,
|
||||
} from "~/queries/site"
|
||||
|
||||
import showcase from "../../../data/showcase.json"
|
||||
import topics from "../../../data/topics.json"
|
||||
|
||||
export function MainSidebar({ hideSearch }: { hideSearch?: boolean }) {
|
||||
const showcaseSites = useGetSites(showcase)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
const syncMap: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { Comment } from "~/components/common/Comment"
|
||||
import { Reactions } from "~/components/common/Reactions"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
|
||||
export const PostFooter: React.FC<{
|
||||
page?: Note | null
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { CSB_SCAN, SITE_URL } from "~/lib/env"
|
||||
import { useEffect, useState } from "react"
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { useUserRole } from "~/hooks/useUserRole"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useGetSummary } from "~/queries/page"
|
||||
import { useUserRole } from "~/hooks/useUserRole"
|
||||
import { CSB_SCAN, SITE_URL } from "~/lib/env"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { toCid } from "~/lib/ipfs-parser"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { useGetSummary } from "~/queries/page"
|
||||
|
||||
export const PostMeta: React.FC<{
|
||||
page: Note
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState, useRef } from "react"
|
||||
import type { Result as TocResult } from "mdast-util-toc"
|
||||
import React, { useEffect, useRef, useState } from "react"
|
||||
import { Link } from "react-scroll"
|
||||
|
||||
function getIds(items: TocResult["map"]) {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import Link from "next/link"
|
||||
import { useMemo } from "react"
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { Notes, Note } from "~/lib/types"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Note, Notes } from "~/lib/types"
|
||||
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
export const SiteArchives: React.FC<{
|
||||
title?: string
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { Profile, Note } from "~/lib/types"
|
||||
import Script from "next/script"
|
||||
import { Platform } from "~/components/site/Platform"
|
||||
import { Trans } from "next-i18next"
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import Script from "next/script"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { Logo } from "~/components/common/Logo"
|
||||
import { Platform } from "~/components/site/Platform"
|
||||
import { SITE_URL } from "~/lib/env"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
|
||||
import { DarkModeSwitch } from "../common/DarkModeSwitch"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
|
||||
export const SiteFooter: React.FC<{
|
||||
site?: Profile | null
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import chroma from "chroma-js"
|
||||
import { FastAverageColor } from "fast-average-color"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useRouter } from "next/router"
|
||||
import { CSB_SCAN, CSB_IO, CSB_XCHAR } from "~/lib/env"
|
||||
import { MutableRefObject, RefObject, useEffect, useRef, useState } from "react"
|
||||
|
||||
import { XCharLogo, XFeedLogo } from "@crossbell/ui"
|
||||
import { RssIcon } from "@heroicons/react/24/solid"
|
||||
|
||||
import { FollowingButton } from "~/components/common/FollowingButton"
|
||||
import { FollowingCount } from "~/components/common/FollowingCount"
|
||||
import { PatronButton } from "~/components/common/PatronButton"
|
||||
import { SearchInput } from "~/components/common/SearchInput"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { Menu } from "~/components/ui/Menu"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { useIsDark } from "~/hooks/useDarkMode"
|
||||
import { CSB_IO, CSB_SCAN, CSB_XCHAR } from "~/lib/env"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { getUserContentsUrl } from "~/lib/user-contents"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
import { ConnectButton } from "../common/ConnectButton"
|
||||
import { Avatar } from "../ui/Avatar"
|
||||
import { Button } from "../ui/Button"
|
||||
import { UniLink } from "../ui/UniLink"
|
||||
import { Profile } from "~/lib/types"
|
||||
import { ConnectButton } from "../common/ConnectButton"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { FollowingButton } from "~/components/common/FollowingButton"
|
||||
import { FollowingCount } from "~/components/common/FollowingCount"
|
||||
import { RssIcon } from "@heroicons/react/24/solid"
|
||||
import { XCharLogo, XFeedLogo } from "@crossbell/ui"
|
||||
import { FastAverageColor } from "fast-average-color"
|
||||
import { useState, useRef, useEffect, RefObject, MutableRefObject } from "react"
|
||||
import chroma from "chroma-js"
|
||||
import { Menu } from "~/components/ui/Menu"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { PatronButton } from "~/components/common/PatronButton"
|
||||
import { Modal } from "~/components/ui/Modal"
|
||||
import { SearchInput } from "~/components/common/SearchInput"
|
||||
import { useIsDark } from "~/hooks/useDarkMode"
|
||||
|
||||
type HeaderLinkType = {
|
||||
icon?: React.ReactNode
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { useTranslation } from "next-i18next"
|
||||
import Link from "next/link"
|
||||
import { useRouter } from "next/router"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { Notes } from "~/lib/types"
|
||||
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { useRouter } from "next/router"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export const SiteHome: React.FC<{
|
||||
postPages?: Notes[]
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
||||
|
||||
import { QueryClient, dehydrate } from "@tanstack/react-query"
|
||||
|
||||
import { languageDetector } from "~/lib/language-detector"
|
||||
import { notFound } from "~/lib/server-side-props"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { fetchGetPage, prefetchGetPagesBySite } from "~/queries/page.server"
|
||||
import {
|
||||
prefetchGetSite,
|
||||
prefetchGetSiteSubscriptions,
|
||||
prefetchGetSiteToSubscriptions,
|
||||
} from "~/queries/site.server"
|
||||
import { prefetchGetPagesBySite } from "~/queries/page.server"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { dehydrate, QueryClient } from "@tanstack/react-query"
|
||||
import { fetchGetPage } from "~/queries/page.server"
|
||||
import { notFound } from "~/lib/server-side-props"
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
|
||||
import { languageDetector } from "~/lib/language-detector"
|
||||
|
||||
export const getServerSideProps = async (
|
||||
ctx: any,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
import { useRouter } from "next/router"
|
||||
import React, { useEffect } from "react"
|
||||
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
|
||||
import { BlockchainInfo } from "~/components/common/BlockchainInfo"
|
||||
import { useUserRole } from "~/hooks/useUserRole"
|
||||
import { IS_PROD } from "~/lib/constants"
|
||||
@@ -10,6 +12,7 @@ import { getUserContentsUrl } from "~/lib/user-contents"
|
||||
import { cn } from "~/lib/utils"
|
||||
import { useCheckLike, useCheckMint, useGetPage } from "~/queries/page"
|
||||
import { useGetSite, useGetSubscription } from "~/queries/site"
|
||||
|
||||
import { SEOHead } from "../common/SEOHead"
|
||||
import { SiteFooter } from "./SiteFooter"
|
||||
import { SiteHeader } from "./SiteHeader"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { PageContent } from "../common/PageContent"
|
||||
import { PostMeta } from "./PostMeta"
|
||||
import { PostFooter } from "./PostFooter"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import Head from "next/head"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import Head from "next/head"
|
||||
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
|
||||
import { PageContent } from "../common/PageContent"
|
||||
import { PostFooter } from "./PostFooter"
|
||||
import { PostMeta } from "./PostMeta"
|
||||
|
||||
export const SitePage: React.FC<{
|
||||
page?: Note | null
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import Link from "next/link"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { ExpandedNote, Notes } from "~/lib/types"
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
import { useRouter } from "next/router"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import Link from "next/link"
|
||||
import { useRouter } from "next/router"
|
||||
import { useEffect, useState } from "react"
|
||||
import reactStringReplace from "react-string-replace"
|
||||
|
||||
import { Button } from "~/components/ui/Button"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useDate } from "~/hooks/useDate"
|
||||
import { ExpandedNote } from "~/lib/types"
|
||||
|
||||
import { EmptyState } from "../ui/EmptyState"
|
||||
|
||||
export const SiteSearch: React.FC<{
|
||||
postPages?: {
|
||||
list: ExpandedNote[]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { APlayer as AplayerReact } from "aplayer-react"
|
||||
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
|
||||
export const APlayer: React.FC<
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import React, { useMemo } from "react"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const Avatar: React.FC<
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import React from "react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const Badge: React.FC<{
|
||||
children: React.ReactNode
|
||||
className?: string
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { nanoid } from "nanoid"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import React, {
|
||||
ChangeEvent,
|
||||
FocusEvent,
|
||||
Dispatch,
|
||||
FocusEvent,
|
||||
SetStateAction,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react"
|
||||
import { UniLink } from "./UniLink"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { nanoid } from "nanoid"
|
||||
|
||||
import { Input } from "~/components/ui/Input"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export type RadioItem = {
|
||||
text: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { memo } from "react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const ButtonGroup: React.FC<{ children: React.ReactNode }> = ({
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
import type { EditorState } from "@codemirror/state"
|
||||
import { Annotation } from "@codemirror/state"
|
||||
|
||||
import { HighlightStyle } from "@codemirror/language"
|
||||
import { EditorView, KeyBinding, ViewUpdate } from "@codemirror/view"
|
||||
import { tags } from "@lezer/highlight"
|
||||
import type { Tag } from "@lezer/highlight"
|
||||
import {
|
||||
Suspense,
|
||||
forwardRef,
|
||||
@@ -14,6 +7,14 @@ import {
|
||||
useState,
|
||||
} from "react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
import { HighlightStyle } from "@codemirror/language"
|
||||
import type { EditorState } from "@codemirror/state"
|
||||
import { Annotation } from "@codemirror/state"
|
||||
import { EditorView, KeyBinding, ViewUpdate } from "@codemirror/view"
|
||||
import { tags } from "@lezer/highlight"
|
||||
import type { Tag } from "@lezer/highlight"
|
||||
|
||||
import {
|
||||
useCodeMirrorAutoToggleTheme,
|
||||
useCodeMirrorStyle,
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { FC, memo, useCallback, useState } from "react"
|
||||
import { ICommand } from "~/editor"
|
||||
import { Tooltip } from "./Tooltip"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { Popover } from "@headlessui/react"
|
||||
import { FC, memo, useCallback, useState } from "react"
|
||||
import { usePopper } from "react-popper"
|
||||
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { Popover } from "@headlessui/react"
|
||||
|
||||
import { ICommand } from "~/editor"
|
||||
|
||||
import { Tooltip } from "./Tooltip"
|
||||
|
||||
export interface EditorToolbarProps {
|
||||
view?: EditorView
|
||||
toolbars: ICommand[]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ImageProps, default as NextImage } from "next/image"
|
||||
import React, { useEffect } from "react"
|
||||
import { default as NextImage, ImageProps } from "next/image"
|
||||
import { toGateway, toIPFS } from "~/lib/ipfs-parser"
|
||||
import { useIsMobileLayout } from "~/hooks/useMobileLayout"
|
||||
|
||||
import { useGetState } from "~/hooks/useGetState"
|
||||
import { useIsMobileLayout } from "~/hooks/useMobileLayout"
|
||||
import { toGateway, toIPFS } from "~/lib/ipfs-parser"
|
||||
|
||||
type TImageProps = {
|
||||
className?: string
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import React, { ChangeEvent, forwardRef, useEffect } from "react"
|
||||
import { useState } from "react"
|
||||
import React, { ChangeEvent, forwardRef, useEffect, useState } from "react"
|
||||
|
||||
import { XMarkIcon } from "@heroicons/react/20/solid"
|
||||
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { useUploadFile } from "~/hooks/useUploadFile"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { XMarkIcon } from "@heroicons/react/20/solid"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
const getBase64 = (img: File, callback: (url: string) => void) => {
|
||||
const reader = new FileReader()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import { forwardRef } from "react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
import { FieldLabel } from "./FieldLabel"
|
||||
|
||||
type InputProps<TMultiline extends boolean> = {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import React from "react"
|
||||
import { CharacterFloatCard } from "../common/CharacterFloatCard"
|
||||
import { UniLink } from "./UniLink"
|
||||
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { useGetSite } from "~/queries/site"
|
||||
|
||||
import { CharacterFloatCard } from "../common/CharacterFloatCard"
|
||||
import { UniLink } from "./UniLink"
|
||||
|
||||
export const Mention: React.FC<{
|
||||
id: string
|
||||
children?: any
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { useState } from "react"
|
||||
|
||||
import {
|
||||
offset,
|
||||
flip,
|
||||
shift,
|
||||
Placement,
|
||||
autoUpdate,
|
||||
flip,
|
||||
offset,
|
||||
shift,
|
||||
useClick,
|
||||
useDismiss,
|
||||
useFloating,
|
||||
useInteractions,
|
||||
useClick,
|
||||
useRole,
|
||||
useDismiss,
|
||||
useTransitionStyles,
|
||||
Placement,
|
||||
} from "@floating-ui/react"
|
||||
|
||||
export const Menu: React.FC<{
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { nanoid } from "nanoid"
|
||||
import { FC, useEffect, useState } from "react"
|
||||
|
||||
import { useIsDark } from "~/hooks/useDarkMode"
|
||||
import { useIsUnmounted } from "~/hooks/useLifecycle"
|
||||
import { nanoid } from "nanoid"
|
||||
|
||||
export const Mermaid: FC<{
|
||||
children: [string]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Dialog } from "@headlessui/react"
|
||||
import { cn } from "~/lib/utils"
|
||||
import React from "react"
|
||||
|
||||
import { Dialog } from "@headlessui/react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
export const Modal: React.FC<{
|
||||
open: boolean
|
||||
setOpen: (open: boolean) => void
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { cn } from "~/lib/utils"
|
||||
import React from "react"
|
||||
import { UniLink } from "./UniLink"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import React from "react"
|
||||
|
||||
import { Tooltip } from "~/components/ui/Tooltip"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
import { UniLink } from "./UniLink"
|
||||
|
||||
export type TabItem = {
|
||||
text: string
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import { cloneElement, useState } from "react"
|
||||
import { useState } from "react"
|
||||
|
||||
import {
|
||||
Placement,
|
||||
offset,
|
||||
flip,
|
||||
shift,
|
||||
autoUpdate,
|
||||
useFloating,
|
||||
useInteractions,
|
||||
useHover,
|
||||
useFocus,
|
||||
useRole,
|
||||
flip,
|
||||
offset,
|
||||
shift,
|
||||
useDismiss,
|
||||
useFloating,
|
||||
useFocus,
|
||||
useHover,
|
||||
useInteractions,
|
||||
useRole,
|
||||
useTransitionStyles,
|
||||
} from "@floating-ui/react"
|
||||
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useState } from "react"
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import axios from "axios"
|
||||
import React, { useState } from "react"
|
||||
|
||||
import { Image } from "~/components/ui/Image"
|
||||
import { IPFS_GATEWAY } from "~/lib/env"
|
||||
|
||||
export const UniMedia: React.FC<{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { EditorSelection } from "@codemirror/state"
|
||||
import { ICommand, wrapExecute } from "."
|
||||
|
||||
export const Code: ICommand = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { EmojiPicker } from "~/components/common/EmojiPicker"
|
||||
import { ICommand, prependExecute, wrapExecute } from "."
|
||||
|
||||
import { ICommand, wrapExecute } from "."
|
||||
|
||||
export const Emoji: ICommand<string> = {
|
||||
name: "emoji",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
|
||||
import { ICommand } from "."
|
||||
|
||||
export const Help: ICommand = {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { EditorSelection } from "@codemirror/state"
|
||||
import { ICommand, prependExecute, wrapExecute } from "."
|
||||
import { UploadFile } from "~/lib/upload-file"
|
||||
import toast from "react-hot-toast"
|
||||
|
||||
import { UploadFile } from "~/lib/upload-file"
|
||||
|
||||
import { ICommand, wrapExecute } from "."
|
||||
|
||||
export const Image: ICommand = {
|
||||
name: "upload-image",
|
||||
label: "Upload Image",
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import { EditorSelection } from "@codemirror/state"
|
||||
import { ICommand, prependExecute, wrapExecute } from "."
|
||||
import { ICommand, wrapExecute } from "."
|
||||
|
||||
export const Link: ICommand = {
|
||||
name: "link",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { EditorSelection } from "@codemirror/state"
|
||||
import { ICommand, wrapExecute } from "."
|
||||
|
||||
export const ListOrdered: ICommand = {
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
import { Dispatch, SetStateAction } from "react"
|
||||
|
||||
import { EditorSelection } from "@codemirror/state"
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { Dispatch, SetStateAction } from "react"
|
||||
|
||||
import { Bold } from "./Bold"
|
||||
import { Code } from "./Code"
|
||||
import { CodeBlock } from "./CodeBlock"
|
||||
import { Emoji } from "./Emoji"
|
||||
import { Heading } from "./Heading"
|
||||
import { Help } from "./Help"
|
||||
import { Image } from "./Image"
|
||||
import { Italic } from "./Italic"
|
||||
import { Link } from "./Link"
|
||||
import { ListOrdered } from "./ListOrdered"
|
||||
import { ListUnordered } from "./ListUnordered"
|
||||
import { Mention } from "./Mention"
|
||||
import { Quote } from "./Quote"
|
||||
import { Strikethrough } from "./Strikethrough"
|
||||
import { Underline } from "./Underline"
|
||||
import { Mention } from "./Mention"
|
||||
import { Emoji } from "./Emoji"
|
||||
import { Help } from "./Help"
|
||||
|
||||
export type ICommand<P = any> = {
|
||||
icon: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect } from "react"
|
||||
|
||||
import { clipboardCopy } from "~/lib/copy.client"
|
||||
|
||||
export const useCodeCopy = () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import type { Extension } from "@codemirror/state"
|
||||
import { Compartment } from "@codemirror/state"
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { useEffect, useRef } from "react"
|
||||
|
||||
import type { Extension } from "@codemirror/state"
|
||||
import { Compartment } from "@codemirror/state"
|
||||
import { oneDark } from "@codemirror/theme-one-dark"
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { githubLight } from "@ddietr/codemirror-themes/theme/github-light"
|
||||
|
||||
import { useIsUnmounted } from "./useLifecycle"
|
||||
import { useIsMobileLayout } from "./useMobileLayout"
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { create } from "zustand"
|
||||
import { getStorage, setStorage, delStorage } from "~/lib/storage"
|
||||
|
||||
import { delStorage, getStorage, setStorage } from "~/lib/storage"
|
||||
|
||||
import { useGetState } from "./useGetState"
|
||||
|
||||
interface IMediaStore {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import dayjs from "dayjs"
|
||||
|
||||
import utc from "dayjs/plugin/utc"
|
||||
import tz from "dayjs/plugin/timezone"
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat"
|
||||
import duration from "dayjs/plugin/duration"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import "dayjs/locale/en"
|
||||
import "dayjs/locale/ja"
|
||||
import "dayjs/locale/zh"
|
||||
import "dayjs/locale/zh-tw"
|
||||
import "dayjs/locale/ja"
|
||||
import duration from "dayjs/plugin/duration"
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat"
|
||||
import relativeTime from "dayjs/plugin/relativeTime"
|
||||
import tz from "dayjs/plugin/timezone"
|
||||
import utc from "dayjs/plugin/utc"
|
||||
import { useTranslation } from "next-i18next"
|
||||
import { useMemo } from "react"
|
||||
|
||||
dayjs.extend(localizedFormat)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useCallback } from "react"
|
||||
|
||||
import { UploadFile } from "../lib/upload-file"
|
||||
|
||||
export const useUploadFile = () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useAccountSites } from "~/queries/site"
|
||||
import { useGetSite, useIsOperators } from "~/queries/site"
|
||||
import { useAccountState } from "@crossbell/connect-kit"
|
||||
|
||||
import { useAccountSites, useGetSite, useIsOperators } from "~/queries/site"
|
||||
|
||||
export function useUserRole(subdomain?: string) {
|
||||
const site = useGetSite(subdomain)
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Note, Profile } from "~/lib/types"
|
||||
import { nanoid } from "nanoid"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { SITE_URL, SCORE_API_DOMAIN } from "~/lib/env"
|
||||
import { toCid } from "~/lib/ipfs-parser"
|
||||
import { ExpandedNote } from "~/lib/types"
|
||||
|
||||
import { SCORE_API_DOMAIN, SITE_URL } from "~/lib/env"
|
||||
import { toCid, toGateway } from "~/lib/ipfs-parser"
|
||||
import { ExpandedNote, Note, Profile } from "~/lib/types"
|
||||
|
||||
export const expandUnidataNote = async (page: Note, useStat?: boolean) => {
|
||||
if (page.body?.content && page.body?.mime_type === "text/markdown") {
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
import { NoteEntity } from "crossbell.js"
|
||||
import { Note } from "unidata.js"
|
||||
|
||||
import { IS_PROD } from "./constants"
|
||||
import { OUR_DOMAIN } from "./env"
|
||||
import { Note } from "unidata.js"
|
||||
|
||||
export const getSiteLink = ({
|
||||
domain,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { fetchGetSite } from "~/queries/site.server"
|
||||
import { fetchGetPagesBySite } from "~/queries/page.server"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { QueryClient } from "@tanstack/react-query"
|
||||
|
||||
import { getSiteLink } from "~/lib/helpers"
|
||||
import { PageVisibilityEnum } from "~/lib/types"
|
||||
import { renderPageContent } from "~/markdown"
|
||||
import { fetchGetPagesBySite } from "~/queries/page.server"
|
||||
import { fetchGetSite } from "~/queries/site.server"
|
||||
|
||||
export const getJsonFeed = async (domainOrSubdomain: string, path: string) => {
|
||||
const queryClient = new QueryClient()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import dayjs from "dayjs"
|
||||
|
||||
import { PageVisibilityEnum } from "./types"
|
||||
|
||||
export const getPageVisibility = ({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { get, set, del } from "idb-keyval"
|
||||
import { del, get, set } from "idb-keyval"
|
||||
|
||||
import {
|
||||
PersistedClient,
|
||||
Persister,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { renderPageContent } from "~/markdown"
|
||||
import { getDefaultSlug } from "~/lib/default-slug"
|
||||
import { renderPageContent } from "~/markdown"
|
||||
|
||||
const makeArray = (value: any) => {
|
||||
if (Array.isArray(value)) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Redis from "ioredis"
|
||||
import { REDIS_URL, REDIS_EXPIRE, REDIS_REFRESH } from "~/lib/env.server"
|
||||
|
||||
import { REDIS_EXPIRE, REDIS_REFRESH, REDIS_URL } from "~/lib/env.server"
|
||||
|
||||
if (!REDIS_URL) {
|
||||
console.error("REDIS_URL not set")
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
GetServerSidePropsContext,
|
||||
GetServerSideProps,
|
||||
GetServerSidePropsResult,
|
||||
} from "next"
|
||||
import { GetServerSidePropsContext, GetServerSidePropsResult } from "next"
|
||||
|
||||
class Redirect extends Error {
|
||||
constructor(public url: string) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import type { Note as UniNote, Profile as UniProfile } from "unidata.js"
|
||||
import { ReactElement } from "react"
|
||||
import { NoteEntity } from "crossbell.js"
|
||||
import { ReactElement } from "react"
|
||||
import type { Note as UniNote, Profile as UniProfile } from "unidata.js"
|
||||
|
||||
export type Site = {
|
||||
id: string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ConnectKitProviderProps } from "@crossbell/connect-kit"
|
||||
|
||||
import { getNoteSlug, getSiteLink } from "~/lib/helpers"
|
||||
import { CSB_IO } from "~/lib/env"
|
||||
import { getNoteSlug, getSiteLink } from "~/lib/helpers"
|
||||
|
||||
export const urlComposer: ConnectKitProviderProps["urlComposer"] = {
|
||||
characterUrl: ({ handle }) => getSiteLink({ subdomain: handle }),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { test, describe, expect } from "vitest"
|
||||
import { describe, expect, test } from "vitest"
|
||||
|
||||
import { renderPageContent } from "./index"
|
||||
|
||||
describe("html", () => {
|
||||
|
||||
+34
-33
@@ -1,42 +1,43 @@
|
||||
import { unified } from "unified"
|
||||
import remarkParse from "remark-parse"
|
||||
import remarkRehype from "remark-rehype"
|
||||
import remarkFrontmatter from "remark-frontmatter"
|
||||
import rehypeStringify from "rehype-stringify"
|
||||
import remarkGfm from "remark-gfm"
|
||||
import rehypeSanitize from "rehype-sanitize"
|
||||
import rehypeRaw from "rehype-raw"
|
||||
import { refractor } from "refractor"
|
||||
import rehypePrismGenerator from "rehype-prism-plus/generator"
|
||||
import { rehypeImage } from "./rehype-image"
|
||||
import { rehypeAudio } from "./rehype-audio"
|
||||
import { rehypeTable } from "./rehype-table"
|
||||
import { remarkCallout } from "./remark-callout"
|
||||
import { rehypeExternalLink } from "./rehyper-external-link"
|
||||
import { rehypeWrapCode } from "./rehype-wrap-code"
|
||||
import type { Root } from "hast"
|
||||
import jsYaml from "js-yaml"
|
||||
import { Result as TocResult, toc } from "mdast-util-toc"
|
||||
import { ReactElement, createElement } from "react"
|
||||
import { Element } from "react-scroll"
|
||||
import { refractor } from "refractor"
|
||||
import rehypeAutolinkHeadings from "rehype-autolink-headings"
|
||||
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
|
||||
import rehypeKatex from "rehype-katex"
|
||||
import rehypePrismGenerator from "rehype-prism-plus/generator"
|
||||
import rehypeRaw from "rehype-raw"
|
||||
import rehypeReact from "rehype-react"
|
||||
import { createElement, ReactElement } from "react"
|
||||
import { ZoomedImage } from "~/components/ui/Image"
|
||||
import rehypeRewrite from "rehype-rewrite"
|
||||
import rehypeSanitize from "rehype-sanitize"
|
||||
import rehypeSlug from "rehype-slug"
|
||||
import rehypeStringify from "rehype-stringify"
|
||||
import remarkBreaks from "remark-breaks"
|
||||
import remarkDirective from "remark-directive"
|
||||
import remarkDirectiveRehype from "remark-directive-rehype"
|
||||
import remarkFrontmatter from "remark-frontmatter"
|
||||
import remarkGfm from "remark-gfm"
|
||||
import remarkMath from "remark-math"
|
||||
import remarkParse from "remark-parse"
|
||||
import remarkRehype from "remark-rehype"
|
||||
import { unified } from "unified"
|
||||
|
||||
import { APlayer } from "~/components/ui/APlayer"
|
||||
import { ZoomedImage } from "~/components/ui/Image"
|
||||
import { Mention } from "~/components/ui/Mention"
|
||||
import { Mermaid } from "~/components/ui/Mermaid"
|
||||
|
||||
import { rehypeAudio } from "./rehype-audio"
|
||||
import { rehypeImage } from "./rehype-image"
|
||||
import { rehypeTable } from "./rehype-table"
|
||||
import { rehypeWrapCode } from "./rehype-wrap-code"
|
||||
import { rehypeExternalLink } from "./rehyper-external-link"
|
||||
import { remarkCallout } from "./remark-callout"
|
||||
import { remarkMermaid } from "./remark-mermaid"
|
||||
import { remarkYoutube } from "./remark-youtube"
|
||||
import sanitizeScheme from "./sanitize-schema"
|
||||
import rehypeSlug from "rehype-slug"
|
||||
import rehypeAutolinkHeadings from "rehype-autolink-headings"
|
||||
import { toc, Result as TocResult } from "mdast-util-toc"
|
||||
import { Element } from "react-scroll"
|
||||
import type { Root } from "hast"
|
||||
import { Mention } from "~/components/ui/Mention"
|
||||
import remarkMath from "remark-math"
|
||||
import rehypeKatex from "rehype-katex"
|
||||
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
|
||||
import remarkBreaks from "remark-breaks"
|
||||
import { remarkMermaid } from "./remark-mermaid"
|
||||
import { Mermaid } from "~/components/ui/Mermaid"
|
||||
import rehypeRewrite from "rehype-rewrite"
|
||||
import { toText } from "hast-util-to-text"
|
||||
import { APlayer } from "~/components/ui/APlayer"
|
||||
|
||||
export type MarkdownEnv = {
|
||||
excerpt: string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Root } from "rehype-raw"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
|
||||
export const rehypeAudio: Plugin<Array<void>, Root> = () => {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { Root } from "rehype-raw"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
import { getUserContentsUrl } from "~/lib/user-contents"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { MarkdownEnv } from "."
|
||||
|
||||
import { IS_PROD } from "~/lib/constants"
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
import { getUserContentsUrl } from "~/lib/user-contents"
|
||||
|
||||
import { MarkdownEnv } from "."
|
||||
|
||||
const isExternLink = (url: string) => /^https?:\/\//.test(url)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Plugin } from "unified"
|
||||
import { Root } from "rehype-raw"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
|
||||
export const rehypeTable: Plugin<Array<void>, Root> = () => (tree) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Root } from "rehype-raw"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
|
||||
import { toGateway } from "~/lib/ipfs-parser"
|
||||
|
||||
const isExternLink = (url: string) => /^https?:\/\//.test(url)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Plugin } from "unified"
|
||||
import { Root } from "remark-gfm"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
|
||||
const CALLOUT_RE = /^(TIP|WARN|SUCCESS|DANGER):(\n|$)/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Plugin } from "unified"
|
||||
import { Root } from "remark-gfm"
|
||||
import { Plugin } from "unified"
|
||||
import { visit } from "unist-util-visit"
|
||||
|
||||
export const remarkMermaid: Plugin<Array<void>, Root> = () => (tree, file) => {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user