Skip to content

Commit

Permalink
Do not display bundle size difference text if there is one import
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Apr 19, 2024
1 parent 6f60700 commit 7785de0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/src/modules/components/ApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ export default function ApiPage(props) {
`)}
language="jsx"
/>
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
{pageContent.imports.length > 1 && (
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
)}
{componentDescription ? (
<React.Fragment>
<br />
Expand Down
4 changes: 3 additions & 1 deletion docs/src/modules/components/ComponentsApiContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ export default function ComponentsApiContent(props) {
<Heading hash={componentNameKebabCase} text={`${componentName} API`} />
<Heading text="import" hash={`${componentNameKebabCase}-import`} level="h3" />
<HighlightedCode code={importInstructions} language="jsx" />
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
{imports.length > 1 && (
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
)}
<PropertiesSection
properties={componentProps}
propertiesDescriptions={propDescriptions}
Expand Down
4 changes: 3 additions & 1 deletion docs/src/modules/components/HooksApiContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export default function HooksApiContent(props) {
<Heading hash={hookNameKebabCase} text={`${hookName} API`} />
<Heading text="import" hash={`${hookNameKebabCase}-import`} level="h3" />
<HighlightedCode code={importInstructions} language="jsx" />
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
{imports.length > 1 && (
<p dangerouslySetInnerHTML={{ __html: t('api-docs.importDifference') }} />
)}
{Object.keys(parameters).length > 0 ? (
<PropertiesSection
properties={parameters}
Expand Down

0 comments on commit 7785de0

Please sign in to comment.