From 10d5e06d8ffc8569fcfb680dc8bc216703989c65 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 7 Aug 2022 19:26:25 +0100 Subject: [PATCH] feat: change blockchain info position --- package.json | 1 + pnpm-lock.yaml | 10 ++ src/components/common/BlockchainInfo.tsx | 140 +++++++++++++++++++++++ src/components/site/SiteFooter.tsx | 108 +---------------- src/components/site/SiteLayout.tsx | 6 +- 5 files changed, 156 insertions(+), 109 deletions(-) create mode 100644 src/components/common/BlockchainInfo.tsx diff --git a/package.json b/package.json index 8ea76dfa..9097b65e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@codemirror/view": "^0.20.3", "@floating-ui/react-dom-interactions": "^0.6.3", "@headlessui/react": "^1.6.0", + "@heroicons/react": "^1.0.6", "@prisma/client": "^3.14.0", "@proselog/jwt": "^0.1.1", "@rainbow-me/rainbowkit": "^0.4.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3ea7f71..01407419 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,7 @@ specifiers: '@codemirror/view': ^0.20.3 '@floating-ui/react-dom-interactions': ^0.6.3 '@headlessui/react': ^1.6.0 + '@heroicons/react': ^1.0.6 '@iconify-json/bi': ^1.1.3 '@iconify-json/bxs': ^1.1.2 '@iconify-json/carbon': ^1.1.5 @@ -109,6 +110,7 @@ dependencies: '@codemirror/view': 0.20.7 '@floating-ui/react-dom-interactions': 0.6.6_twyhzqqpkwvvgrmyeapdo6i4my '@headlessui/react': 1.6.5_biqbaboplfbrettd7655fr4n2y + '@heroicons/react': 1.0.6_react@18.2.0 '@prisma/client': 3.15.2_prisma@3.15.2 '@proselog/jwt': 0.1.1 '@rainbow-me/rainbowkit': 0.4.5_aka5rz2z3n4fmzij3aevaifnqm @@ -1010,6 +1012,14 @@ packages: react-dom: 18.2.0_react@18.2.0 dev: false + /@heroicons/react/1.0.6_react@18.2.0: + resolution: {integrity: sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ==} + peerDependencies: + react: '>= 16' + dependencies: + react: 18.2.0 + dev: false + /@humanwhocodes/config-array/0.9.5: resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==} engines: {node: '>=10.10.0'} diff --git a/src/components/common/BlockchainInfo.tsx b/src/components/common/BlockchainInfo.tsx new file mode 100644 index 00000000..7627725f --- /dev/null +++ b/src/components/common/BlockchainInfo.tsx @@ -0,0 +1,140 @@ +import { APP_NAME, OUR_DOMAIN } from "~/lib/env" +import { UniLink } from "../ui/UniLink" +import { Profile, Note } from "~/lib/types" +import { Disclosure } from "@headlessui/react" +import { ChevronUpIcon } from "@heroicons/react/solid" + +export const BlockchainInfo: React.FC<{ + site?: Profile + page?: Note +}> = ({ site, page }) => { + return ( +
+ + {({ open }: { open: boolean }) => ( + <> + + + 🔔 This{" "} + {page + ? page.tags?.includes("post") + ? "post" + : "page" + : "blog"}{" "} + has been permanently stored on the blockchain and signed by its + creator. + + + + + + + + )} + +
+ ) +} diff --git a/src/components/site/SiteFooter.tsx b/src/components/site/SiteFooter.tsx index 729987ca..75c9bb13 100644 --- a/src/components/site/SiteFooter.tsx +++ b/src/components/site/SiteFooter.tsx @@ -1,8 +1,5 @@ import { APP_NAME, OUR_DOMAIN } from "~/lib/env" import { UniLink } from "../ui/UniLink" -import { IS_PROD } from "~/lib/constants" -import { useAccount } from "wagmi" -import { useEffect, useState } from "react" import { Profile, Note } from "~/lib/types" export const SiteFooter: React.FC<{ @@ -12,110 +9,7 @@ export const SiteFooter: React.FC<{ return (