mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
feat: add ctaPosition to CallToActionSection
This commit is contained in:
@@ -185,6 +185,7 @@ import * as challengesData from '/generated/challenges.json'
|
||||
description="Nimbus is trusted by Etherem validators diverse in both size and operating requirements. But don't just take our word for it."
|
||||
href="https://nimbus.team"
|
||||
label="Get Nimbus"
|
||||
ctaPosition="top"
|
||||
target="_blank"
|
||||
/>
|
||||
<Box top={{ xs: 100, lg: 100 }}>
|
||||
|
||||
+12
@@ -43,6 +43,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
.mdx-cta-section__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
|
||||
button {
|
||||
padding: 6px 12px !important;
|
||||
font-size: 12px !important;
|
||||
line-height: 16px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mdx-cta-section--no-border {
|
||||
border: none !important;
|
||||
|
||||
|
||||
+21
-4
@@ -48,6 +48,10 @@ export type CallToActionSectionProps = Omit<
|
||||
* The variant of the button
|
||||
*/
|
||||
variant?: ButtonProps['variant']
|
||||
/**
|
||||
* The position of the call-to-action button
|
||||
*/
|
||||
ctaPosition?: 'top' | 'bottom'
|
||||
/**
|
||||
* A list of items to display in the section
|
||||
*/
|
||||
@@ -132,6 +136,7 @@ export const CallToActionSection: React.FC<CallToActionSectionProps> = ({
|
||||
className,
|
||||
children,
|
||||
variant = 'outlined',
|
||||
ctaPosition = 'bottom',
|
||||
...props
|
||||
}) => {
|
||||
const withDescription = !!description
|
||||
@@ -165,13 +170,25 @@ export const CallToActionSection: React.FC<CallToActionSectionProps> = ({
|
||||
align !== 'unset' && `mdx-cta-section--align-${align}`,
|
||||
)}
|
||||
>
|
||||
<Typography component="h2" className="mdx-cta-section__title">
|
||||
{title}
|
||||
</Typography>
|
||||
<div className="mdx-cta-section__header">
|
||||
<Typography component="h2" className="mdx-cta-section__title">
|
||||
{title}
|
||||
</Typography>
|
||||
{href && ctaPosition === 'top' && (
|
||||
<CallToActionButton
|
||||
target={target}
|
||||
href={href}
|
||||
className="mdx-cta-section__link"
|
||||
variant={variant}
|
||||
>
|
||||
{label}
|
||||
</CallToActionButton>
|
||||
)}
|
||||
</div>
|
||||
<Typography component="h3" className="mdx-cta-section__description">
|
||||
{description}
|
||||
</Typography>
|
||||
{href && (
|
||||
{href && ctaPosition === 'bottom' && (
|
||||
<CallToActionButton
|
||||
target={target}
|
||||
href={href}
|
||||
|
||||
Reference in New Issue
Block a user