Fix infobox with ID [ci skip]

This commit is contained in:
Ines Montani 2020-09-23 13:00:56 +02:00
parent 02b69dd0d5
commit a9da33c4d9
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import React from 'react'
import React, { Fragment } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
@ -14,13 +14,14 @@ export default function Infobox({
className,
children,
}) {
const Wrapper = id ? 'div' : Fragment
const infoboxClassNames = classNames(classes.root, className, {
[classes.list]: !!list,
[classes.warning]: variant === 'warning',
[classes.danger]: variant === 'danger',
})
return (
<>
<Wrapper>
{id && <a id={id} />}
<aside className={infoboxClassNames}>
{title && (
@ -40,7 +41,7 @@ export default function Infobox({
)}
{children}
</aside>
</>
</Wrapper>
)
}