1- import XIcon from "@heroicons/react/outline/XIcon" ;
21import { useDispatch } from "@wordpress/data" ;
32import { useCallback } from "@wordpress/element" ;
43import { __ } from "@wordpress/i18n" ;
5- import { useSvgAria } from "@yoast/ui-library" ;
64import classNames from "classnames" ;
75import PropTypes from "prop-types" ;
86import { STORE_NAME } from "../constants" ;
@@ -19,7 +17,6 @@ import { STORE_NAME } from "../constants";
1917 * @returns {JSX.Element } The Notice.
2018 */
2119export function Notice ( { title, id, isDismissable, children, className = "" } ) {
22- const ariaSvgProps = useSvgAria ( ) ;
2320 const { dismissNotice } = useDispatch ( STORE_NAME ) ;
2421
2522 const handleDismiss = useCallback ( ( ) => {
@@ -30,22 +27,15 @@ export function Notice( { title, id, isDismissable, children, className = "" } )
3027 } , [ dismissNotice , id ] ) ;
3128
3229 return (
33- < div id = { id } className = { classNames ( "yst-p-3 yst-rounded-md yoast-general-page-notice" , className ) } >
30+ < div id = { id } className = { classNames ( "yst-p-3 yst-rounded-md yoast-general-page-notice yst-relative " , className ) } >
3431 < div className = "yst-flex yst-flex-row yst-items-center yst-min-h-[24px]" >
3532 < span className = "yoast-icon" />
3633 { title && < div className = "yst-text-sm yst-font-medium" dangerouslySetInnerHTML = { { __html : title } } /> }
37- { isDismissable &&
38- < div className = "yst-relative yst-ms-auto" >
39- < button
40- type = "button"
41- className = "notice-dismiss"
42- onClick = { handleDismiss }
43- >
44- < span className = "yst-sr-only" > { __ ( "Close" , "wordpress-seo" ) } </ span >
45- < XIcon className = "yst-h-5 yst-w-5" { ...ariaSvgProps } />
46- </ button >
47- </ div >
48- }
34+ { isDismissable && (
35+ < button type = "button" className = "notice-dismiss" onClick = { handleDismiss } >
36+ < span className = "yst-sr-only" > { __ ( "Close" , "wordpress-seo" ) } </ span >
37+ </ button >
38+ ) }
4939 </ div >
5040 { children && (
5141 < div className = "yst-flex-1 yst-text-sm yst-max-w-[600px] yst-ps-[29px]" dangerouslySetInnerHTML = { { __html : children } } />
0 commit comments