From e3084a70a7593b51297f8f7ddc5979c8c85680e9 Mon Sep 17 00:00:00 2001 From: ivic00 <102467664+ivic00@users.noreply.github.com> Date: Sun, 10 Nov 2024 13:53:19 +0100 Subject: [PATCH] added pfp to tablet view --- .../tablet_components/TabletContainer.tsx | 9 ++- .../tablet_components/UsersList.tsx | 74 ++++++++++++++----- 2 files changed, 63 insertions(+), 20 deletions(-) diff --git a/components/pages/(tablet_pages)/tablet_components/TabletContainer.tsx b/components/pages/(tablet_pages)/tablet_components/TabletContainer.tsx index 168f6ff..b00bdd0 100644 --- a/components/pages/(tablet_pages)/tablet_components/TabletContainer.tsx +++ b/components/pages/(tablet_pages)/tablet_components/TabletContainer.tsx @@ -2,6 +2,7 @@ import { View, Text, ViewProps } from "react-native-ui-lib"; import React, { ReactNode } from "react"; import { Dimensions, StyleSheet } from "react-native"; import UsersList from "./UsersList"; +import { ScrollView } from "react-native-gesture-handler"; interface TabletContainerProps extends ViewProps { children: ReactNode; @@ -18,7 +19,9 @@ const TabletContainer: React.FC = ({ {children} - + + + @@ -28,7 +31,6 @@ const TabletContainer: React.FC = ({ const styles = StyleSheet.create({ container: { backgroundColor: "white", - width: "100%", flex: 1, }, calendarContainer: { @@ -38,8 +40,9 @@ const styles = StyleSheet.create({ }, profilesContainer: { width: width * 0.15, - backgroundColor: "green", height: height, + borderLeftWidth: 1, + borderLeftColor: "#a9a9a9", }, }); diff --git a/components/pages/(tablet_pages)/tablet_components/UsersList.tsx b/components/pages/(tablet_pages)/tablet_components/UsersList.tsx index 6104a1e..82b488d 100644 --- a/components/pages/(tablet_pages)/tablet_components/UsersList.tsx +++ b/components/pages/(tablet_pages)/tablet_components/UsersList.tsx @@ -1,27 +1,67 @@ import { View, Text } from "react-native-ui-lib"; import React from "react"; +import { useGetFamilyMembers } from "@/hooks/firebase/useGetFamilyMembers"; +import { ImageBackground, StyleSheet } from "react-native"; +import { colorMap } from "@/constants/colorMap"; const UsersList = () => { + const { data: familyMembers } = useGetFamilyMembers(); + + const capitalizeFirstLetter = (str: string) => { + if (!str) return ''; + return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); + }; + return ( - - - + + {familyMembers?.map((member, index) => ( + <> + {member.pfp ? ( + + ) : ( + + {member.firstName.at(0)} + {member.lastName.at(0)} + + } + /> + )} + {member.firstName} + {capitalizeFirstLetter(member.userType)} + + ))} ); }; +const styles = StyleSheet.create({ + pfp: { + aspectRatio: 1, + width: 113, + borderRadius: 100, + marginBottom: 8, + }, + fName: { + fontFamily: "Manrope_600SemiBold", + fontSize: 18.15, + }, + role: { + fontFamily: "Manrope_600SemiBold", + fontSize: 12.95, + color: "#9b9b9b", + marginBottom: 20, + }, +}); + export default UsersList;