Skip to content

Commit

Permalink
Translate buttons to yoast buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
leonidasmi committed Sep 20, 2024
1 parent 91a176a commit 9d5ee06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/js/src/helpers/moveNotices.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ export function moveNotices() {
const content = allNotices.map( notice => notice.querySelector( ".notice-yoast-content" ) );
const buttons = allNotices.map( notice => notice.querySelector( "button.notice-dismiss" ) );

// Transform the buttons to Yoast buttons.
content.forEach( noticeContent => {
if ( noticeContent ) {
noticeContent.querySelectorAll( "a.button" ).forEach( button => {
button.classList.remove( "button" );
button.classList.add( "yst-button" );
button.classList.add( "yst-button--primary" );
button.classList.add( "yst-mt-4" );
} );
}
} );

const notices = allNotices.map( ( notice, index ) => ( {
notice: notice,
id: ids[ index ],
Expand Down

0 comments on commit 9d5ee06

Please sign in to comment.