Skip to content

Commit

Permalink
chore: Remove props and examples sections from api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 6, 2020
1 parent a2ff76d commit cca78bf
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions src/templates/ApiDocTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ const ApiDocTemplate = ({ data }) => {
const { title, description, component } = frontmatter;
const componentDoc = useComponentDoc(component);

const {
examples = [],
description: componentDescription,
methods = [],
usage = '',
propTypes = [],
} = componentDoc ?? {};
const { description: componentDescription, methods = [], usage = '' } =
componentDoc ?? {};

return (
<Layout>
Expand All @@ -58,31 +53,9 @@ const ApiDocTemplate = ({ data }) => {
<InlineCodeSnippet language="js">{usage}</InlineCodeSnippet>
</section>

{examples.length > 0 && (
<section className={styles.section}>
<h2>Examples</h2>
<div>
{examples.map((example, i) => (
<ComponentExample
key={i}
useToastManager={component === 'Toast'}
className={styles.componentExample}
example={example}
previewStyle={previewStyles[component]}
/>
))}
</div>
</section>
)}

<section className={styles.section}>
<h2>Props</h2>
<PropList propTypes={propTypes} />
</section>

{methods.length > 0 && (
<section className={styles.section}>
<h2>Methods</h2>
<h2>API methods</h2>
{methods.map((method, i) => (
<Fragment key={i}>
<h3 className={styles.methodName}>{method.name}</h3>
Expand Down

0 comments on commit cca78bf

Please sign in to comment.