import React from "react"; import { Image } from "react-native"; import { useNavigation } from "@react-navigation/native"; import { HeaderBackButton } from "@react-navigation/elements"; import { MaterialCommunityIcons } from "@expo/vector-icons"; import { useDrawerState } from "~/navigation/Context"; import { createStyles } from "~/theme"; const logo = require("~/assets/img/alert96.png"); export default function HeaderLeft(props) { const styles = useStyles(); const navigation = useNavigation(); const [drawerState] = useDrawerState(); const { canGoBack } = props; if (canGoBack || !drawerState.homeFocused) { const { iconStyle } = props; return ( { if (canGoBack) { navigation.goBack(); } else { navigation.navigate(drawerState.topTabPrev || "SendAlert"); } }} backImage={() => ( )} /> ); } return ; } const useStyles = createStyles(({ wp, hp, scaleText, theme: { colors } }) => { const size = Math.max(24, wp(3)); return { size: { width: size, height: size, }, logo: { marginHorizontal: Math.max(8, wp(2)), color: colors.onSurface, }, backButton: { marginHorizontal: Math.max(8, wp(2)), color: colors.onSurface, zIndex: 1, }, icon: { color: colors.onSurface, opacity: 1, }, }; });