Skip to content

Commit

Permalink
Merge pull request #447 from newfold-labs/fix/preview-button-text
Browse files Browse the repository at this point in the history
Fix button text missing in preview and old flow
  • Loading branch information
arunshenoy99 authored Feb 1, 2024
2 parents a37d1de + 9e31a14 commit 3ca0dc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 8 additions & 12 deletions src/OnboardingSPA/components/Button/NavCardButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,16 @@ const NavCardButton = ( { text, disabled, className, icon } ) => {
return (
<Button
className={ classNames( 'nfd-nav-card-button', className ) }
text={
<>
<span className={ `${ className }__text` }>{ text }</span>
{ icon && (
<Icon
className={ `${ className }__icon` }
icon={ icon }
/>
) }
</>
}
handleClick={ handleBtnClick }
disabled={ disabled }
/>
>
<>
<span className={ `${ className }__text` }>{ text }</span>
{ icon && (
<Icon className={ `${ className }__icon` } icon={ icon } />
) }
</>
</Button>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/OnboardingSPA/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* @return Button
*/

const Button = ( { text, handleClick, disabled, className } ) => {
const Button = ( { children, handleClick, disabled, className } ) => {
const handleBtnClick = () => {
if ( handleClick ) {
if ( typeof handleClick === 'function' ) {
handleClick();
}
};
Expand All @@ -19,7 +19,7 @@ const Button = ( { text, handleClick, disabled, className } ) => {
onClick={ handleBtnClick }
disabled={ disabled }
>
{ text }
{ children }
</button>
);
};
Expand Down

0 comments on commit 3ca0dc8

Please sign in to comment.