How to use the reactxp.Styles.combine function in reactxp

To help you get started, we’ve selected a few reactxp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / reactxp / extensions / navigation / src / web / Navigator.tsx View on Github external
private _enableScene(sceneIndex: number, force = false) {
        let sceneStyle = Styles.combine([_styles.baseScene, _styles.sceneStyle, _styles.defaultSceneStyle]) as any;

        // Then restore the top value for this scene.
        const enabledSceneNativeProps = {
            style: {
                top: sceneStyle['top'],
                bottom: sceneStyle['bottom'],
                opacity: 1,
                zIndex: 0,
                transform: ''
            }
        };

        if (!force && sceneIndex !== this.state.transitionFromIndex &&
            sceneIndex !== this.state.presentedIndex) {
            // If we are not in a transition from this index, make sure opacity is 0 to prevent the enabled scene from
            // flashing over the presented scene.
github microsoft / reactxp / extensions / imagesvg / src / web / ImageSvg.tsx View on Github external
render() {
        assert(this.props.width && this.props.height, 'The width and height on imagesvg are mandatory.');

        if (this.props.width > 0 && this.props.height > 0) {
            let combinedStyles = RXStyles.combine([{
                display: 'flex',
                position: 'relative'
            } as any, this.props.style]) as any;

            if (this.props.fillColor !== undefined) {
                combinedStyles.fill = this.props.fillColor;
            }

            if (this.props.fillOpacity !== undefined) {
                combinedStyles.fillOpacity = this.props.fillOpacity.toString();
            }

            if (this.props.strokeColor !== undefined) {
                combinedStyles.stroke = this.props.strokeColor;
            }

reactxp

Cross-platform abstraction layer for writing React-based applications a single time that work identically across web, React Native, and Electron distribution

MIT
Latest version published 5 years ago

Package Health Score

59 / 100
Full package analysis