From b03599a508d2e136e1d3ba80d6e45a74735c5679 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Mon, 11 Dec 2023 03:16:23 -0300 Subject: [PATCH 01/18] Add tbtc sdk template and content --- .gitignore | 2 +- src/components/Card/index.tsx | 8 + src/components/HighlightWord.tsx | 3 +- src/content/pages/build/index.md | 5 + src/content/pages/build/tbtc-sdk.md | 73 ++++ src/templates/build-page/index.tsx | 7 + .../build-page/tbtc-sdk/FeaturesSection.tsx | 60 +++ .../build-page/tbtc-sdk/UseCases.tsx | 113 ++++++ src/templates/build-page/tbtc-sdk/index.tsx | 172 ++++++++ src/templates/home-page/SectionTemplate.tsx | 13 +- static/admin/config.yml | 369 ++++++++++++++++++ static/images/cross-chain-applications.svg | 5 + static/images/decentralized-finance.svg | 5 + static/images/gradient-box-icon.svg | 9 + static/images/payment-solutions.svg | 6 + static/images/tbtc-sdk.svg | 77 ++++ 16 files changed, 919 insertions(+), 8 deletions(-) create mode 100644 src/content/pages/build/index.md create mode 100644 src/content/pages/build/tbtc-sdk.md create mode 100644 src/templates/build-page/index.tsx create mode 100644 src/templates/build-page/tbtc-sdk/FeaturesSection.tsx create mode 100644 src/templates/build-page/tbtc-sdk/UseCases.tsx create mode 100644 src/templates/build-page/tbtc-sdk/index.tsx create mode 100644 static/images/cross-chain-applications.svg create mode 100644 static/images/decentralized-finance.svg create mode 100644 static/images/gradient-box-icon.svg create mode 100644 static/images/payment-solutions.svg create mode 100644 static/images/tbtc-sdk.svg diff --git a/.gitignore b/.gitignore index dfad251b..088abda1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ .eslintcache # Generated -build/ +/build/ dist/ # Yarn diff --git a/src/components/Card/index.tsx b/src/components/Card/index.tsx index 756d68e6..d4478005 100644 --- a/src/components/Card/index.tsx +++ b/src/components/Card/index.tsx @@ -10,6 +10,7 @@ import { FC } from "react" import { BodyLg, BodySm, LabelSm } from "../Typography" type CardComponent

= FC

