From 6bdf6790a38b8a15152f03e423919cdb44666a7f Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 28 Jul 2022 01:26:13 +0100 Subject: [PATCH] feat: subscribe buttom --- src/components/common/ConnectButton.tsx | 2 +- src/components/icons/Crossbell.tsx | 9 ++++++ src/components/icons/RSS3.tsx | 9 ++++++ src/components/site/SiteHeader.tsx | 37 +++++++++++++++++++++++-- src/components/ui/Button.tsx | 2 +- src/css/tailwind.css | 12 ++++++++ src/pages/dashboard/index.tsx | 2 +- 7 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 src/components/icons/Crossbell.tsx create mode 100644 src/components/icons/RSS3.tsx diff --git a/src/components/common/ConnectButton.tsx b/src/components/common/ConnectButton.tsx index 865a4a37..130db6c8 100644 --- a/src/components/common/ConnectButton.tsx +++ b/src/components/common/ConnectButton.tsx @@ -72,7 +72,7 @@ export const ConnectButton: React.FC<{ {(() => { if (!mounted || !account || !chain) { return ( - ); diff --git a/src/components/icons/Crossbell.tsx b/src/components/icons/Crossbell.tsx new file mode 100644 index 00000000..f8cbd533 --- /dev/null +++ b/src/components/icons/Crossbell.tsx @@ -0,0 +1,9 @@ +import React from "react" + +export const CrossbellIcon: React.FC> = ( + props +) => { + return ( + + ) +} diff --git a/src/components/icons/RSS3.tsx b/src/components/icons/RSS3.tsx new file mode 100644 index 00000000..be3ab76f --- /dev/null +++ b/src/components/icons/RSS3.tsx @@ -0,0 +1,9 @@ +import React from "react" + +export const RSS3Icon: React.FC> = ( + props +) => { + return ( + + ) +} diff --git a/src/components/site/SiteHeader.tsx b/src/components/site/SiteHeader.tsx index 531d5fb2..8ee60dc5 100644 --- a/src/components/site/SiteHeader.tsx +++ b/src/components/site/SiteHeader.tsx @@ -13,6 +13,9 @@ import { Button } from "../ui/Button" import { UniLink } from "../ui/UniLink" import { Profile } from "unidata.js" import { ConnectButton } from "../common/ConnectButton" +import { RSS3Icon } from "../icons/RSS3" +import { CrossbellIcon } from "../icons/Crossbell" +import { useAccount } from "wagmi" export type HeaderLinkType = { icon?: React.ReactNode @@ -45,12 +48,12 @@ export const SiteHeader: React.FC<{ icon: string | null | undefined navigation?: HeaderLinkType[] subscribed?: boolean - viewer?: Profile | null -}> = ({ siteName, description, icon, navigation, subscribed, viewer }) => { +}> = ({ siteName, description, icon, navigation, subscribed }) => { const setSubscribeModalOpened = useStore( (store) => store.setSubscribeModalOpened, ) const setLoginModalOpened = useStore((store) => store.setLoginModalOpened) + const { data: viewer } = useAccount() const handleClickSubscribe = () => { setSubscribeModalOpened(true) @@ -78,6 +81,36 @@ export const SiteHeader: React.FC<{ {description && (
{description}
)} +
+ + +
diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index 38e3e3bc..f085aea0 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -12,7 +12,7 @@ type ButtonProps = { isBlock?: boolean isDisabled?: boolean isAutoWidth?: boolean - variant?: "primary" | "secondary" | "text" + variant?: "primary" | "secondary" | "text" | "rss3" | "crossbell" variantColor?: "green" | "red" | "gray" size?: "sm" rounded?: "full" | "lg" diff --git a/src/css/tailwind.css b/src/css/tailwind.css index defbb692..cb12f41c 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -72,6 +72,18 @@ body { @apply text-gray-500; } +.button.is-rss3 { + background-color: #e7f1ff; + fill: #1064ff; + color: #1064ff; +} + +.button.is-crossbell { + background-color: #fff5e1; + fill: #e5b65a; + color: #e5b65a; +} + .button.is-text { @apply shadow-none; @apply text-gray-500; diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index f1833ce9..198f6016 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -19,5 +19,5 @@ export default function Dashboard() { } }, [userSites, router]) - return
Loading...
+ return
Loading...
}