@@ -173,9 +173,9 @@ const Appbar = ({
173173} : Props ) => {
174174 const theme = useInternalTheme ( themeOverrides ) ;
175175 const detectedInsets = useSafeAreaInsets ( ) ;
176- const { customBackground, restStyle, borderRadius } = React . useMemo ( ( ) => {
176+ const { customBackground, restStyle, borderStyles } = React . useMemo ( ( ) => {
177177 const flattenedStyle = StyleSheet . flatten ( style ) ;
178- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
178+
179179 const resolvedStyle = ( flattenedStyle || { } ) as Exclude <
180180 typeof flattenedStyle ,
181181 number
@@ -187,7 +187,7 @@ const Appbar = ({
187187 return {
188188 customBackground : backgroundColor ,
189189 restStyle : remainingStyle ,
190- borderRadius : getAppbarBorders ( remainingStyle ) ,
190+ borderStyles : getAppbarBorders ( remainingStyle ) ,
191191 } ;
192192 } , [ style ] ) ;
193193 const backgroundColor =
@@ -206,15 +206,11 @@ const Appbar = ({
206206 ) ;
207207 const sideStyle = React . useMemo ( ( ) => ( { width : sideWidth } ) , [ sideWidth ] ) ;
208208 const surfaceStyle = React . useMemo (
209- ( ) => [
210- {
211- backgroundColor,
212- paddingTop : topInset ,
213- paddingHorizontal : horizontalInset ,
214- } ,
215- borderRadius ,
216- ] ,
217- [ backgroundColor , borderRadius , horizontalInset , topInset ]
209+ ( ) => ( {
210+ paddingTop : topInset ,
211+ paddingHorizontal : horizontalInset ,
212+ } ) ,
213+ [ horizontalInset , topInset ]
218214 ) ;
219215 const appbarStyle = React . useMemo (
220216 ( ) => [ styles . appbar , { backgroundColor, minHeight } , restStyle ] ,
@@ -228,12 +224,18 @@ const Appbar = ({
228224 ? theme . colors . surfaceContainerHighest
229225 : theme . colors . surfaceContainer ;
230226 const resolvedSearchStyle = React . useMemo (
231- ( ) => [
232- styles . searchBar ,
233- { backgroundColor : searchBackgroundColor } ,
234- searchBar ?. style ,
235- ] ,
236- [ searchBackgroundColor , searchBar ?. style ]
227+ ( ) => [ styles . searchBar , searchBar ?. style ] ,
228+ [ searchBar ?. style ]
229+ ) ;
230+ const searchTheme = React . useMemo (
231+ ( ) => ( {
232+ ...theme ,
233+ colors : {
234+ ...theme . colors ,
235+ surfaceContainerHigh : searchBackgroundColor ,
236+ } ,
237+ } ) ,
238+ [ searchBackgroundColor , theme ]
237239 ) ;
238240 const {
239241 accessibilityLabel : _accessibilityLabel ,
@@ -286,7 +288,7 @@ const Appbar = ({
286288 elevation = { 0 }
287289 testID = { searchTestID }
288290 style = { resolvedSearchStyle }
289- theme = { theme }
291+ theme = { searchTheme }
290292 />
291293 </ View >
292294 </ View >
@@ -388,10 +390,11 @@ const Appbar = ({
388390
389391 return (
390392 < Surface
393+ { ...borderStyles }
391394 ref = { ref }
392395 testID = { `${ testID } -root-layer` }
396+ backgroundColor = { backgroundColor }
393397 elevation = { 0 }
394- container
395398 theme = { theme }
396399 style = { surfaceStyle }
397400 >
0 commit comments