@@ -6,31 +6,24 @@ import { Container } from "../../components/basic.js";
66import { Spacer } from "../../components/Spacer.js" ;
77import { Text } from "../../components/text.js" ;
88
9- export function WithHeader ( {
10- children,
11- title,
12- description,
13- image,
14- client,
15- } : {
9+ export function WithHeader ( props : {
1610 children : React . ReactNode ;
1711 title : string ;
1812 description : string | undefined ;
1913 image : string | undefined ;
2014 client : ThirdwebClient ;
2115} ) {
2216 const theme = useCustomTheme ( ) ;
23- const showTitle = title !== "" ;
2417
2518 return (
2619 < Container flex = "column" >
2720 { /* image */ }
28- { image && (
21+ { props . image && (
2922 < div
3023 style = { {
3124 aspectRatio : "16/9" ,
3225 backgroundColor : theme . colors . tertiaryBg ,
33- backgroundImage : `url(${ getUrl ( client , image ) } )` ,
26+ backgroundImage : `url(${ getUrl ( props . client , props . image ) } )` ,
3427 backgroundPosition : "center" ,
3528 backgroundSize : "cover" ,
3629 borderRadius : `${ radius . md } ${ radius . md } 0 0` ,
@@ -43,21 +36,21 @@ export function WithHeader({
4336 < Container flex = "column" px = "md" >
4437 < Spacer y = "md+" />
4538
46- { ( showTitle || description ) && (
39+ { ( props . title || props . description ) && (
4740 < >
4841 { /* title */ }
49- { showTitle && (
42+ { props . title && (
5043 < Text color = "primaryText" size = "lg" weight = { 600 } >
51- { title }
44+ { props . title }
5245 </ Text >
5346 ) }
5447
5548 { /* Description */ }
56- { description && (
49+ { props . description && (
5750 < >
5851 < Spacer y = "xxs" />
5952 < Text color = "secondaryText" size = "sm" multiline >
60- { description }
53+ { props . description }
6154 </ Text >
6255 </ >
6356 ) }
@@ -66,7 +59,7 @@ export function WithHeader({
6659 </ >
6760 ) }
6861
69- { children }
62+ { props . children }
7063 </ Container >
7164 </ Container >
7265 ) ;
0 commit comments