Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tBTC SDK Page #105

Merged
merged 18 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.eslintcache

# Generated
build/
/build/
michalsmiarowski marked this conversation as resolved.
Show resolved Hide resolved
dist/

# Yarn
Expand Down
18 changes: 18 additions & 0 deletions src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ 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<P> = FC<P> & {
PreTitle: FC<TextProps>
Title: FC<TextProps>
SubTitle: FC<TextProps>
Divider: FC<DividerProps>
Expand All @@ -21,6 +32,12 @@ const Card: CardComponent<BoxProps> = (props) => {
return <Box __css={styles} {...props} />
}

const PreTitle: FC = ({ children, ...textProps }) => (
<LabelSm as="span" bgClip="text" textTransform="uppercase" {...textProps}>
{children}
</LabelSm>
)

const Title: FC = ({ children, ...textProps }) => (
<BodyLg {...textProps}>{children}</BodyLg>
)
Expand All @@ -39,6 +56,7 @@ const Divider = ({ ...dividerProps }) => {
return <ChakraDivider bg="gray.700" {...dividerProps} />
}

Card.PreTitle = PreTitle
Card.Title = Title
Card.SubTitle = SubTitle
Card.Body = Body
Expand Down
1 change: 0 additions & 1 deletion src/components/HighlightWord.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FC } from "react"
import { RoleTemplateProps } from "../templates/home-page/SectionTemplate"
import { BoxProps, Text } from "@chakra-ui/react"

export interface HighlightWordProps extends BoxProps {
Expand Down
1 change: 0 additions & 1 deletion src/components/IntegrationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
Expand Down
15 changes: 9 additions & 6 deletions src/content/components/nav-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/content/pages/build/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
template: build-page
path: /build
title: Build
---
75 changes: 75 additions & 0 deletions src/content/pages/build/tbtc-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
template: build-page/tbtc-sdk
path: /build/tbtc-sdk
title: SDK Page
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: 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_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
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
- label: Join Discord
url: https://discord.gg/threshold
variant: EXTERNAL_OUTLINE
---
7 changes: 7 additions & 0 deletions src/templates/build-page/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { FC } from "react"

const BuildPageTemplate: FC<any> = () => {
return <></>
}

export default BuildPageTemplate
60 changes: 60 additions & 0 deletions src/templates/build-page/tbtc-sdk/FeaturesSection.tsx
Original file line number Diff line number Diff line change
@@ -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"

interface FeaturesSectionProps {
cards: FeatureCardProps[]
icon: ImageProps
}

interface FeatureCardProps {
title: string
description: string
isBigSize?: boolean
michalsmiarowski marked this conversation as resolved.
Show resolved Hide resolved
}

const FeatureCard: FC<FeatureCardProps & FeaturesSectionProps> = ({
michalsmiarowski marked this conversation as resolved.
Show resolved Hide resolved
icon,
title,
description,
}) => {
return (
<Card
boxShadow={"0px 4px 90px 0px rgba(153, 116, 255, 0.06)"}
m="auto"
display="flex"
flexDirection="column"
w="100%"
p={10}
>
<Stack spacing={6}>
<Stack direction="row" alignItems="center" gap={2}>
<Image h="10px" w="10px" {...icon} />
<H6>{title}</H6>
</Stack>

<BodyMd as="div" lineHeight="28px" color="gray.400" noOfLines={3}>
{description}
</BodyMd>
</Stack>
</Card>
)
}

const FeaturesSection: FC<FeaturesSectionProps> = ({
cards,
icon,
}: FeaturesSectionProps) => {
return (
<>
<SimpleGrid columns={{ base: 1, md: 3 }} spacing={4} mt={8}>
{cards.map((card: FeatureCardProps, i) => (
<FeatureCard key={i} icon={icon} {...card} />
))}
</SimpleGrid>
</>
)
}

export default FeaturesSection
102 changes: 102 additions & 0 deletions src/templates/build-page/tbtc-sdk/UseCases.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { FC, useRef, useState } from "react"
import { Box, Button, SimpleGrid, Stack, Flex } from "@chakra-ui/react"
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 UseCasesCardProps {
image: ImageProps
preTitle: string
title: string
description: string
categories: CardCategory[]
timestamp: number
michalsmiarowski marked this conversation as resolved.
Show resolved Hide resolved
buttons: CardButton[]
}

const UseCasesCard: FC<UseCasesCardProps> = ({
image,
preTitle,
title,
description,
buttons,
}) => {
const [isHovered, setIsHovered] = useState(false)
const cardRef = useRef(null)

return (
<Stack spacing={6}>
<Box
ref={cardRef}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
rounded="2xl"
p="2px"
_hover={{
bgGradient:
"linear-gradient(180deg, rgba(189,48,255,0) 0%, rgba(125,0,255,1) 100%)",
}}
>
<Card
m="auto"
display="flex"
flexDirection="column"
justifyContent="space-between"
w="100%"
borderColor="transparent"
bg="gray.900"
>
<Stack spacing={6} mb="0.5rem">
<Card.PreTitle
bgGradient="linear-gradient(180deg, #BD30FF 3.32%, #7D00FF 95.02%)"
fontWeight="bold"
>
{preTitle}
</Card.PreTitle>
<Stack direction="row" alignItems="center" gap={4}>
<Image h="38px" w="38px" {...image} />
<Card.Title noOfLines={2} maxWidth="130px" fontWeight="bold">
{title}
</Card.Title>
</Stack>
<Card.Body
as="div"
color="gray.400"
lineHeight="24px"
noOfLines={3}
>
{description}
</Card.Body>
<SimpleGrid columns={2}>
{buttons.map((button: CardButton, i) => (
<ExternalButtonLink
key={i}
href={button.url as ExternalLinkHref}
variant="link"
size="md"
width="100%"
justifyContent="left"
>
{button.label}
</ExternalButtonLink>
))}
</SimpleGrid>
</Stack>
</Card>
</Box>
</Stack>
)
}

const UseCases: FC<{ cards: UseCasesCardProps[] }> = ({ cards }) => {
return (
<SimpleGrid columns={{ md: 3 }} spacing={3} mt={8} mb={-12}>
{cards.map((card: any, i) => (
<UseCasesCard key={i} {...card} />
))}
</SimpleGrid>
)
}

export default UseCases
Loading