feat: following button in text style
This commit is contained in:
@@ -15,6 +15,7 @@ import { useGetPagesBySite, useDeletePage } from "~/queries/page"
|
||||
import { DotsHorizontalIcon } from "@heroicons/react/solid"
|
||||
import { delStorage } from "~/lib/storage"
|
||||
import { useQueryClient } from "@tanstack/react-query"
|
||||
import { Button } from "../ui/Button"
|
||||
|
||||
export const PagesManager: React.FC<{
|
||||
isPost: boolean
|
||||
@@ -150,13 +151,8 @@ export const PagesManager: React.FC<{
|
||||
<DashboardMain>
|
||||
<header className="mb-8 flex justify-between items-center">
|
||||
<h2 className="text-2xl font-bold">{title}</h2>
|
||||
<button
|
||||
type="button"
|
||||
className={clsx(
|
||||
`space-x-2 px-3 h-9 inline-flex items-center justify-center text-white rounded-lg text-sm`,
|
||||
|
||||
isPost ? `bg-pink-500` : `bg-blue-500`,
|
||||
)}
|
||||
<Button
|
||||
className={clsx(`space-x-2 inline-flex`)}
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/dashboard/${subdomain}/editor?type=${isPost ? "post" : "page"}`,
|
||||
@@ -176,7 +172,7 @@ export const PagesManager: React.FC<{
|
||||
<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>New {isPost ? "Post" : "Page"}</span>
|
||||
</button>
|
||||
</Button>
|
||||
</header>
|
||||
<Tabs items={tabItems} />
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ export const SiteHeader: React.FC<{
|
||||
<div className="mt-3 text-sm">
|
||||
{siteSubscriptions.data ? (
|
||||
<span
|
||||
className="xlog-site-followers mr-2 align-middle text-zinc-500 text-sm cursor-pointer"
|
||||
className="xlog-site-followers align-middle text-zinc-500 text-sm cursor-pointer"
|
||||
onClick={() => setIsFollowListOpen(true)}
|
||||
>
|
||||
<span className="font-bold text-zinc-700">
|
||||
@@ -199,53 +199,37 @@ export const SiteHeader: React.FC<{
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{subscription.data ? (
|
||||
<Button
|
||||
rounded="full"
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
onClick={handleClickSubscribe}
|
||||
className="space-x-1 group align-middle"
|
||||
isLoading={
|
||||
unsubscribeFromSite.isLoading || subscribeToSite.isLoading
|
||||
}
|
||||
>
|
||||
<span className="pl-1">
|
||||
<CrossbellIcon />
|
||||
</span>
|
||||
<span className="pr-1 group-hover:hidden w-16">
|
||||
Following
|
||||
</span>
|
||||
<span className="pr-1 hidden group-hover:block w-16">
|
||||
Unfollow
|
||||
</span>
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
rounded="full"
|
||||
size="sm"
|
||||
variant="crossbell"
|
||||
onClick={handleClickSubscribe}
|
||||
className="space-x-1 align-middle"
|
||||
isLoading={
|
||||
userSite.isLoading ||
|
||||
unsubscribeFromSite.isLoading ||
|
||||
subscribeToSite.isLoading ||
|
||||
subscription.isLoading
|
||||
}
|
||||
>
|
||||
<span className="pl-1">
|
||||
<CrossbellIcon />
|
||||
</span>
|
||||
<Button
|
||||
variant="text"
|
||||
onClick={handleClickSubscribe}
|
||||
className="space-x-1 group align-middle text-theme-color mx-5"
|
||||
isLoading={
|
||||
subscription.data
|
||||
? unsubscribeFromSite.isLoading ||
|
||||
subscribeToSite.isLoading
|
||||
: userSite.isLoading ||
|
||||
unsubscribeFromSite.isLoading ||
|
||||
subscribeToSite.isLoading ||
|
||||
subscription.isLoading
|
||||
}
|
||||
>
|
||||
<span className="i-bxs:bell"></span>
|
||||
{subscription.data ? (
|
||||
<>
|
||||
<span className="pr-1 group-hover:hidden w-16">
|
||||
Following
|
||||
</span>
|
||||
<span className="pr-1 hidden group-hover:block w-16">
|
||||
Unfollow
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<span className="pr-1">Follow</span>
|
||||
</Button>
|
||||
)}
|
||||
)}
|
||||
</Button>
|
||||
<div className="relative inline-block align-middle h-7 group">
|
||||
<Button
|
||||
rounded="full"
|
||||
size="sm"
|
||||
variant="secondary"
|
||||
className="ml-2"
|
||||
variant="text"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
}}
|
||||
|
||||
@@ -94,6 +94,7 @@ body {
|
||||
|
||||
.button.is-text {
|
||||
@apply shadow-none p-0;
|
||||
@apply min-w-0;
|
||||
}
|
||||
|
||||
.button.is-like {
|
||||
|
||||
+4
-2
@@ -116,8 +116,10 @@ export default function Home({ region }: { region: string | null }) {
|
||||
<h2 className="text-3xl sm:text-5xl font-bold mb-5">Blog Free</h2>
|
||||
<h3 className="mt-5 text-zinc-800 text-4xl sm:text-6xl font-light">
|
||||
{APP_NAME}, an on-chain and{" "}
|
||||
<UniLink href={GITHUB_LINK}>open-source</UniLink> blogging
|
||||
platform for everyone.
|
||||
<UniLink className="underline decoration-2" href={GITHUB_LINK}>
|
||||
open-source
|
||||
</UniLink>{" "}
|
||||
blogging platform for everyone.
|
||||
</h3>
|
||||
<div className="my-10 sm:my-16">
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user