Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/components/DocsTables.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
import { Stack, StackItem } from '@patternfly/react-core'
import PropsTables from './PropsTables.astro'
import CSSTable from './CSSTable.astro'

const { propComponents, cssPrefix } = Astro.props

const hasTables = !!propComponents || !!cssPrefix
---

<>
{
hasTables && (
<Stack hasGutter>
{propComponents && (
<StackItem>
<PropsTables propComponents={propComponents} server:defer />
</StackItem>
)}
{cssPrefix && (
<StackItem>
<CSSTable cssPrefix={cssPrefix} server:defer />
</StackItem>
)}
</Stack>
)
}
</>
18 changes: 7 additions & 11 deletions src/pages/[section]/[...page].astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
import { getCollection, render } from 'astro:content'
import { Title, PageSection, Stack, StackItem } from '@patternfly/react-core'
import { Title, PageSection } from '@patternfly/react-core'
import MainLayout from '../../layouts/Main.astro'
import { content } from '../../content'
import { kebabCase } from '../../utils/case'
import { componentTabs } from '../../globals'
import PropsTables from '../../components/PropsTables.astro'
import CSSTable from '../../components/CSSTable.astro'
import SectionGallery from '../../components/section-gallery/SectionGallery.astro'
import LiveExample from '../../components/LiveExample.astro'
import {
Expand All @@ -29,6 +27,7 @@ import {
dt,
dd,
} from '../../components/Content'
import DocsTables from '../../components/DocsTables.astro'

export async function getStaticPaths() {
const collections = await Promise.all(
Expand Down Expand Up @@ -91,13 +90,10 @@ if (section === 'components' && componentTabs[id]) {
LiveExample,
}}
/>
<Stack hasGutter>
<StackItem>
<PropsTables propComponents={propComponents} server:defer />
</StackItem>
<StackItem>
<CSSTable cssPrefix={cssPrefix} server:defer />
</StackItem>
</Stack>
<DocsTables
propComponents={propComponents}
cssPrefix={cssPrefix}
server:defer
/>
</PageSection>
</MainLayout>
14 changes: 3 additions & 11 deletions src/pages/[section]/[page]/[...tab].astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
import { getCollection, render } from 'astro:content'
import { Title, PageSection, Stack, StackItem } from '@patternfly/react-core'
import { Title, PageSection } from '@patternfly/react-core'
import MainLayout from '../../../layouts/Main.astro'
import { content } from '../../../content'
import { kebabCase } from '../../../utils/case'
import { componentTabs, tabNames, buildTab, sortTabs } from '../../../globals'
import PropsTables from '../../../components/PropsTables.astro'
import {
h1,
h2,
Expand All @@ -27,7 +26,7 @@ import {
dd,
} from '../../../components/Content'
import LiveExample from '../../../components/LiveExample.astro'
import CSSTable from '../../../components/CSSTable.astro'
import DocsTables from '../../../components/DocsTables.astro'

export async function getStaticPaths() {
const collections = await Promise.all(
Expand Down Expand Up @@ -126,13 +125,6 @@ const currentPath = Astro.url.pathname
LiveExample,
}}
/>
<Stack hasGutter>
<StackItem>
<PropsTables propComponents={propComponents} server:defer />
</StackItem>
<StackItem>
<CSSTable cssPrefix={cssPrefix} server:defer />
</StackItem>
</Stack>
<DocsTables propComponents={propComponents} cssPrefix={cssPrefix} server:defer />
</PageSection>
</MainLayout>