react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

fix: Allow passthrough of safeAreaInsets on Appbar.Header

Open chrysb opened this issue 11 months ago • 3 comments

Motivation

If you use Appbar.Header within a <SafeAreaView> — there's no way to remove the top padding if you don't want it.

safeAreaInsets is a valid prop for this component, but setting it does nothing.

    <Appbar.Header
      safeAreaInsets={{ top: 0 }}
    >

This PR allows developers to have control over the insets of this component.

Test plan

This is a two line change, but as I'm not intimately familiar with this repo, I might be overlooking something.

To test, simply modify the safeAreaInsets on the Appbar.Header to modify the top padding.

chrysb avatar Mar 03 '24 23:03 chrysb

Hey @chrysb, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Mar 03 '24 23:03 callstack-bot

Hey @gedu! Could you also please add this to the 5.12.4 milestone?

Genio2003 avatar May 28 '24 20:05 Genio2003

Hey, please link to the GH issue where this was discussed.

Why not using the statusBarHeight prop?

<Appbar.Header
      statusBarHeight={0}
    >

or

<Appbar.Header
     statusBarHeight={safeAreaInsets.top}
   >    

Or I'm missing something?

gedu avatar May 29 '24 06:05 gedu