mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Fix infobox with ID [ci skip]
This commit is contained in:
parent
02b69dd0d5
commit
a9da33c4d9
|
@ -1,4 +1,4 @@
|
||||||
import React from 'react'
|
import React, { Fragment } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
|
||||||
|
@ -14,13 +14,14 @@ export default function Infobox({
|
||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
}) {
|
}) {
|
||||||
|
const Wrapper = id ? 'div' : Fragment
|
||||||
const infoboxClassNames = classNames(classes.root, className, {
|
const infoboxClassNames = classNames(classes.root, className, {
|
||||||
[classes.list]: !!list,
|
[classes.list]: !!list,
|
||||||
[classes.warning]: variant === 'warning',
|
[classes.warning]: variant === 'warning',
|
||||||
[classes.danger]: variant === 'danger',
|
[classes.danger]: variant === 'danger',
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<>
|
<Wrapper>
|
||||||
{id && <a id={id} />}
|
{id && <a id={id} />}
|
||||||
<aside className={infoboxClassNames}>
|
<aside className={infoboxClassNames}>
|
||||||
{title && (
|
{title && (
|
||||||
|
@ -40,7 +41,7 @@ export default function Infobox({
|
||||||
)}
|
)}
|
||||||
{children}
|
{children}
|
||||||
</aside>
|
</aside>
|
||||||
</>
|
</Wrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user