Skip to content

Commit

Permalink
Merge pull request #711 from threshold-network/no-bridge-fees-padding…
Browse files Browse the repository at this point in the history
…-fix-for-mobile

No bridge fees improvements
  • Loading branch information
kpyszkowski authored Dec 28, 2023
2 parents 45c336c + 84543bf commit dfe4e52
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 35 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
50c6d966435451b12691611784aa0dd6ad0927fa
1911b2106aada277cb49835f9983e4ba04a1affa
b89fbc32ba93e921df994499f3c29512ab59a71e
0b3d20bbba7a706603c91aef512a5f18d5c8ff17
37 changes: 22 additions & 15 deletions src/components/Navbar/NavbarComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Stack,
useColorModeValue,
H5,
HStack,
} from "@threshold-network/components"
import { Routes, Route, Link, useMatch } from "react-router-dom"
import WalletConnectionAlert from "./WalletConnectionAlert"
Expand All @@ -19,6 +20,7 @@ import ThresholdWhite from "../../static/icons/ThresholdWhite"
import useChakraBreakpoint from "../../hooks/useChakraBreakpoint"
import { pages } from "../../pages"
import { PageComponent } from "../../types"
import { NoBridgeFeesPageTitleBadge } from "../tBTC"

interface NavbarComponentProps {
account?: string | null
Expand Down Expand Up @@ -79,7 +81,15 @@ const renderPageTitle = (PageComponent: PageComponent) => {
path={`${PageComponent.route.path}/*`}
element={
PageComponent.route.title ? (
<PageTitle title={PageComponent.route.title} />
<HStack display={{ base: "none", md: "flex" }}>
<PageTitle title={PageComponent.route.title} />
{PageComponent.route.title === "tBTC" && (
<NoBridgeFeesPageTitleBadge
display={"flex"}
alignItems={"center"}
/>
)}
</HStack>
) : (
<></>
)
Expand All @@ -89,11 +99,7 @@ const renderPageTitle = (PageComponent: PageComponent) => {
}

const PageTitle: FC<{ title: string }> = ({ title }) => {
return (
<H5 ml={12} display={{ base: "none", md: "block" }}>
{title}
</H5>
)
return <H5 ml={12}>{title}</H5>
}

const renderMobileHeader = (PageComponent: PageComponent) => {
Expand All @@ -103,7 +109,15 @@ const renderMobileHeader = (PageComponent: PageComponent) => {
path={`${PageComponent.route.path}/*`}
element={
PageComponent.route.title ? (
<MobileHeader title={PageComponent.route.title} />
<HStack display={{ base: "flex", md: "none" }}>
<MobileHeader title={PageComponent.route.title} />
{PageComponent.route.title === "tBTC" && (
<NoBridgeFeesPageTitleBadge
display={"flex"}
alignItems={"center"}
/>
)}
</HStack>
) : (
<></>
)
Expand All @@ -114,14 +128,7 @@ const renderMobileHeader = (PageComponent: PageComponent) => {

const MobileHeader: FC<{ title: string }> = ({ title }) => {
return (
<Box
display={{ base: "flex", md: "none" }}
as="header"
pl={10}
py={6}
borderBottom="1px"
borderColor="gray.100"
>
<Box as="header" pl={10} py={6} borderBottom="1px" borderColor="gray.100">
<H5>{title}</H5>
</Box>
)
Expand Down
23 changes: 23 additions & 0 deletions src/components/PageTitleBadge/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Box, BoxProps, useColorModeValue } from "@threshold-network/components"
import { FC } from "react"
import pageTitleBadgeIconLight from "../../static/images/page-title-badge-light.svg"
import pageTitleBadgeIconDark from "../../static/images/page-title-badge-dark.svg"

export const PageTitleBadge: FC<BoxProps> = ({ children, ...restProps }) => {
const backgroundImage = useColorModeValue(
pageTitleBadgeIconLight,
pageTitleBadgeIconDark
)
return (
<Box
backgroundImage={backgroundImage}
backgroundSize={"cover"}
maxWidth={"392px"}
width={"100%"}
height={"36px"}
{...restProps}
>
{children}
</Box>
)
}
27 changes: 27 additions & 0 deletions src/components/tBTC/NoBridgeFeesPageTitleBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
BodySm,
BoxProps,
Text,
useColorModeValue,
} from "@threshold-network/components"
import { FC } from "react"
import { PageTitleBadge } from "../PageTitleBadge"

export const NoBridgeFeesPageTitleBadge: FC<BoxProps> = ({ ...restProps }) => {
const textColor = useColorModeValue("brand.500", "brand.300")
return (
<PageTitleBadge {...restProps}>
<BodySm
ml={12}
textTransform={"uppercase"}
color={textColor}
letterSpacing={".5px"}
>
<Text as="span" fontWeight={"bold"}>
No Bridge fees
</Text>{" "}
until february 10, 2024!
</BodySm>
</PageTitleBadge>
)
}
9 changes: 5 additions & 4 deletions src/components/tBTC/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export * from "./TakeNoteList"
export * from "./Links"
export * from "./Stats"
export * from "./tBTCText"
export * from "./BridgeActivity"
export * from "./BridgeProcessIndicator"
export * from "./Links"
export * from "./NoBridgeFeesPageTitleBadge"
export * from "./SendBitcoinsToDepositAddressForm"
export * from "./Stats"
export * from "./TakeNoteList"
export * from "./tBTCText"
29 changes: 15 additions & 14 deletions src/pages/Overview/NoBridgeFeesBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { BodyMd, Stack, Image, VStack } from "@threshold-network/components"
import {
AnnouncementBannerContainer,
AnnouncementBannerContainerProps,
} from "../../components/AnnouncementBanner"
BodyMd,
Stack,
Image,
VStack,
Card,
BoxProps,
} from "@threshold-network/components"
import ButtonLink from "../../components/ButtonLink"
import santaIsComing from "../../static/images/santa-is-coming.png"
import noBridgeFeesText from "../../static/images/no-bridge-fees-text.svg"
import { FC } from "react"

export const NoBridgeFeesBanner: FC<AnnouncementBannerContainerProps> = ({
...props
}) => {
export const NoBridgeFeesBanner: FC<BoxProps> = ({ ...props }) => {
return (
<AnnouncementBannerContainer
hideCloseBtn
py={{ base: 6, xl: 8 }}
<Card
p={{ base: 6, xl: 10 }}
backgroundImage={santaIsComing}
backgroundSize={"cover"}
backgroundPosition={{ base: "25%", xl: "center" }}
border={"none"}
boxShadow={"none"}
{...props}
>
<Stack
direction={{ base: "column", xl: "row" }}
alignItems={{ base: "left", xl: "center" }}
justifyContent={"space-between"}
alignItems={{ base: "start", xl: "center" }}
justifyContent={{ base: "left", xl: "space-between" }}
>
<VStack alignItems={"start"}>
<Image
Expand All @@ -34,11 +36,10 @@ export const NoBridgeFeesBanner: FC<AnnouncementBannerContainerProps> = ({
until February 10, 2024!
</BodyMd>
</VStack>

<ButtonLink to={"/tBTC"} px={"6"} maxWidth={"150px"}>
Start Minting
</ButtonLink>
</Stack>
</AnnouncementBannerContainer>
</Card>
)
}
2 changes: 0 additions & 2 deletions src/pages/tBTC/HowItWorks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import { MintingTimelineCard } from "./MintingTimelineCard"
import { JSONFileCard } from "./JSONFileCard"
import { Banner } from "./Banner"
import { PageComponent } from "../../../types"
import { NoBridgeFeesBanner } from "../../Overview/NoBridgeFeesBanner"

const HowItWorksPage: PageComponent = (props) => {
return (
<>
<NoBridgeFeesBanner mb={"4"} />
<Banner />
<TbtcBridgeCard mb="4" />
<SimpleGrid columns={{ base: 1, xl: 2 }} spacing="4">
Expand Down
1 change: 1 addition & 0 deletions src/static/images/page-title-badge-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/static/images/page-title-badge-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dfe4e52

Please sign in to comment.