mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-04 12:47:14 +02:00
fix(theme): <Admonition>
should render properly without heading/icon (#10080)
This commit is contained in:
parent
3ee776050e
commit
c967ea5b4a
2 changed files with 15 additions and 1 deletions
|
@ -50,7 +50,7 @@ export default function AdmonitionLayout(props: Props): JSX.Element {
|
||||||
const {type, icon, title, children, className} = props;
|
const {type, icon, title, children, className} = props;
|
||||||
return (
|
return (
|
||||||
<AdmonitionContainer type={type} className={className}>
|
<AdmonitionContainer type={type} className={className}>
|
||||||
<AdmonitionHeading title={title} icon={icon} />
|
{title || icon ? <AdmonitionHeading title={title} icon={icon} /> : null}
|
||||||
<AdmonitionContent>{children}</AdmonitionContent>
|
<AdmonitionContent>{children}</AdmonitionContent>
|
||||||
</AdmonitionContainer>
|
</AdmonitionContainer>
|
||||||
);
|
);
|
||||||
|
|
|
@ -333,6 +333,20 @@ test
|
||||||
|
|
||||||
::::
|
::::
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
|
import Admonition from '@theme/Admonition';
|
||||||
|
|
||||||
|
export function AdmonitionWithoutHeading(props) {
|
||||||
|
return (
|
||||||
|
<Admonition {...props} type="info" icon={null} title={null}>
|
||||||
|
Admonition content without heading
|
||||||
|
</Admonition>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<AdmonitionWithoutHeading />
|
||||||
|
|
||||||
## Linking
|
## Linking
|
||||||
|
|
||||||
This is a test page to see if Docusaurus Markdown features are working properly
|
This is a test page to see if Docusaurus Markdown features are working properly
|
||||||
|
|
Loading…
Add table
Reference in a new issue