MCPcopy Index your code
hub / github.com/callstack/react-native-paper / getStyleForShadowLayer

Function getStyleForShadowLayer

src/components/Surface.tsx:116–151  ·  view source on GitHub ↗
(
  elevation: Elevation,
  layer: 0 | 1
)

Source from the content-addressed store, hash-verified

114];
115const inputRange = [0, 1, 2, 3, 4, 5];
116function 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
153const SurfaceIOS = forwardRef<
154 View,

Callers 1

Surface.tsxFile · 0.85

Calls 1

isAnimatedValueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…