Add ability to pass node in dialog title
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
76a5c99b08
commit
44544f3289
1 changed files with 6 additions and 2 deletions
|
@ -27,7 +27,11 @@ function Dialog({
|
||||||
<div className="dialog__content">
|
<div className="dialog__content">
|
||||||
<Header>
|
<Header>
|
||||||
<TitleWrapper>
|
<TitleWrapper>
|
||||||
<Text variant="h2" weight="medium" primary>{twemojify(title)}</Text>
|
{
|
||||||
|
typeof title === 'string'
|
||||||
|
? <Text variant="h2" weight="medium" primary>{twemojify(title)}</Text>
|
||||||
|
: title
|
||||||
|
}
|
||||||
</TitleWrapper>
|
</TitleWrapper>
|
||||||
{contentOptions}
|
{contentOptions}
|
||||||
</Header>
|
</Header>
|
||||||
|
@ -56,7 +60,7 @@ Dialog.defaultProps = {
|
||||||
Dialog.propTypes = {
|
Dialog.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
isOpen: PropTypes.bool.isRequired,
|
isOpen: PropTypes.bool.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.node.isRequired,
|
||||||
contentOptions: PropTypes.node,
|
contentOptions: PropTypes.node,
|
||||||
onAfterOpen: PropTypes.func,
|
onAfterOpen: PropTypes.func,
|
||||||
onAfterClose: PropTypes.func,
|
onAfterClose: PropTypes.func,
|
||||||
|
|
Loading…
Reference in a new issue