( elevation: Elevation, layer: 0 | 1 )
| 114 | ]; |
| 115 | const inputRange = [0, 1, 2, 3, 4, 5]; |
| 116 | function getStyleForShadowLayer( |
| 117 | elevation: Elevation, |
| 118 | layer: 0 | 1 |
| 119 | ): Animated.WithAnimatedValue<ShadowStyleIOS> { |
| 120 | if (isAnimatedValue(elevation)) { |
| 121 | return { |
| 122 | shadowColor, |
| 123 | shadowOpacity: elevation.interpolate({ |
| 124 | inputRange: [0, 1], |
| 125 | outputRange: [0, iOSShadowOutputRanges[layer].shadowOpacity], |
| 126 | extrapolate: 'clamp', |
| 127 | }), |
| 128 | shadowOffset: { |
| 129 | width: 0, |
| 130 | height: elevation.interpolate({ |
| 131 | inputRange, |
| 132 | outputRange: iOSShadowOutputRanges[layer].height, |
| 133 | }), |
| 134 | }, |
| 135 | shadowRadius: elevation.interpolate({ |
| 136 | inputRange, |
| 137 | outputRange: iOSShadowOutputRanges[layer].shadowRadius, |
| 138 | }), |
| 139 | }; |
| 140 | } |
| 141 | |
| 142 | return { |
| 143 | shadowColor, |
| 144 | shadowOpacity: elevation ? iOSShadowOutputRanges[layer].shadowOpacity : 0, |
| 145 | shadowOffset: { |
| 146 | width: 0, |
| 147 | height: iOSShadowOutputRanges[layer].height[elevation], |
| 148 | }, |
| 149 | shadowRadius: iOSShadowOutputRanges[layer].shadowRadius[elevation], |
| 150 | }; |
| 151 | } |
| 152 | |
| 153 | const SurfaceIOS = forwardRef< |
| 154 | View, |
no test coverage detected
searching dependent graphs…