-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
index.js
50 lines (46 loc) · 1012 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { closeSmall } from '@wordpress/icons';
/**
* Internal dependencies
*/
import ComplementaryAreaToggle from '../complementary-area-toggle';
const ComplementaryAreaHeader = ( {
smallScreenTitle,
children,
className,
toggleButtonProps,
} ) => {
const toggleButton = (
<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />
);
return (
<>
<div className="components-panel__header interface-complementary-area-header__small">
{ smallScreenTitle && (
<span className="interface-complementary-area-header__small-title">
{ smallScreenTitle }
</span>
) }
{ toggleButton }
</div>
<div
className={ classnames(
'components-panel__header',
'interface-complementary-area-header',
className
) }
tabIndex={ -1 }
>
{ children }
{ toggleButton }
</div>
</>
);
};
export default ComplementaryAreaHeader;