import { Image, Text, View } from "react-native-ui-lib"; import React from "react"; import { useAuthContext } from "@/contexts/AuthContext"; import { StyleSheet } from "react-native"; import { colorMap } from "@/constants/colorMap"; const HeaderTemplate = (props: { message: string; isWelcome: boolean; children?: React.ReactNode; link?: React.ReactNode; }) => { const { user, profileData } = useAuthContext(); const headerHeight: number = 72; const styles = StyleSheet.create({ pfp: { height: headerHeight, aspectRatio: 1, borderRadius: 22, overflow: "hidden", marginRight: 20, backgroundColor: profileData?.eventColor ?? colorMap.pink, }, pfpTxt: { fontFamily: "Manrope_500Medium", fontSize: 30, color: 'white', }, }); return ( {profileData?.pfp ? ( ) : ( {user?.email?.at(0)} {user?.email?.at(1)} )} {props.isWelcome && ( Welcome, {profileData?.firstName}! )} {props.message} {props.children && {props.children}} {props.link && {props.link}} ); }; export default HeaderTemplate;