Skip to content

fix: add elevation to wrapper style#1319

Merged
Trancever merged 1 commit intocallstack:masterfrom
pan-pawel:fix/elevation-in-appbar-header
Sep 2, 2019
Merged

fix: add elevation to wrapper style#1319
Trancever merged 1 commit intocallstack:masterfrom
pan-pawel:fix/elevation-in-appbar-header

Conversation

@pan-pawel
Copy link
Copy Markdown
Contributor

@pan-pawel pan-pawel commented Aug 31, 2019

Resolve #1225

Motivation

Without property elevation in wrapper style there is no shadow on android.
Screenshot 2019-08-31 at 17 58 37
Screenshot 2019-08-31 at 17 54 49

With elevation added to wrapper style

<Wrapper
        style={
          [
            { backgroundColor, zIndex, elevation },
            shadow(elevation),
          ] as StyleProp<ViewStyle>
        }
      >

Screenshot 2019-08-31 at 17 52 09

Screenshot 2019-08-31 at 17 52 52

Additional
since we have default elevation value

const {
  [..]
  elevation = 4,
  [..]
} = StyleSheet.flatten(style) || {};

we don't need to check if it's present

elevation &&  shadow(elevation),

so

shadow(elevation),

isn't enough?

@callstack-bot
Copy link
Copy Markdown

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

@pan-pawel pan-pawel changed the title WIP: add elevation to wrapper style fix: add elevation to wrapper style Aug 31, 2019
@Trancever Trancever merged commit 403bfd3 into callstack:master Sep 2, 2019
@franziz
Copy link
Copy Markdown

franziz commented Sep 2, 2019

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elevation on the AppBar.Header

4 participants