Skip to content

Commit d8236f9

Browse files
authored
Merge pull request #263 from threshold-network/issue-231-application-image-color
How It Works page - application details styling adjustments
2 parents 408c6ae + f6046ac commit d8236f9

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

src/components/InfoBox/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const InfoBox: FC<{ text?: string; variant?: any } & StackProps> = ({
1111
const styles = useStyleConfig("InfoBox", { variant })
1212

1313
return (
14-
<Stack sx={styles} {...props}>
14+
<Stack __css={styles} {...props}>
1515
{text && <H3>{text}</H3>}
1616
{children}
1717
</Stack>

src/pages/Staking/HowItWorks/StakingApplications/ApplicationDetailsCard.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { FC } from "react"
2-
import { IoAlertCircle, MdCheckCircle } from "react-icons/all"
2+
import { MdCheckCircle } from "react-icons/all"
33
import {
44
BodyMd,
55
Box,
6-
BoxLabel,
76
Card,
87
H5,
98
HStack,
@@ -14,7 +13,7 @@ import {
1413
useColorModeValue,
1514
List,
1615
ListItem,
17-
SimpleGrid,
16+
Grid,
1817
} from "@threshold-network/components"
1918
import InfoBox from "../../../../components/InfoBox"
2019

@@ -35,20 +34,33 @@ const ApplicationDetailsCard: FC<Props> = ({
3534
ctaButtons,
3635
rewardSteps,
3736
}) => {
38-
const infoBoxBg = useColorModeValue("gray.50", "gray.900")
37+
const infoBoxBg = useColorModeValue("gray.50", "blackAlpha.300")
3938

4039
return (
4140
<Card boxShadow="none" as="section">
4241
<LabelSm mb={6}>{preTitle}</LabelSm>
43-
<SimpleGrid columns={{ base: 1, xl: 2 }} spacing={10}>
44-
<Stack spacing={6}>
42+
<Grid
43+
gridAutoColumns="minmax(0, 1fr)"
44+
gridAutoFlow="column"
45+
gridTemplate={{
46+
base: `
47+
"app-details"
48+
"cta-buttons"
49+
`,
50+
xl: `
51+
"app-details app-details cta-buttons"
52+
`,
53+
}}
54+
gridGap="8"
55+
>
56+
<Stack spacing={6} gridArea="app-details">
4557
<H5>{title}</H5>
4658
<BodyMd>{description}</BodyMd>
4759
<InfoBox bg={infoBoxBg}>
4860
<Image m="auto" maxH="180px" maxW="360px" w="100%" src={imgSrc} />
4961
</InfoBox>
5062
</Stack>
51-
<Box>
63+
<Box gridArea="cta-buttons">
5264
{ctaButtons}
5365
<LabelSm mb={6}>How to earn rewards</LabelSm>
5466
<List mb={6} as={Stack} spacing={2}>
@@ -62,7 +74,7 @@ const ApplicationDetailsCard: FC<Props> = ({
6274
})}
6375
</List>
6476
</Box>
65-
</SimpleGrid>
77+
</Grid>
6678
</Card>
6779
)
6880
}

src/pages/Staking/HowItWorks/StakingApplications/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ const StakingApplications: PageComponent = () => {
117117
</ListItem>
118118
</List>
119119
</Stack>
120-
<Image maxW="528px" src={iconMap.stakingApps[colorMode]} />
120+
<Image
121+
maxW={{ base: "100%", xl: "528px" }}
122+
src={iconMap.stakingApps[colorMode]}
123+
/>
121124
</Stack>
122125
<Stack spacing={6}>
123126
<ApplicationDetailsCard

src/pages/Staking/HowItWorks/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const HowItWorksPage: PageComponent = () => {
5151
return (
5252
<Box>
5353
<AnnouncementBanner
54+
variant="secondary"
5455
imgSrc={howItWorksIllustration}
5556
title="Find more information about staking below, then go to the staking page."
5657
href="/staking"

src/theme/AnnouncementBanner.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const baseStyle: PartsStyleFunction<typeof parts> = (props) => {
3838
background: mode("gradient.3", undefined)(props),
3939
backgroundClip: mode("text", undefined)(props),
4040
textFillColor: mode("transparent", undefined)(props),
41+
margin: { base: "auto", xl: 0 },
4142
},
4243
title: {
4344
textAlign: { base: "center", xl: "unset" },
@@ -53,7 +54,20 @@ const baseStyle: PartsStyleFunction<typeof parts> = (props) => {
5354
}
5455
}
5556

57+
const secondaryVariant: PartsStyleFunction<typeof parts> = (props) => ({
58+
container: {
59+
bg: mode("brand.50", "#2B3036")(props),
60+
border: mode("none", "1px solid")(props),
61+
borderColor: "brand.300",
62+
},
63+
})
64+
65+
const variants = {
66+
secondary: secondaryVariant,
67+
}
68+
5669
export const AnnouncementBanner = {
5770
parts: parts.keys,
5871
baseStyle,
72+
variants,
5973
}

0 commit comments

Comments
 (0)