Skip to content

Commit 2d19eda

Browse files
committed
fix: CalloutBanner layout; migrate remainder to tw
1 parent c561f11 commit 2d19eda

File tree

1 file changed

+19
-39
lines changed

1 file changed

+19
-39
lines changed

src/components/CalloutBanner.tsx

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { useTranslation } from "next-i18next"
2-
import { Flex } from "@chakra-ui/react"
32

43
import type { TranslationKey } from "@/lib/types"
54

6-
import { Image, type ImageProps } from "@/components/Image"
7-
import OldHeading from "@/components/OldHeading"
8-
import Text from "@/components/OldText"
5+
import { type ImageProps, TwImage } from "@/components/Image"
96

107
import { cn } from "@/lib/utils/cn"
118

@@ -24,6 +21,7 @@ const CalloutBanner = ({
2421
descriptionKey,
2522
alt,
2623
children,
24+
className,
2725
...props
2826
}: CalloutBannerProps) => {
2927
const { t } = useTranslation("page-staking")
@@ -32,47 +30,29 @@ const CalloutBanner = ({
3230
<aside
3331
className={cn(
3432
"flex flex-col rounded p-8 sm:p-12 lg:flex-row-reverse",
35-
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20"
33+
"bg-gradient-to-r from-accent-a/10 to-accent-c/10 dark:from-accent-a/20 dark:to-accent-c-hover/20",
34+
className
3635
)}
3736
{...props}
3837
>
39-
{image && (
40-
<Flex>
41-
<Image
42-
src={image}
43-
alt={alt}
44-
width={imageWidth}
45-
style={{
46-
objectFit: "contain",
47-
}}
48-
mx="auto"
49-
mt={-24}
50-
mb={{ base: 0, lg: -24 }}
51-
/>
52-
</Flex>
53-
)}
54-
<Flex
55-
flexGrow={1}
56-
flexShrink={0}
57-
flexBasis="50%"
58-
direction="column"
59-
justifyContent="center"
60-
ps={{ base: 0, sm: 4, lg: 8 }}
61-
w={{ base: "full", lg: "inherit" }}
62-
>
63-
<OldHeading
64-
as="h2"
65-
mt={0}
66-
fontSize={{ base: "2xl", sm: "2rem" }}
67-
lineHeight="1.4"
68-
>
38+
<div className="flex">
39+
<TwImage
40+
src={image}
41+
alt={alt}
42+
width={imageWidth}
43+
className="-my-24 mx-auto object-contain max-lg:mb-0"
44+
/>
45+
</div>
46+
47+
<div className="flex w-full flex-shrink-0 flex-grow basis-1/2 flex-col justify-center sm:ps-4 lg:w-[inherit] lg:ps-8">
48+
<h2 className="mb-8 text-2xl leading-xs sm:text-[2rem]">
6949
{t(titleKey)}
70-
</OldHeading>
71-
<Text fontSize="xl" w="90%" lineHeight="140%" mb={8} color="text200">
50+
</h2>
51+
<p className="mb-8 w-[90%] text-xl text-body-medium">
7252
{t(descriptionKey)}
73-
</Text>
53+
</p>
7454
{children}
75-
</Flex>
55+
</div>
7656
</aside>
7757
)
7858
}

0 commit comments

Comments
 (0)