// Metro module 10528 (f10529). import { cloneElement } from "react"; import { Image as Image2, View } from "react-native"; import { resetFocusTimer } from "../ChannelCallStore"; import { hexWithOpacity } from "../../../../utils/ColorUtils"; import Module712 from "../../../../_bundle/Module712"; import { createStyles } from "../../../../design/components/Styles/native/createStyles"; import useBottomVoiceControlsSheetWidth from "../useBottomVoiceControlsSheetWidth"; import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables"; import CircleWithCutoutUtils, { getBadgeTop, getBadgeLeft } from "../../../voice_panel/native/shared/CircleWithCutoutUtils"; import { Text } from "../../../../design/components/Text/native/Text"; let circleFillColor, c7070_10, c7070_11, c7070_12, useStyles; const ActionButton = function ActionButton(props) { let appearsDisabled = props.appearsDisabled; if (appearsDisabled === void 0) { appearsDisabled = false; } let backgroundColor = props.backgroundColor; const { imageStyle, onPress: onPress2, accessibilityLabel, accessibilityState, source, showBadge = false, isSmallSize = false, children, lottieComponent, lottieComponentColor, IconComponent } = props; const styles = useStyles(); const bottomVoiceControlsSheetWidth = useBottomVoiceControlsSheetWidth(); const marginHorizontal = isSmallSize ? bottomVoiceControlsSheetWidth < c7070_12 ? 6 : 12 : 12; const r18 = isSmallSize ? c7070_11 : c7070_10; const width = 2 * r18.buttonRadius; const width2 = 2 * r18.badgeRadius; const cutoutRadius = r18.badgeRadius + r18.cutoutInset; const props2 = { accessibilityLabel, accessibilityRole: "button", accessibilityState, onPress: () => { resetFocusTimer(); onPress2(); }, disabled: false, style: { width, height: width, borderRadius: r18.buttonRadius, marginHorizontal }, children: null }; const style = [styles.buttonContainer, { width, height: width, borderRadius: r18.buttonRadius }, { opacity: appearsDisabled ? 0.25 : 1 }]; if (backgroundColor == null) { backgroundColor = circleFillColor; } props2.children = {lottieComponent != null ? cloneElement(lottieComponent, { color: lottieComponentColor }) : IconComponent != null ? : } {showBadge ? : null} {children} ; return ; }; circleFillColor = hexWithOpacity(Module712.unsafe_rawColors.WHITE, 0.24); c7070_10 = Object.freeze({ buttonRadius: 28, badgeRadius: 6, cutoutInset: 3 }); c7070_11 = Object.freeze({ buttonRadius: 24, badgeRadius: 4, cutoutInset: 2 }); c7070_12 = 24 + 2 * c7070_11.buttonRadius * 5 + 96; useStyles = createStyles({ buttonContainer: { position: "absolute" }, iconContainer: { position: "absolute", justifyContent: "center", alignItems: "center" }, badge: { backgroundColor: "white", position: "absolute" }, notificationArea: { position: "absolute", top: -4, right: -4, height: 24, minWidth: 24, paddingHorizontal: 4, borderRadius: 12, borderWidth: 4, borderColor: Module712.unsafe_rawColors.PRIMARY_760, alignItems: "center", justifyContent: "center" }, notificationText: { lineHeight: 16 }, notificationAreaMentioned: { backgroundColor: Module712.colors.CONTROL_CRITICAL_PRIMARY_BACKGROUND_DEFAULT }, notificationAreaUnread: { backgroundColor: Module712.unsafe_rawColors.PRIMARY_600 } }); export { c7070_11 as SMALL_ACTION_BUTTON_DIMENSIONS }; export { ActionButton }; export function ToggledActionButton(props) { const { isActive, disableTint = false, showBadge = false, isSmallSize = false, backgroundColor: _backgroundColor, tintColor: _tintColor, ...props2 } = props; let backgroundColor = props.backgroundColor; let tintColor = props.tintColor; const r2 = isActive ? Module712.unsafe_rawColors.WHITE : null; const r25 = isActive ? Module712.unsafe_rawColors.PRIMARY_900 : Module712.unsafe_rawColors.WHITE; const r26 = disableTint ? void 0 : r25; if (backgroundColor == null) { backgroundColor = r2; } const tintColor2 = tintColor == null ? r26 : tintColor; if (tintColor == null) { tintColor = r26; } return ; } export function PrimaryActionButton(props) { const { isSmallSize = false, ...rest } = props; return ; } export function NotifiedActionButton(props) { const { notifications, isMentioned, ...props2 } = props; const styles = useStyles(); return {notifications} ; }