Git Product home page Git Product logo

Comments (3)

satya164 avatar satya164 commented on May 8, 2024 2

@ahmedlhanafy I don't think so. I'd rather do
<Layer {...this.props} elevation={2} /> than doing
<View {...this.props} style={[ this.props.style, { elevation: elevationToShadow(2) } ]} /> to avoid unnecessary boilerplate everywhere.

from react-native-paper.

ahmedlhanafy avatar ahmedlhanafy commented on May 8, 2024

@satya164 i think this can be a function that takes an elevation value and returns the correct shadow, doing a component here is overkill

from react-native-paper.

himanshusoni avatar himanshusoni commented on May 8, 2024

We can take inspiration from the paper from material-ui.

I second satya, on creating a component over here. It may have a certain padding and transition. Also, since elevation is android only, i'd suggest something like below for styles

// Layer component definition
render() {
    <View style=[theme.prepareElevation(this.props.elevation), { otherStyles }] >
     {this.props.children}
    </View>
}

from react-native-paper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.