PluginProbe
Code Snippets / 3.9.6
Code Snippets v3.9.6
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / common / DismissableNotice.tsx

DismissableNotice.tsx in Code Snippets 3.9.6, at js/components/common/DismissableNotice.tsx

23 lines 700 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n'
2 import classnames from 'classnames'
3 import React from 'react'
4 import type { ReactNode } from 'react'
5
6 export interface DismissibleNoticeProps {
7 className?: classnames.Argument
8 onDismiss: VoidFunction
9 children?: ReactNode
10 }
11
12 export const DismissibleNotice: React.FC<DismissibleNoticeProps> = ({ className, onDismiss, children }) =>
13 <div id="message" className={classnames('notice fade is-dismissible', className)}>
14 <>{children}</>
15
16 <button type="button" className="notice-dismiss" onClick={event => {
17 event.preventDefault()
18 onDismiss()
19 }}>
20 <span className="screen-reader-text">{__('Dismiss notice.', 'code-snippets')}</span>
21 </button>
22 </div>
23