Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix button text missing in preview and old flow #447

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading