From 8c013aa2a99c9813cf29bf3025d406859af6f6cd Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Sat, 29 Jan 2022 13:45:36 +0530 Subject: [PATCH] Make title prop as node in PopupWindow component Signed-off-by: Ajay Bura --- src/app/molecules/popup-window/PopupWindow.jsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/molecules/popup-window/PopupWindow.jsx b/src/app/molecules/popup-window/PopupWindow.jsx index ae2a2d48..43e421ea 100644 --- a/src/app/molecules/popup-window/PopupWindow.jsx +++ b/src/app/molecules/popup-window/PopupWindow.jsx @@ -54,6 +54,7 @@ function PopupWindow({ onRequestClose, children, }) { const haveDrawer = drawer !== null; + const cTitle = contentTitle !== null ? contentTitle : title; return ( - {twemojify(title)} + { + typeof title === 'string' + ? {twemojify(title)} + : title + } {drawerOptions} @@ -84,7 +89,11 @@ function PopupWindow({
- {twemojify(contentTitle !== null ? contentTitle : title)} + { + typeof cTitle === 'string' + ? {twemojify(cTitle)} + : cTitle + } {contentOptions}
@@ -113,8 +122,8 @@ PopupWindow.defaultProps = { PopupWindow.propTypes = { className: PropTypes.string, isOpen: PropTypes.bool.isRequired, - title: PropTypes.string.isRequired, - contentTitle: PropTypes.string, + title: PropTypes.node.isRequired, + contentTitle: PropTypes.node, drawer: PropTypes.node, drawerOptions: PropTypes.node, contentOptions: PropTypes.node,