Skip to content

Commit

Permalink
add two column text
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Oct 22, 2024
1 parent 9934c25 commit 50a0e3a
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 3 deletions.
29 changes: 29 additions & 0 deletions src/components/custom-page/TwoColumnText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Markdown } from '@pluralsh/design-system'

import { type TwoColumnTextComponentFragment } from '@src/generated/graphqlDirectus'

import { cn } from '../cn'

import { getSpacingClassName } from './common'

export function TwoColumnText({
spacing,
main_content: mainContent,
side_content: sideContent,
}: TwoColumnTextComponentFragment) {
return (
<section
className={cn(
getSpacingClassName(spacing),
'mx-xxxxxxlarge flex gap-xxlarge'
)}
>
<div className="w-2/3">
<Markdown text={mainContent} />
</div>
<div className="w-1/3">
<Markdown text={sideContent} />
</div>
</section>
)
}
3 changes: 3 additions & 0 deletions src/components/custom-page/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { LargeImage } from './LargeImage'
import { LogoStrip } from './LogoStrip'
import { MultiColumnText } from './MultiColumnText'
import { SectionHeader } from './SectionHeader'
import { TwoColumnText } from './TwoColumnText'

const spacingToClassName = {
relaxed: 'my-[192px]',
Expand Down Expand Up @@ -37,6 +38,8 @@ export function renderComponent(
return <Cards {...component} />
case 'blog_cards':
return <BlogCards {...component} />
case 'two_column_text':
return <TwoColumnText {...component} />
case 'multi_column_text':
return <MultiColumnText {...component} />
case 'customer_quote':
Expand Down
Loading

0 comments on commit 50a0e3a

Please sign in to comment.