mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
PFP fix
This commit is contained in:
@ -1,41 +1,43 @@
|
|||||||
import { View, Text } from "react-native-ui-lib";
|
import {Image, Text, View} from "react-native-ui-lib";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useAuthContext } from "@/contexts/AuthContext";
|
import {useAuthContext} from "@/contexts/AuthContext";
|
||||||
import { ImageBackground } from "react-native";
|
|
||||||
|
|
||||||
const HeaderTemplate = (props: {
|
const HeaderTemplate = (props: {
|
||||||
message: string;
|
message: string;
|
||||||
isWelcome: boolean;
|
isWelcome: boolean;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
link?: React.ReactNode;
|
link?: React.ReactNode;
|
||||||
}) => {
|
}) => {
|
||||||
const { user, profileData } = useAuthContext();
|
const {user, profileData} = useAuthContext();
|
||||||
|
|
||||||
const headerHeight:number = 72;
|
const headerHeight: number = 72;
|
||||||
return (
|
return (
|
||||||
<View row centerV marginV-15>
|
<View row centerV marginV-15>
|
||||||
<ImageBackground
|
<Image
|
||||||
source={require("../../assets/images/profile-picture.png")}
|
source={{uri: profileData?.pfp}}
|
||||||
style={{
|
style={{
|
||||||
height: headerHeight,
|
height: headerHeight,
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
borderRadius: 22,
|
borderRadius: 22,
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<View gap-3>
|
<View gap-3>
|
||||||
{props.isWelcome && (
|
{props.isWelcome && (
|
||||||
<Text text70L style={{fontSize: 19, fontFamily: "Manrope_400Regular"}}>Welcome, {profileData?.firstName}!</Text>
|
<Text text70L style={{
|
||||||
)}
|
fontSize: 19,
|
||||||
<Text text70B style={{ fontSize: 18 , fontFamily: "Manrope_600SemiBold" }}>
|
fontFamily: "Manrope_400Regular"
|
||||||
{props.message}
|
}}>Welcome, {profileData?.firstName}!</Text>
|
||||||
</Text>
|
)}
|
||||||
{props.children && <View>{props.children}</View>}
|
<Text text70B style={{fontSize: 18, fontFamily: "Manrope_600SemiBold"}}>
|
||||||
{props.link && <View marginT-8>{props.link}</View>}
|
{props.message}
|
||||||
</View>
|
</Text>
|
||||||
</View>
|
{props.children && <View>{props.children}</View>}
|
||||||
);
|
{props.link && <View marginT-8>{props.link}</View>}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default HeaderTemplate;
|
export default HeaderTemplate;
|
||||||
|
|||||||
Reference in New Issue
Block a user