({
actions,
icon,
open,
onPress,
onLongPress,
toggleStackOnLongPress,
accessibilityLabel,
theme: themeOverrides,
style,
fabStyle,
visible,
label,
testID,
onStateChange,
color: colorProp,
delayLongPress = 200,
variant = 'primary',
enableLongPressWhenStackOpened = false,
backdropColor: customBackdropColor,
rippleColor,
}: Props)
| 202 | * ``` |
| 203 | */ |
| 204 | const FABGroup = ({ |
| 205 | actions, |
| 206 | icon, |
| 207 | open, |
| 208 | onPress, |
| 209 | onLongPress, |
| 210 | toggleStackOnLongPress, |
| 211 | accessibilityLabel, |
| 212 | theme: themeOverrides, |
| 213 | style, |
| 214 | fabStyle, |
| 215 | visible, |
| 216 | label, |
| 217 | testID, |
| 218 | onStateChange, |
| 219 | color: colorProp, |
| 220 | delayLongPress = 200, |
| 221 | variant = 'primary', |
| 222 | enableLongPressWhenStackOpened = false, |
| 223 | backdropColor: customBackdropColor, |
| 224 | rippleColor, |
| 225 | }: Props) => { |
| 226 | const theme = useInternalTheme(themeOverrides); |
| 227 | const { top, bottom, right, left } = useSafeAreaInsets(); |
| 228 | |
| 229 | const { current: backdrop } = React.useRef<Animated.Value>( |
| 230 | new Animated.Value(0) |
| 231 | ); |
| 232 | const animations = React.useRef<Animated.Value[]>( |
| 233 | actions.map(() => new Animated.Value(open ? 1 : 0)) |
| 234 | ); |
| 235 | |
| 236 | const [isClosingAnimationFinished, setIsClosingAnimationFinished] = |
| 237 | React.useState(false); |
| 238 | |
| 239 | const [prevActions, setPrevActions] = React.useState< |
| 240 | | { |
| 241 | icon: IconSource; |
| 242 | label?: string; |
| 243 | color?: string; |
| 244 | accessibilityLabel?: string; |
| 245 | style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>; |
| 246 | onPress: (e: GestureResponderEvent) => void; |
| 247 | testID?: string; |
| 248 | }[] |
| 249 | | null |
| 250 | >(null); |
| 251 | |
| 252 | const { scale } = theme.animation; |
| 253 | const { isV3 } = theme; |
| 254 | |
| 255 | React.useEffect(() => { |
| 256 | if (open) { |
| 257 | setIsClosingAnimationFinished(false); |
| 258 | Animated.parallel([ |
| 259 | Animated.timing(backdrop, { |
| 260 | toValue: 1, |
| 261 | duration: 250 * scale, |
nothing calls this directly
no test coverage detected
searching dependent graphs…