diff --git a/src/components/DocsTables.astro b/src/components/DocsTables.astro new file mode 100644 index 0000000..81f3ffe --- /dev/null +++ b/src/components/DocsTables.astro @@ -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 && ( + + {propComponents && ( + + + + )} + {cssPrefix && ( + + + + )} + + ) + } + diff --git a/src/pages/[section]/[...page].astro b/src/pages/[section]/[...page].astro index 2bfea28..3d8b86c 100644 --- a/src/pages/[section]/[...page].astro +++ b/src/pages/[section]/[...page].astro @@ -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 { @@ -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( @@ -91,13 +90,10 @@ if (section === 'components' && componentTabs[id]) { LiveExample, }} /> - - - - - - - - + diff --git a/src/pages/[section]/[page]/[...tab].astro b/src/pages/[section]/[page]/[...tab].astro index d7bf1f8..311d17a 100644 --- a/src/pages/[section]/[page]/[...tab].astro +++ b/src/pages/[section]/[page]/[...tab].astro @@ -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, @@ -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( @@ -126,13 +125,6 @@ const currentPath = Astro.url.pathname LiveExample, }} /> - - - - - - - - +