& { + PreTitle: FC Title: FC SubTitle: FC Divider: FC @@ -21,6 +22,12 @@ const Card: CardComponent = (props) => { return } +const PreTitle: FC = ({ children, ...textProps }) => ( + + {children} + +) + const Title: FC = ({ children, ...textProps }) => ( {children} ) @@ -39,6 +46,7 @@ const Divider = ({ ...dividerProps }) => { return } +Card.PreTitle = PreTitle Card.Title = Title Card.SubTitle = SubTitle Card.Body = Body diff --git a/src/components/HighlightWord.tsx b/src/components/HighlightWord.tsx index 8cb076f3..cafa707e 100644 --- a/src/components/HighlightWord.tsx +++ b/src/components/HighlightWord.tsx @@ -1,6 +1,5 @@ import React, { FC } from "react" -import { RoleTemplateProps } from "../templates/home-page/SectionTemplate" -import { BoxProps, Text } from "@chakra-ui/react" +import { Box, BoxProps, Text } from "@chakra-ui/react" export interface HighlightWordProps extends BoxProps { title: string diff --git a/src/content/pages/build/index.md b/src/content/pages/build/index.md new file mode 100644 index 00000000..27561e02 --- /dev/null +++ b/src/content/pages/build/index.md @@ -0,0 +1,5 @@ +--- +template: build-page +path: /build +title: Build +--- diff --git a/src/content/pages/build/tbtc-sdk.md b/src/content/pages/build/tbtc-sdk.md new file mode 100644 index 00000000..a6c36c80 --- /dev/null +++ b/src/content/pages/build/tbtc-sdk.md @@ -0,0 +1,73 @@ +--- +template: build-page/tbtc-sdk +path: build-page/tbtc-sdk +title: SDK Page +seo: + - title: tBTC SDK +sdkInfo: + title: "tBTC SDK: Supercharge Your Project with Bitcoin" + highlightedWord: "tBTC SDK:" + description: "Unlock the power of blockchain – The ultimate toolkit for harnessing Bitcoin's potential." + image: /images/tbtc-sdk.svg + buttons: + - label: Go To Docs + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk + variant: EXTERNAL_OUTLINE + rowReverse: false +useCasesInfo: + preTitle: Explore + title: Use Cases + description: "How tBTC SDK Unlocks Bitcoin’s Versatility in Blockchain Projects." + rowReverse: false +useCases: + - image: /images/decentralized-finance.svg + preTitle: Explore + title: Decentralized Finance + description: Make your DeFi application Bitcoin-compatible to boost liquidity and market options. + buttons: + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ + variant: EXTERNAL_OUTLINE + - image: /images/cross-chain-applications.svg + preTitle: Explore + title: Cross-Chain Applications + description: Build apps that use Bitcoin's power across different blockchains, offering more flexibility and reach. + buttons: + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ + variant: EXTERNAL_OUTLINE + - image: /images/payment-solutions.svg + preTitle: Explore + title: Payment Solutions + description: Add Bitcoin to your blockchain platforms for wider payment options and to attract more users. + buttons: + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ + variant: EXTERNAL_OUTLINE +featuresInfo: + preTitle: Features + title: Key Features + description: "Explore tBTC SDK's core features for seamless Bitcoin integration." + image: /images/ecosystem-grid.svg + buttons: + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/architecture + variant: EXTERNAL_OUTLINE + rowReverse: false + icon: /images/gradient-box-icon.svg +features: + - title: Seamless Integration + description: TypeScript library enables the inclusion of Bitcoin into a range of blockchain environments. + - title: Streamlined Features + description: Simplifies Bitcoin deposits, mints, redemptions, focusing on innovation, not complexity. + - title: Adaptable Architecture + description: With shared libraries, the SDK smooth interactions between Bitcoin and multiple chains. +callToActionInfo: + title: Get Started Today + description: "Join our community and explore the endless possibilities with tBTC SDK." + rowReverse: false + buttons: + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ + variant: EXTERNAL_OUTLINE +--- diff --git a/src/templates/build-page/index.tsx b/src/templates/build-page/index.tsx new file mode 100644 index 00000000..960ca1e0 --- /dev/null +++ b/src/templates/build-page/index.tsx @@ -0,0 +1,7 @@ +import { FC } from "react" + +const BuildPageTemplate: FC = () => { + return <> +} + +export default BuildPageTemplate diff --git a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx new file mode 100644 index 00000000..a23c4b0c --- /dev/null +++ b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx @@ -0,0 +1,60 @@ +import { FC } from "react" +import { SimpleGrid, Stack } from "@chakra-ui/react" +import Card from "../../../components/Card" +import { BodyMd, H6, Image, ImageProps } from "../../../components" + +export interface FeaturesSectionProps { + cards: FeatureCardProps[] + icon: ImageProps +} + +export interface FeatureCardProps { + title: string + description: string + isBigSize?: boolean +} + +const FeatureCard: FC = ({ + icon, + title, + description, +}) => { + return ( + + + + +

{title}
+ + + + {description} + + + + ) +} + +const FeaturesSection: FC = ({ + cards, + icon, +}: FeaturesSectionProps) => { + return ( + <> + + {cards.map((resource: any, i) => ( + + ))} + + + ) +} + +export default FeaturesSection diff --git a/src/templates/build-page/tbtc-sdk/UseCases.tsx b/src/templates/build-page/tbtc-sdk/UseCases.tsx new file mode 100644 index 00000000..68ae098b --- /dev/null +++ b/src/templates/build-page/tbtc-sdk/UseCases.tsx @@ -0,0 +1,113 @@ +import { FC, useRef, useState } from "react" +import { Box, Button, SimpleGrid, Stack, Flex } from "@chakra-ui/react" +import Card from "../../../components/Card" +import ExternalButtonLink from "../../../components/Buttons/ExternalButtonLink" +import { ExternalLinkHref } from "../../../components/Navbar/types" +import { Image, ImageProps } from "../../../components" + +export interface CardButton { + label: string + url: string + variant: string +} + +export interface CardCategory { + label: string +} + +export interface UseCasesCardProps { + image: ImageProps + preTitle: string + title: string + description: string + categories: CardCategory[] + timestamp: number + buttons: CardButton[] +} + +const UseCasesCard: FC = ({ + image, + preTitle, + title, + description, + buttons, +}) => { + const [isHovered, setIsHovered] = useState(false) + const cardRef = useRef(null) + + return ( + + setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + rounded="2xl" + p="2px" + bgGradient={ + isHovered + ? "linear-gradient(180deg, rgba(189,48,255,0) 0%, rgba(125,0,255,1) 100%)" + : "none" + } + > + + + + {preTitle} + + + + + {title} + + + + {description} + + + {buttons.map((button: CardButton, i) => ( + + {button.label} + + ))} + + + + + + ) +} + +const UseCases: FC<{ cards: UseCasesCardProps[] }> = ({ cards }) => { + return ( + + {cards.map((card: any, i) => ( + + ))} + + ) +} + +export default UseCases diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx new file mode 100644 index 00000000..1c38e52d --- /dev/null +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -0,0 +1,172 @@ +import { FC } from "react" +import { graphql } from "gatsby" +import SectionTemplate from "../../home-page/SectionTemplate" +import { Box, Divider } from "@chakra-ui/react" +import UseCases from "./UseCases" +import FeaturesSection from "./FeaturesSection" +import { HighlightWord } from "../../../components/HighlightWord" + +const SDKTitle: FC = ({ sdkInfo }: any) => ( + + + +) + +const SDKPageTemplate: FC = ({ data }: any) => { + const { + sdkInfo, + useCasesInfo, + useCases, + featuresInfo, + features, + callToActionInfo, + } = data.markdownRemark.frontmatter + + return ( + + } + preTitle={null} + columnReverse + size="sm" + > + + + + + + + + + + + ) +} + +export default SDKPageTemplate + +export const query = graphql` + query SDKPage($id: String!) { + markdownRemark(id: { eq: $id }) { + id + frontmatter { + sdkInfo { + rowReverse + title + highlightedWord + description + image { + id + relativePath + internal { + mediaType + } + childImageSharp { + gatsbyImageData(width: 200) + } + } + buttons { + label + url + variant + } + } + useCasesInfo { + rowReverse + preTitle + title + description + } + useCases { + image { + id + relativePath + internal { + mediaType + } + childImageSharp { + gatsbyImageData(width: 200) + } + } + preTitle + title + description + buttons { + label + url + variant + } + } + featuresInfo { + rowReverse + preTitle + title + description + image { + id + relativePath + internal { + mediaType + } + childImageSharp { + gatsbyImageData(width: 200) + } + } + icon { + id + relativePath + internal { + mediaType + } + childImageSharp { + gatsbyImageData(width: 200) + } + } + buttons { + label + url + variant + } + } + features { + title + description + } + callToActionInfo { + rowReverse + title + description + buttons { + label + url + variant + } + } + } + } + } +` diff --git a/src/templates/home-page/SectionTemplate.tsx b/src/templates/home-page/SectionTemplate.tsx index 4eb085f3..9987e5fc 100644 --- a/src/templates/home-page/SectionTemplate.tsx +++ b/src/templates/home-page/SectionTemplate.tsx @@ -25,10 +25,9 @@ export interface FooterButton { export interface RoleTemplateProps extends OmittedBoxProps { bgColor: string - title: string | JSX.Element + title: string | JSX.Element | FC description: string buttons: FooterButton[] - highlightedWord?: string image?: ImageProps rowReverse?: boolean size?: "sm" | "md" @@ -40,7 +39,6 @@ export interface RoleTemplateProps extends OmittedBoxProps { const SectionTemplate: FC = ({ title, - highlightedWord, description, buttons = [], image, @@ -63,7 +61,7 @@ const SectionTemplate: FC = ({ rowReverse={rowReverse} columnReverse={columnReverse} spacing={16} - justifyContent={isCentered ? "center" : undefined} + justifyContent={isCentered ? "center" : "space-between"} textAlign={isCentered ? "center" : undefined} > @@ -82,7 +80,12 @@ const SectionTemplate: FC = ({ {description} )} - + {buttons.map((_: FooterButton, i) => { return ( diff --git a/static/admin/config.yml b/static/admin/config.yml index 555c051c..c5cd0799 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -2412,6 +2412,375 @@ collections: { label: "URL", name: "url", widget: "string" }, ], } + # SDK Page + - file: "src/content/pages/build/tbtc-sdk.md" + name: "sdkPage" + label: "tBTC SDK Page" + fields: + - { + label: "Template", + name: "template", + widget: "hidden", + default: "build-page/sdk-page", + } + - { + label: "Path", + name: "path", + widget: "hidden", + default: "/build/tbtc-sdk", + } + - { + label: "SEO Title", + name: "seoTitle", + widget: "string", + hint: "SEO title", + required: false, + } + - { + label: "SEO Description", + name: "seoDescription", + widget: "string", + hint: "SEO description", + required: false, + } + - { + label: "Hero Section", + name: "sdkInfo", + widget: "object", + collapsed: true, + fields: + [ + { + label: "Row Reverse", + name: "rowReverse", + widget: boolean, + required: false, + default: false, + }, + { + label: "Title", + name: "title", + widget: "string", + minimal: true, + }, + { + label: "Highlighted Word", + name: "highlightedWord", + widget: "string", + minimal: true, + }, + { + label: "Description", + name: "description", + widget: "string", + required: false, + }, + { + label: "Image", + name: "image", + widget: file, + media_library: { config: { multiple: false } }, + }, + { + label: "Buttons", + name: "buttons", + widget: "list", + allow_add: true, + required: false, + fields: + [ + { label: Label, name: label, widget: string }, + { label: URL, name: url, widget: string }, + { + label: Variant, + name: variant, + widget: select, + required: true, + options: + [ + { + label: "External Solid", + value: "EXTERNAL_SOLID", + }, + { + label: "Internal Solid", + value: "INTERNAL_SOLID", + }, + { + label: "External Outline", + value: "EXTERNAL_OUTLINE", + }, + { + label: "Internal Outline", + value: "INTERNAL_OUTLINE", + }, + ], + }, + ], + }, + ], + } + - { + label: "Use Cases Section", + name: "useCasesInfo", + widget: "object", + collapsed: true, + fields: + [ + { + label: "Row Reverse", + name: "rowReverse", + widget: boolean, + required: false, + default: false, + }, + { + label: "Pre Title", + name: "preTitle", + widget: "string", + minimal: true, + }, + { + label: "Title", + name: "title", + widget: "string", + minimal: true, + }, + { + label: "Description", + name: "description", + widget: "string", + required: false, + }, + ], + } + - { + label: "Use Cases Card", + name: "useCases", + widget: "list", + allow_add: true, + fields: + [ + { + label: "Image", + name: "image", + widget: file, + media_library: { config: { multiple: false } }, + }, + { label: "Title", name: "title", widget: "string" }, + { + label: "Description", + name: "description", + widget: "string", + }, + { + label: "Buttons", + name: "buttons", + widget: "list", + allow_add: true, + required: false, + fields: + [ + { label: Label, name: label, widget: string }, + { label: URL, name: url, widget: string }, + { + label: Variant, + name: variant, + widget: select, + required: true, + options: + [ + { + label: "External Solid", + value: "EXTERNAL_SOLID", + }, + { + label: "Internal Solid", + value: "INTERNAL_SOLID", + }, + { + label: "External Outline", + value: "EXTERNAL_OUTLINE", + }, + { + label: "Internal Outline", + value: "INTERNAL_OUTLINE", + }, + ], + }, + ], + }, + ], + } + - { + label: "Features Section", + name: "featuresInfo", + widget: "object", + collapsed: true, + fields: + [ + { + label: "Row Reverse", + name: "rowReverse", + widget: boolean, + required: false, + default: false, + }, + { + label: "Pre Title", + name: "preTitle", + widget: "string", + minimal: true, + }, + { + label: "Title", + name: "title", + widget: "string", + minimal: true, + }, + { + label: "Description", + name: "description", + widget: "string", + required: false, + }, + { + label: "Image", + name: "image", + widget: file, + media_library: { config: { multiple: false } }, + }, + { + label: "Icon", + name: "icon", + widget: file, + media_library: { config: { multiple: false } }, + }, + { + label: "Buttons", + name: "buttons", + widget: "list", + allow_add: true, + required: false, + fields: + [ + { label: Label, name: label, widget: string }, + { label: URL, name: url, widget: string }, + { + label: Variant, + name: variant, + widget: select, + required: true, + options: + [ + { + label: "External Solid", + value: "EXTERNAL_SOLID", + }, + { + label: "Internal Solid", + value: "INTERNAL_SOLID", + }, + { + label: "External Outline", + value: "EXTERNAL_OUTLINE", + }, + { + label: "Internal Outline", + value: "INTERNAL_OUTLINE", + }, + ], + }, + ], + }, + ], + } + - { + label: "Features Card", + name: "features", + widget: "list", + allow_add: true, + fields: + [ + { + label: "Pre Title", + name: "preTitle", + widget: "string", + minimal: true, + }, + { label: "Title", name: "title", widget: "string" }, + { + label: "Description", + name: "description", + widget: "string", + }, + ], + } + - { + label: "Call To Action Section", + name: "callToActionInfo", + widget: "object", + collapsed: true, + fields: + [ + { + label: "Row Reverse", + name: "rowReverse", + widget: boolean, + required: false, + default: false, + }, + { + label: "Title", + name: "title", + widget: "string", + minimal: true, + }, + { + label: "Description", + name: "description", + widget: "string", + required: false, + }, + { + label: "Buttons", + name: "buttons", + widget: "list", + allow_add: true, + required: false, + fields: + [ + { label: Label, name: label, widget: string }, + { label: URL, name: url, widget: string }, + { + label: Variant, + name: variant, + widget: select, + required: true, + options: + [ + { + label: "External Solid", + value: "EXTERNAL_SOLID", + }, + { + label: "Internal Solid", + value: "INTERNAL_SOLID", + }, + { + label: "External Outline", + value: "EXTERNAL_OUTLINE", + }, + { + label: "Internal Outline", + value: "INTERNAL_OUTLINE", + }, + ], + }, + ], + }, + ], + } # Governance Page - file: "src/content/pages/governance/index.md" name: "governancePage" diff --git a/static/images/cross-chain-applications.svg b/static/images/cross-chain-applications.svg new file mode 100644 index 00000000..7f11dbed --- /dev/null +++ b/static/images/cross-chain-applications.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/images/decentralized-finance.svg b/static/images/decentralized-finance.svg new file mode 100644 index 00000000..db57a394 --- /dev/null +++ b/static/images/decentralized-finance.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/images/gradient-box-icon.svg b/static/images/gradient-box-icon.svg new file mode 100644 index 00000000..b15da47f --- /dev/null +++ b/static/images/gradient-box-icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/images/payment-solutions.svg b/static/images/payment-solutions.svg new file mode 100644 index 00000000..fafb09c0 --- /dev/null +++ b/static/images/payment-solutions.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/static/images/tbtc-sdk.svg b/static/images/tbtc-sdk.svg new file mode 100644 index 00000000..140c5517 --- /dev/null +++ b/static/images/tbtc-sdk.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5a7ff4c95bd5cf7cf8c434e5ffc9575ba180d9ee Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Mon, 11 Dec 2023 03:18:23 -0300 Subject: [PATCH 02/18] Fix integration component margin --- src/components/IntegrationCard.tsx | 1 - src/content/pages/build/tbtc-sdk.md | 8 ++++---- static/admin/config.yml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/IntegrationCard.tsx b/src/components/IntegrationCard.tsx index da6463b0..834ac24b 100644 --- a/src/components/IntegrationCard.tsx +++ b/src/components/IntegrationCard.tsx @@ -101,7 +101,6 @@ export const IntegrationsCardGroup: FC<{ cards: IntegrationCardProps[] }> = ({ spacing={cardSpacing} overflowX="hidden" py={20} - mb={-28} position="relative" > {cardSet.map((card: IntegrationCardProps, i) => ( diff --git a/src/content/pages/build/tbtc-sdk.md b/src/content/pages/build/tbtc-sdk.md index a6c36c80..df0e43c3 100644 --- a/src/content/pages/build/tbtc-sdk.md +++ b/src/content/pages/build/tbtc-sdk.md @@ -2,7 +2,7 @@ template: build-page/tbtc-sdk path: build-page/tbtc-sdk title: SDK Page -seo: +seo: - title: tBTC SDK sdkInfo: title: "tBTC SDK: Supercharge Your Project with Bitcoin" @@ -67,7 +67,7 @@ callToActionInfo: description: "Join our community and explore the endless possibilities with tBTC SDK." rowReverse: false buttons: - - label: Learn More - url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ - variant: EXTERNAL_OUTLINE + - label: Learn More + url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ + variant: EXTERNAL_OUTLINE --- diff --git a/static/admin/config.yml b/static/admin/config.yml index c5cd0799..b8bf527a 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -2780,7 +2780,7 @@ collections: ], }, ], - } + } # Governance Page - file: "src/content/pages/governance/index.md" name: "governancePage" From 727d526f00b41646e2ac3299ac161eb000609c48 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Mon, 11 Dec 2023 03:34:31 -0300 Subject: [PATCH 03/18] Add margin to tbtc sdk divider --- src/templates/build-page/tbtc-sdk/UseCases.tsx | 2 +- src/templates/build-page/tbtc-sdk/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/build-page/tbtc-sdk/UseCases.tsx b/src/templates/build-page/tbtc-sdk/UseCases.tsx index 68ae098b..15fad1f2 100644 --- a/src/templates/build-page/tbtc-sdk/UseCases.tsx +++ b/src/templates/build-page/tbtc-sdk/UseCases.tsx @@ -66,7 +66,7 @@ const UseCasesCard: FC = ({ {preTitle} - + {title} diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx index 1c38e52d..ac7a8588 100644 --- a/src/templates/build-page/tbtc-sdk/index.tsx +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -36,7 +36,7 @@ const SDKPageTemplate: FC = ({ data }: any) => { columnReverse size="sm" > - + Date: Tue, 12 Dec 2023 21:42:58 -0300 Subject: [PATCH 04/18] Refactor tbtc sdk page buttons --- src/content/pages/build/tbtc-sdk.md | 11 +++--- .../build-page/tbtc-sdk/FeaturesSection.tsx | 2 +- src/templates/build-page/tbtc-sdk/index.tsx | 5 --- static/admin/config.yml | 37 ------------------- 4 files changed, 6 insertions(+), 49 deletions(-) diff --git a/src/content/pages/build/tbtc-sdk.md b/src/content/pages/build/tbtc-sdk.md index df0e43c3..3f0e8dc5 100644 --- a/src/content/pages/build/tbtc-sdk.md +++ b/src/content/pages/build/tbtc-sdk.md @@ -11,8 +11,8 @@ sdkInfo: image: /images/tbtc-sdk.svg buttons: - label: Go To Docs - url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk - variant: EXTERNAL_OUTLINE + url: https://blog.threshold.network/harnessing-the-tbtc-sdk-empowering-your-projects-with-bitcoin/ + variant: EXTERNAL_SOLID rowReverse: false useCasesInfo: preTitle: Explore @@ -49,10 +49,6 @@ featuresInfo: title: Key Features description: "Explore tBTC SDK's core features for seamless Bitcoin integration." image: /images/ecosystem-grid.svg - buttons: - - label: Learn More - url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/architecture - variant: EXTERNAL_OUTLINE rowReverse: false icon: /images/gradient-box-icon.svg features: @@ -70,4 +66,7 @@ callToActionInfo: - label: Learn More url: https://docs.threshold.network/app-development/tbtc-v2/tbtc-sdk/ variant: EXTERNAL_OUTLINE + - label: Join Discord + url: https://discord.gg/threshold + variant: EXTERNAL_OUTLINE --- diff --git a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx index a23c4b0c..d5f3451e 100644 --- a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx +++ b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx @@ -48,7 +48,7 @@ const FeaturesSection: FC = ({ }: FeaturesSectionProps) => { return ( <> - + {cards.map((resource: any, i) => ( ))} diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx index ac7a8588..64f7cf27 100644 --- a/src/templates/build-page/tbtc-sdk/index.tsx +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -146,11 +146,6 @@ export const query = graphql` gatsbyImageData(width: 200) } } - buttons { - label - url - variant - } } features { title diff --git a/static/admin/config.yml b/static/admin/config.yml index b8bf527a..64bb9d49 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -2656,43 +2656,6 @@ collections: widget: file, media_library: { config: { multiple: false } }, }, - { - label: "Buttons", - name: "buttons", - widget: "list", - allow_add: true, - required: false, - fields: - [ - { label: Label, name: label, widget: string }, - { label: URL, name: url, widget: string }, - { - label: Variant, - name: variant, - widget: select, - required: true, - options: - [ - { - label: "External Solid", - value: "EXTERNAL_SOLID", - }, - { - label: "Internal Solid", - value: "INTERNAL_SOLID", - }, - { - label: "External Outline", - value: "EXTERNAL_OUTLINE", - }, - { - label: "Internal Outline", - value: "INTERNAL_OUTLINE", - }, - ], - }, - ], - }, ], } - { From 354fdc508dca638e67ed52b4be42ab8fc05b2953 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Wed, 13 Dec 2023 01:45:01 -0300 Subject: [PATCH 05/18] Fix tbtc sdk md content --- src/content/pages/build/tbtc-sdk.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/pages/build/tbtc-sdk.md b/src/content/pages/build/tbtc-sdk.md index 3f0e8dc5..c65f166d 100644 --- a/src/content/pages/build/tbtc-sdk.md +++ b/src/content/pages/build/tbtc-sdk.md @@ -1,16 +1,16 @@ --- template: build-page/tbtc-sdk -path: build-page/tbtc-sdk +path: /build/tbtc-sdk title: SDK Page -seo: - - title: tBTC SDK +seoTitle: Threshold tBTC SDK +seoDescription: "Develop applications using tBTC SDK, and leverage the Bitcoins strength across various blockchains, enhancing user flexibility and market reach" sdkInfo: title: "tBTC SDK: Supercharge Your Project with Bitcoin" highlightedWord: "tBTC SDK:" description: "Unlock the power of blockchain – The ultimate toolkit for harnessing Bitcoin's potential." image: /images/tbtc-sdk.svg buttons: - - label: Go To Docs + - label: Learn More url: https://blog.threshold.network/harnessing-the-tbtc-sdk-empowering-your-projects-with-bitcoin/ variant: EXTERNAL_SOLID rowReverse: false From d681d1ec941e01b2464f49b6c1c28c309ea8a8fd Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Wed, 13 Dec 2023 01:46:18 -0300 Subject: [PATCH 06/18] Refactor nav bar menu content --- src/content/components/nav-bar.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/content/components/nav-bar.md b/src/content/components/nav-bar.md index c9f72663..f5295c1c 100644 --- a/src/content/components/nav-bar.md +++ b/src/content/components/nav-bar.md @@ -12,22 +12,25 @@ nav_items: url: /earn/btc - label: Token Holder url: /earn/token-holder + - label: Build + isExternal: false + subitems: + - label: tBTC SDK + url: /build/tbtc-sdk + - label: Docs + url: https://docs.threshold.network/ + isExternal: true - label: Governance url: /governance - label: Ecosystem url: /ecosystem - - label: News + - label: About subitems: - label: Press url: /press - label: Blog url: https://blog.threshold.network/ isExternal: true - - label: About - subitems: - - label: Docs - url: https://docs.threshold.network/ - isExternal: true - label: Contributors url: /about#contributors - label: FAQ From 03bf45ca0bbc91612b582157f4f3f0db7a524f6e Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Wed, 20 Dec 2023 13:12:34 -0300 Subject: [PATCH 07/18] Add bug bounty button in sdk page --- src/content/pages/build/tbtc-sdk.md | 5 ++++- src/templates/home-page/SectionTemplate.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/content/pages/build/tbtc-sdk.md b/src/content/pages/build/tbtc-sdk.md index c65f166d..9043cff9 100644 --- a/src/content/pages/build/tbtc-sdk.md +++ b/src/content/pages/build/tbtc-sdk.md @@ -10,9 +10,12 @@ sdkInfo: description: "Unlock the power of blockchain – The ultimate toolkit for harnessing Bitcoin's potential." image: /images/tbtc-sdk.svg buttons: + - label: Bounty Program + url: https://blog.threshold.network/introducing-the-tbtc-sdk-bounty-program/ + variant: EXTERNAL_SOLID - label: Learn More url: https://blog.threshold.network/harnessing-the-tbtc-sdk-empowering-your-projects-with-bitcoin/ - variant: EXTERNAL_SOLID + variant: EXTERNAL_OUTLINE rowReverse: false useCasesInfo: preTitle: Explore diff --git a/src/templates/home-page/SectionTemplate.tsx b/src/templates/home-page/SectionTemplate.tsx index 9987e5fc..0c836d67 100644 --- a/src/templates/home-page/SectionTemplate.tsx +++ b/src/templates/home-page/SectionTemplate.tsx @@ -83,7 +83,7 @@ const SectionTemplate: FC = ({ {buttons.map((_: FooterButton, i) => { From 02522d97d220ee5e52ee32525e9d80228eec79d7 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Thu, 21 Dec 2023 01:58:46 -0300 Subject: [PATCH 08/18] Fix issues related to tbtc sdk types --- src/components/Card/index.tsx | 10 ++++++++ .../build-page/tbtc-sdk/FeaturesSection.tsx | 8 +++---- .../build-page/tbtc-sdk/UseCases.tsx | 23 +++++------------- src/templates/build-page/tbtc-sdk/index.tsx | 24 ++++++++++++++----- .../ecosystem-page/ProjectsAndTools.tsx | 12 +--------- .../ecosystem-page/ProjectsAndToolsCard.tsx | 12 +--------- .../ecosystem-page/ResourcesSection.tsx | 3 +-- src/types/index.ts | 12 ++++++++++ 8 files changed, 53 insertions(+), 51 deletions(-) create mode 100644 src/types/index.ts diff --git a/src/components/Card/index.tsx b/src/components/Card/index.tsx index d4478005..cfe6154b 100644 --- a/src/components/Card/index.tsx +++ b/src/components/Card/index.tsx @@ -9,6 +9,16 @@ import { import { FC } from "react" import { BodyLg, BodySm, LabelSm } from "../Typography" +export interface CardButton { + label: string + url: string + variant: string +} + +export interface CardCategory { + label: string +} + type CardComponent

= FC

& { PreTitle: FC Title: FC diff --git a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx index d5f3451e..b07e9b67 100644 --- a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx +++ b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx @@ -3,12 +3,12 @@ import { SimpleGrid, Stack } from "@chakra-ui/react" import Card from "../../../components/Card" import { BodyMd, H6, Image, ImageProps } from "../../../components" -export interface FeaturesSectionProps { +interface FeaturesSectionProps { cards: FeatureCardProps[] icon: ImageProps } -export interface FeatureCardProps { +interface FeatureCardProps { title: string description: string isBigSize?: boolean @@ -49,8 +49,8 @@ const FeaturesSection: FC = ({ return ( <> - {cards.map((resource: any, i) => ( - + {cards.map((card: FeatureCardProps, i) => ( + ))} diff --git a/src/templates/build-page/tbtc-sdk/UseCases.tsx b/src/templates/build-page/tbtc-sdk/UseCases.tsx index 15fad1f2..a14eb32c 100644 --- a/src/templates/build-page/tbtc-sdk/UseCases.tsx +++ b/src/templates/build-page/tbtc-sdk/UseCases.tsx @@ -1,20 +1,10 @@ import { FC, useRef, useState } from "react" import { Box, Button, SimpleGrid, Stack, Flex } from "@chakra-ui/react" -import Card from "../../../components/Card" +import Card, { CardButton, CardCategory } from "../../../components/Card" import ExternalButtonLink from "../../../components/Buttons/ExternalButtonLink" import { ExternalLinkHref } from "../../../components/Navbar/types" import { Image, ImageProps } from "../../../components" -export interface CardButton { - label: string - url: string - variant: string -} - -export interface CardCategory { - label: string -} - export interface UseCasesCardProps { image: ImageProps preTitle: string @@ -43,11 +33,10 @@ const UseCasesCard: FC = ({ onMouseLeave={() => setIsHovered(false)} rounded="2xl" p="2px" - bgGradient={ - isHovered - ? "linear-gradient(180deg, rgba(189,48,255,0) 0%, rgba(125,0,255,1) 100%)" - : "none" - } + _hover={{ + bgGradient: + "linear-gradient(180deg, rgba(189,48,255,0) 0%, rgba(125,0,255,1) 100%)", + }} > = ({ variant="link" size="md" width="100%" - ml="-0.5rem" + justifyContent="left" > {button.label} diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx index 64f7cf27..0c3cb064 100644 --- a/src/templates/build-page/tbtc-sdk/index.tsx +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -5,12 +5,22 @@ import { Box, Divider } from "@chakra-ui/react" import UseCases from "./UseCases" import FeaturesSection from "./FeaturesSection" import { HighlightWord } from "../../../components/HighlightWord" +import { SectionInfo } from "../../../types" -const SDKTitle: FC = ({ sdkInfo }: any) => ( +interface SDKPageContent { + [key: string]: SectionInfo | SectionInfo[] +} + +interface SDKTitleProps { + title: string + highlightedWord: string +} + +const SDKTitle: FC = ({ title, highlightedWord }) => ( @@ -25,13 +35,15 @@ const SDKPageTemplate: FC = ({ data }: any) => { featuresInfo, features, callToActionInfo, - } = data.markdownRemark.frontmatter + } = data.markdownRemark.frontmatter as SDKPageContent + const { title, highlightedWord, ...sectionTemplateProps } = + sdkInfo as SectionInfo return ( } + {...sectionTemplateProps} + title={} preTitle={null} columnReverse size="sm" diff --git a/src/templates/ecosystem-page/ProjectsAndTools.tsx b/src/templates/ecosystem-page/ProjectsAndTools.tsx index 0da1cd05..01689746 100644 --- a/src/templates/ecosystem-page/ProjectsAndTools.tsx +++ b/src/templates/ecosystem-page/ProjectsAndTools.tsx @@ -1,6 +1,6 @@ import { FC, useEffect, useState } from "react" import { SimpleGrid, Stack, Flex } from "@chakra-ui/react" -import { ImageProps } from "../../components" +import { CardButton, CardCategory, ImageProps } from "../../components" import SortDropdown, { SortOption } from "../../components/SortDropdown" import FilterMenu from "../../components/FilterMenu" import { ProjectsAndToolsCard } from "./ProjectsAndToolsCard" @@ -17,16 +17,6 @@ export enum Category { INTEGRATION = "integration", } -export interface CardButton { - label: string - url: string - variant: string -} - -export interface CardCategory { - label: string -} - export interface ProjectsAndToolsCardProps { image: ImageProps title: string diff --git a/src/templates/ecosystem-page/ProjectsAndToolsCard.tsx b/src/templates/ecosystem-page/ProjectsAndToolsCard.tsx index 47fe40fe..c05763ef 100644 --- a/src/templates/ecosystem-page/ProjectsAndToolsCard.tsx +++ b/src/templates/ecosystem-page/ProjectsAndToolsCard.tsx @@ -1,20 +1,10 @@ import { FC, useRef, useState } from "react" import { Box, Button, SimpleGrid, Stack, Flex } from "@chakra-ui/react" -import Card from "../../components/Card" +import Card, { CardButton, CardCategory } from "../../components/Card" import ExternalButtonLink from "../../components/Buttons/ExternalButtonLink" import { ExternalLinkHref } from "../../components/Navbar/types" import { Image, ImageProps } from "../../components" -export interface CardButton { - label: string - url: string - variant: string -} - -export interface CardCategory { - label: string -} - export interface ProjectsAndToolsCardProps { image: ImageProps title: string diff --git a/src/templates/ecosystem-page/ResourcesSection.tsx b/src/templates/ecosystem-page/ResourcesSection.tsx index 761a147d..5f009975 100644 --- a/src/templates/ecosystem-page/ResourcesSection.tsx +++ b/src/templates/ecosystem-page/ResourcesSection.tsx @@ -1,10 +1,9 @@ import { FC } from "react" import { Flex, GridItem, SimpleGrid, Stack } from "@chakra-ui/react" -import Card from "../../components/Card" +import Card, { CardButton } from "../../components/Card" import ExternalButtonLink from "../../components/Buttons/ExternalButtonLink" import { ExternalLinkHref } from "../../components/Navbar/types" import { BodyLg, H3, H5, Image, ImageProps } from "../../components" -import { CardButton } from "./ProjectsAndToolsCard" import backgroundResources from "../../static/images/background-resources.svg" export interface ResourcesCardProps { diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 00000000..ae069e4f --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,12 @@ +import { CardButton, ImageProps } from "../components" + +export interface SectionInfo { + title: string + description: string + preTitle?: string + highlightedWord?: string + buttons?: CardButton[] + icon?: ImageProps + image?: ImageProps + rowReversedw: boolean +} From 2af0b4d60eaeb72f830b13d42c90d84dbb78cb4d Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Thu, 21 Dec 2023 01:59:48 -0300 Subject: [PATCH 09/18] Remove unused box element import --- src/components/HighlightWord.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HighlightWord.tsx b/src/components/HighlightWord.tsx index cafa707e..eaebca54 100644 --- a/src/components/HighlightWord.tsx +++ b/src/components/HighlightWord.tsx @@ -1,5 +1,5 @@ import React, { FC } from "react" -import { Box, BoxProps, Text } from "@chakra-ui/react" +import { BoxProps, Text } from "@chakra-ui/react" export interface HighlightWordProps extends BoxProps { title: string From 896955ed28ede2a34fee5b687d842b7278edefe2 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 00:59:18 -0300 Subject: [PATCH 10/18] Add cta button in nav bar menu --- .../Navbar/DesktopNav/DesktopNavLinks.tsx | 16 ++- .../Navbar/DesktopNav/DropdownMenu.tsx | 1 + src/components/Navbar/DesktopNav/NavLink.tsx | 2 +- .../Navbar/MobileNav/MobileDrawer.tsx | 23 +++- src/components/Navbar/NavCTAButtons.tsx | 30 +++++ src/components/Navbar/index.tsx | 105 ++++++++++-------- src/content/components/nav-bar.md | 8 +- static/admin/config.yml | 12 ++ 8 files changed, 139 insertions(+), 58 deletions(-) create mode 100644 src/components/Navbar/NavCTAButtons.tsx diff --git a/src/components/Navbar/DesktopNav/DesktopNavLinks.tsx b/src/components/Navbar/DesktopNav/DesktopNavLinks.tsx index 012895c7..d876eca3 100644 --- a/src/components/Navbar/DesktopNav/DesktopNavLinks.tsx +++ b/src/components/Navbar/DesktopNav/DesktopNavLinks.tsx @@ -3,8 +3,18 @@ import { HStack } from "@chakra-ui/react" import DropdownLabelLink from "./DropdownMenu" import NavLink from "./NavLink" import { LinkInfo } from "../types" +import NavCTAButtons from "../NavCTAButtons" +import { CardButton } from "../../Card" -const DesktopNavLinks: FC<{ navLinks: LinkInfo[] }> = ({ navLinks }) => { +interface DesktopNavLinksProps { + navLinks: LinkInfo[] + menuButtons: CardButton[] +} + +const DesktopNavLinks: FC = ({ + navLinks, + menuButtons, +}) => { return ( = ({ navLinks }) => { borderColor="gray.700" px={8} spacing={4} - display={{ base: "none", lg: "inherit" }} + display={{ base: "none", md: "inherit" }} + justifyContent={{ base: "end", lg: "start" }} as="nav" > {navLinks.map(({ subitems, label, url }) => { @@ -29,6 +40,7 @@ const DesktopNavLinks: FC<{ navLinks: LinkInfo[] }> = ({ navLinks }) => { ) })} + ) } diff --git a/src/components/Navbar/DesktopNav/DropdownMenu.tsx b/src/components/Navbar/DesktopNav/DropdownMenu.tsx index 909a6236..86657875 100644 --- a/src/components/Navbar/DesktopNav/DropdownMenu.tsx +++ b/src/components/Navbar/DesktopNav/DropdownMenu.tsx @@ -35,6 +35,7 @@ const DropdownMenu: FC<{ dropdown: LinkInfo[]; text: string }> = ({ px={2} color="gray.300" _hover={hoverStyles} + display={{ base: "none", lg: "inherit" }} {...openStyles} > diff --git a/src/components/Navbar/DesktopNav/NavLink.tsx b/src/components/Navbar/DesktopNav/NavLink.tsx index 4569f55e..6fc63626 100644 --- a/src/components/Navbar/DesktopNav/NavLink.tsx +++ b/src/components/Navbar/DesktopNav/NavLink.tsx @@ -10,7 +10,7 @@ const NavLink: FC<{ href: string }> = ({ href, children }) => { px={2} to={href} color="gray.300" - display="flex" + display={{ base: "none", lg: "flex" }} _hover={{ textDecoration: "none", color: "white", diff --git a/src/components/Navbar/MobileNav/MobileDrawer.tsx b/src/components/Navbar/MobileNav/MobileDrawer.tsx index d425827b..d8838439 100644 --- a/src/components/Navbar/MobileNav/MobileDrawer.tsx +++ b/src/components/Navbar/MobileNav/MobileDrawer.tsx @@ -18,13 +18,24 @@ import { LinkInfo, SocialLink } from "../types" import SocialMediaLinks from "../SocialMediaLinks" import { FaChevronLeft } from "react-icons/all" import { BodySm, H5 } from "../../Typography" +import { CardButton } from "../../Card" +import NavCTAButtons from "../NavCTAButtons" -const MobileDrawer: FC<{ +interface MobileDrawerProps { onClose: () => void isOpen: boolean navLinks: LinkInfo[] socialLinks: SocialLink[] -}> = ({ onClose, isOpen, navLinks, socialLinks }) => { + menuButtons: CardButton[] +} + +const MobileDrawer: FC = ({ + onClose, + isOpen, + navLinks, + socialLinks, + menuButtons, +}) => { const isMobileDevice = useChakraBreakpoint("lg") const [navLinksToRender, setNavLinksToRender] = useState(navLinks) @@ -64,6 +75,14 @@ const MobileDrawer: FC<{ justifyContent="space-between" pb={20} > + }> {navLinksToRender.map(({ url, label, subitems }) => ( = ({ menuButtons, ...props }) => { + return ( + + {menuButtons.map((_: CardButton) => { + return ( + + {_.label} + + ) + })} + + ) +} + +export default NavCTAButtons diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index d8d311d8..8f042dde 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -8,6 +8,59 @@ import { LinkInfo } from "./types" import WhatsNextBanner from "./WhatsNextBanner" import MobileDrawer from "./MobileNav/MobileDrawer" import DesktopNavLinks from "./DesktopNav/DesktopNavLinks" +import { CardButton } from "../Card" +import NavCTAButtons from "./NavCTAButtons" + +export const Navbar: FC = () => { + const { + isOpen: isDrawerOpen, + onOpen: onDrawOpen, + onClose: onDrawerClose, + } = useDisclosure() + + const { isOpen: showBanner, onClose: closeBanner } = useDisclosure({ + defaultIsOpen: true, + }) + const data = useStaticQuery(query) + const socialLinks = + data.allMarkdownRemark.edges[0].node.frontmatter.social_links + const navLinks = data.allMarkdownRemark.edges[0].node.frontmatter + .nav_items as LinkInfo[] + const menuButtons = data.allMarkdownRemark.edges[0].node.frontmatter + .menu_buttons as CardButton[] + + return ( + <> + {showBanner && } + + + + + + + + + + + ) +} const query = graphql` query Navbar { @@ -27,6 +80,10 @@ const query = graphql` isExternal } } + menu_buttons { + label + url + } social_links { label url @@ -63,51 +120,3 @@ const query = graphql` } } ` - -export const Navbar: FC = () => { - const { - isOpen: isDrawerOpen, - onOpen: onDrawOpen, - onClose: onDrawerClose, - } = useDisclosure() - - const { isOpen: showBanner, onClose: closeBanner } = useDisclosure({ - defaultIsOpen: true, - }) - const data = useStaticQuery(query) - const socialLinks = - data.allMarkdownRemark.edges[0].node.frontmatter.social_links - const navLinks = data.allMarkdownRemark.edges[0].node.frontmatter - .nav_items as LinkInfo[] - - return ( - <> - {showBanner && } - - - - - - - - - - - ) -} diff --git a/src/content/components/nav-bar.md b/src/content/components/nav-bar.md index f5295c1c..8626cc0d 100644 --- a/src/content/components/nav-bar.md +++ b/src/content/components/nav-bar.md @@ -41,6 +41,9 @@ nav_items: - label: Brand Assets url: https://bit.ly/threshold-brand-assets isExternal: true +menu_buttons: + - label: tBTC dApp + url: https://dashboard.threshold.network/tBTC social_links: - label: Twitter url: https://twitter.com/TheTNetwork @@ -57,11 +60,6 @@ social_links: icon: image: /images/discord.svg alt: Threshold Discord - - label: Discourse - url: https://forum.threshold.network - icon: - image: /images/discourse-resources.svg - alt: Threshold Forum - label: GitHub url: https://github.com/threshold-network icon: diff --git a/static/admin/config.yml b/static/admin/config.yml index 64bb9d49..69534bbe 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -3222,6 +3222,18 @@ collections: }, ], } + - { + label: "Buttons", + name: "menu_buttons", + widget: "list", + allow_add: true, + required: false, + fields: + [ + { label: Label, name: label, widget: string }, + { label: URL, name: url, widget: string }, + ], + } - { label: "Social Media Links", name: "social_links", From 881ed9ce6d620f650337130866fced4f60cc8105 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:01:54 -0300 Subject: [PATCH 11/18] Refactor tbtc sdk pretitle fields in config --- static/admin/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/static/admin/config.yml b/static/admin/config.yml index 69534bbe..1ce7e73c 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -2567,6 +2567,12 @@ collections: widget: file, media_library: { config: { multiple: false } }, }, + { + label: "Pre Title", + name: "preTitle", + widget: "string", + minimal: true, + }, { label: "Title", name: "title", widget: "string" }, { label: "Description", @@ -2665,12 +2671,6 @@ collections: allow_add: true, fields: [ - { - label: "Pre Title", - name: "preTitle", - widget: "string", - minimal: true, - }, { label: "Title", name: "title", widget: "string" }, { label: "Description", From f6273f71a2ebc922af66ed7c6d36c28694e5a4e9 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:04:27 -0300 Subject: [PATCH 12/18] Refactor sectioninfo type --- src/templates/build-page/tbtc-sdk/index.tsx | 17 ++++++++++------- src/types/index.ts | 6 +++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx index 0c3cb064..a5a8c112 100644 --- a/src/templates/build-page/tbtc-sdk/index.tsx +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -2,13 +2,18 @@ import { FC } from "react" import { graphql } from "gatsby" import SectionTemplate from "../../home-page/SectionTemplate" import { Box, Divider } from "@chakra-ui/react" -import UseCases from "./UseCases" -import FeaturesSection from "./FeaturesSection" +import UseCases, { UseCasesCardProps } from "./UseCases" +import FeaturesSection, { FeatureCardProps } from "./FeaturesSection" import { HighlightWord } from "../../../components/HighlightWord" -import { SectionInfo } from "../../../types" +import { SectionInfo, WithRequiredProperty } from "../../../types" interface SDKPageContent { - [key: string]: SectionInfo | SectionInfo[] + sdkInfo: SectionInfo + useCasesInfo: SectionInfo + useCases: UseCasesCardProps[] + featuresInfo: WithRequiredProperty + features: FeatureCardProps[] + callToActionInfo: WithRequiredProperty } interface SDKTitleProps { @@ -43,8 +48,7 @@ const SDKPageTemplate: FC = ({ data }: any) => { } - preTitle={null} + title={} columnReverse size="sm" > @@ -70,7 +74,6 @@ const SDKPageTemplate: FC = ({ data }: any) => { = Type & { + [Property in Key]-?: Type[Property] } From 8775651c5965910da9748b510fbd722cdebd9ea4 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:05:46 -0300 Subject: [PATCH 13/18] Add image props type in home page --- src/templates/home-page/SectionTemplate.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/templates/home-page/SectionTemplate.tsx b/src/templates/home-page/SectionTemplate.tsx index 0c836d67..7c99c8b4 100644 --- a/src/templates/home-page/SectionTemplate.tsx +++ b/src/templates/home-page/SectionTemplate.tsx @@ -1,5 +1,9 @@ import React, { FC } from "react" -import { BoxProps, Stack } from "@chakra-ui/react" +import { + BoxProps, + ImageProps as ChakraImageProps, + Stack, +} from "@chakra-ui/react" import { ButtonType, CmsButtonLink, @@ -24,11 +28,11 @@ export interface FooterButton { } export interface RoleTemplateProps extends OmittedBoxProps { - bgColor: string title: string | JSX.Element | FC description: string buttons: FooterButton[] - image?: ImageProps + bgColor?: string + image?: ImageProps & ChakraImageProps rowReverse?: boolean size?: "sm" | "md" isImageBackground?: boolean From 98ae297fc835b2d216660f23ba1a1733e876a2f7 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:07:37 -0300 Subject: [PATCH 14/18] Refactor highlightword component to accept undefined --- src/components/HighlightWord.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/HighlightWord.tsx b/src/components/HighlightWord.tsx index eaebca54..2d773d94 100644 --- a/src/components/HighlightWord.tsx +++ b/src/components/HighlightWord.tsx @@ -3,7 +3,7 @@ import { BoxProps, Text } from "@chakra-ui/react" export interface HighlightWordProps extends BoxProps { title: string - highlightedWord: string + highlightedWord?: string } export const HighlightWord: FC = ({ @@ -11,13 +11,13 @@ export const HighlightWord: FC = ({ highlightedWord, ...highlightedWordProps }) => { - const titleSplittedByHighlightedWord = title.split(highlightedWord!) + const splittedTitle = title.split(highlightedWord || "") return ( <> - {titleSplittedByHighlightedWord.map((item, index) => ( + {splittedTitle.map((item, index) => ( {item} - {index !== titleSplittedByHighlightedWord.length - 1 && ( + {index !== splittedTitle.length - 1 && highlightedWord && ( {highlightedWord} From f0df2bb9fa34e2e9b15eec0799bc6e61eacd5487 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:11:02 -0300 Subject: [PATCH 15/18] Remove unused type in sdk feature section --- .../build-page/tbtc-sdk/FeaturesSection.tsx | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx index b07e9b67..c9043b81 100644 --- a/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx +++ b/src/templates/build-page/tbtc-sdk/FeaturesSection.tsx @@ -8,39 +8,35 @@ interface FeaturesSectionProps { icon: ImageProps } -interface FeatureCardProps { +export interface FeatureCardProps { title: string description: string - isBigSize?: boolean } -const FeatureCard: FC = ({ - icon, - title, - description, -}) => { - return ( - - - - -

{title}
-
+const FeatureCard: FC> = + ({ icon, title, description }) => { + return ( + + + + +
{title}
+
- - {description} - -
-
- ) -} + + {description} + +
+ + ) + } const FeaturesSection: FC = ({ cards, From c13f9b5132f67d1efddaf45f0f01cbcec173b7f7 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 01:13:55 -0300 Subject: [PATCH 16/18] Removed unused usestate and useref functions --- src/templates/build-page/tbtc-sdk/UseCases.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/templates/build-page/tbtc-sdk/UseCases.tsx b/src/templates/build-page/tbtc-sdk/UseCases.tsx index a14eb32c..dd916e84 100644 --- a/src/templates/build-page/tbtc-sdk/UseCases.tsx +++ b/src/templates/build-page/tbtc-sdk/UseCases.tsx @@ -1,6 +1,6 @@ -import { FC, useRef, useState } from "react" -import { Box, Button, SimpleGrid, Stack, Flex } from "@chakra-ui/react" -import Card, { CardButton, CardCategory } from "../../../components/Card" +import { FC } from "react" +import { Box, SimpleGrid, Stack } from "@chakra-ui/react" +import Card, { CardButton } from "../../../components/Card" import ExternalButtonLink from "../../../components/Buttons/ExternalButtonLink" import { ExternalLinkHref } from "../../../components/Navbar/types" import { Image, ImageProps } from "../../../components" @@ -10,8 +10,6 @@ export interface UseCasesCardProps { preTitle: string title: string description: string - categories: CardCategory[] - timestamp: number buttons: CardButton[] } @@ -22,15 +20,9 @@ const UseCasesCard: FC = ({ description, buttons, }) => { - const [isHovered, setIsHovered] = useState(false) - const cardRef = useRef(null) - return ( setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} rounded="2xl" p="2px" _hover={{ From e69a16e5d83486a6c994e200493399c04e59dd18 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 12:11:53 -0300 Subject: [PATCH 17/18] Fix buttons optionality in section template --- src/templates/home-page/SectionTemplate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/home-page/SectionTemplate.tsx b/src/templates/home-page/SectionTemplate.tsx index 7c99c8b4..a79fdd53 100644 --- a/src/templates/home-page/SectionTemplate.tsx +++ b/src/templates/home-page/SectionTemplate.tsx @@ -30,7 +30,7 @@ export interface FooterButton { export interface RoleTemplateProps extends OmittedBoxProps { title: string | JSX.Element | FC description: string - buttons: FooterButton[] + buttons?: FooterButton[] bgColor?: string image?: ImageProps & ChakraImageProps rowReverse?: boolean From 8b7e3bfe75f7cbb85c07f28ef285c01cdecffaf3 Mon Sep 17 00:00:00 2001 From: evandrosaturnino Date: Fri, 22 Dec 2023 12:13:41 -0300 Subject: [PATCH 18/18] Fix tbtc sdk template types --- src/templates/build-page/tbtc-sdk/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/templates/build-page/tbtc-sdk/index.tsx b/src/templates/build-page/tbtc-sdk/index.tsx index a5a8c112..39dec164 100644 --- a/src/templates/build-page/tbtc-sdk/index.tsx +++ b/src/templates/build-page/tbtc-sdk/index.tsx @@ -13,7 +13,7 @@ interface SDKPageContent { useCases: UseCasesCardProps[] featuresInfo: WithRequiredProperty features: FeatureCardProps[] - callToActionInfo: WithRequiredProperty + callToActionInfo: SectionInfo } interface SDKTitleProps { @@ -41,8 +41,7 @@ const SDKPageTemplate: FC = ({ data }: any) => { features, callToActionInfo, } = data.markdownRemark.frontmatter as SDKPageContent - const { title, highlightedWord, ...sectionTemplateProps } = - sdkInfo as SectionInfo + const { title, highlightedWord, ...sectionTemplateProps } = sdkInfo return (