File tree Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Expand file tree Collapse file tree 4 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export function App() {
45
45
</ header >
46
46
< div className = "container two-columns" >
47
47
< div className = "left-column" >
48
- < Panel header = "categories" >
48
+ < Panel header = "categories" footer = "This is a footer" >
49
49
< HierarchicalMenu
50
50
attributes = { [
51
51
'hierarchicalCategories.lvl0' ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
3
type PanelProps = React . PropsWithChildren < {
4
- header : string ;
4
+ header ?: React . ReactNode ;
5
+ footer ?: React . ReactNode ;
5
6
} > ;
6
7
7
- export function Panel ( { header, children } : PanelProps ) {
8
+ export function Panel ( { header, children, footer } : PanelProps ) {
8
9
return (
9
10
< div className = "ais-Panel" >
10
- < div className = "ais-Panel-header" >
11
- < span > { header } </ span >
12
- </ div >
11
+ { Boolean ( header ) && (
12
+ < div className = "ais-Panel-header" >
13
+ < span > { header } </ span >
14
+ </ div >
15
+ ) }
13
16
< div className = "ais-Panel-body" > { children } </ div >
17
+ { Boolean ( footer ) && < div className = "ais-Panel-footer" > { footer } </ div > }
14
18
</ div >
15
19
) ;
16
20
}
Original file line number Diff line number Diff line change 7
7
@import url ('searchbox.css' );
8
8
@import url ('hierarchical-menu.css' );
9
9
@import url ('refinement-list.css' );
10
+ @import url ('panel.css' );
Original file line number Diff line number Diff line change
1
+ .ais-Panel-header {
2
+ display : flex;
3
+ align-items : center;
4
+ padding : var (--ais-spacing );
5
+ border-bottom : 1px solid
6
+ rgba (var (--ais-border-color-rgb ), var (--ais-border-color-alpha ));
7
+ margin-bottom : var (--ais-spacing );
8
+ font-weight : var (--ais-font-weight-medium );
9
+ text-transform : capitalize;
10
+ }
11
+
12
+ .ais-Panel-footer {
13
+ margin-top : calc (var (--ais-spacing ) * 0.5 );
14
+ font-size : 0.9em ;
15
+ }
You can’t perform that action at this time.
0 commit comments