import * as React from 'react' import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native' import AppAnalytics from 'src/analytics/AppAnalytics' import { AnalyticsEventType, AnalyticsPropertiesList } from 'src/analytics/Properties' import Touchable from 'src/components/Touchable' import { Spacing } from 'src/styles/styles' import variables from 'src/styles/variables' interface CommonProps { disabled?: boolean testID?: string onPress: () => void eventName?: AnalyticsEventType eventProperties?: AnalyticsPropertiesList[AnalyticsEventType] style?: StyleProp } type WrapperProps = CommonProps & { children: JSX.Element } function Wrapper({ eventName, onPress, disabled, testID, children, style, eventProperties, }: WrapperProps) { const onPressLocal = React.useCallback(() => { if (eventName) { eventProperties ? AppAnalytics.track(eventName, eventProperties) : AppAnalytics.track(eventName) } onPress() }, [onPress, eventName]) return ( {children} ) } type TopBarIconButtonV2Props = CommonProps & { icon: JSX.Element containerStyle?: ViewStyle size?: number } export function TopBarIconButtonV2(props: TopBarIconButtonV2Props) { return ( {props.icon} ) } const styles = StyleSheet.create({ button: { padding: Spacing.Small12, }, container: { justifyContent: 'center', alignItems: 'center', }, })