changed to square brackets and reduced font

This commit was merged in pull request #612.
This commit is contained in:
2024-03-04 17:34:11 +01:00
parent 0aee3b9d6f
commit 9eae733755
+24 -9
View File
@@ -19,7 +19,7 @@ export default function FamilyTable({
familyList, familyList,
loader, loader,
popUpHandler, popUpHandler,
imageServer imageServer,
}) { }) {
const navigate = useNavigate(); const navigate = useNavigate();
const [currentPage, setCurrentPage] = useState(0); const [currentPage, setCurrentPage] = useState(0);
@@ -56,14 +56,18 @@ export default function FamilyTable({
enable_traking, enable_traking,
profile_picture, profile_picture,
imageServer, imageServer,
username username,
}) => { }) => {
// Check for valid dates // Check for valid dates
const addedDate = added ? added.split(" ")[0] : "N/A"; const addedDate = added ? added.split(" ")[0] : "N/A";
const loginDate = last_login ? formatDateString(last_login) : "N/A"; const loginDate = last_login ? formatDateString(last_login) : "N/A";
const key = `family-${family_uid}`; // Assign a unique key const key = `family-${family_uid}`; // Assign a unique key
const image = localStorage.getItem('session_token') ? `${imageServer}${localStorage.getItem('session_token')}/family/${family_uid}` : '' const image = localStorage.getItem("session_token")
? `${imageServer}${localStorage.getItem(
"session_token"
)}/family/${family_uid}`
: "";
const trackingStatus = const trackingStatus =
enable_traking === "0" enable_traking === "0"
? "Stopped" ? "Stopped"
@@ -81,14 +85,19 @@ export default function FamilyTable({
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center"> <div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img <img
// src={profile_picture} // src={profile_picture}
src={image || profile_picture || localImgLoad(`images/icons/${banner}`)} src={
image ||
profile_picture ||
localImgLoad(`images/icons/${banner}`)
}
alt={`Avatar of ${firstname} ${lastname}`} alt={`Avatar of ${firstname} ${lastname}`}
className="w-full h-full" className="w-full h-full"
/> />
</div> </div>
<div className="flex flex-col flex-[0.9]"> <div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap"> <h1 className="font-bold text-lg text-dark-gray dark:text-white whitespace-nowrap">
{`${firstname} ${lastname} (${username})`} {`${firstname} ${lastname}`}{" "}
<span className="ml-1 text-sm">{`[${username}]`}</span>
</h1> </h1>
<span className="text-sm text-thin-light-gray"> <span className="text-sm text-thin-light-gray">
Added: <span className="text-purple ml-1">{addedDate}</span> Added: <span className="text-purple ml-1">{addedDate}</span>
@@ -137,7 +146,7 @@ export default function FamilyTable({
task_count, task_count,
family_uid, family_uid,
banner, banner,
image image,
}) })
} }
type="button" type="button"
@@ -187,7 +196,13 @@ export default function FamilyTable({
</thead> </thead>
<tbody className="h-full"> <tbody className="h-full">
{currentFamilyList?.map((familyMember, index) => { {currentFamilyList?.map((familyMember, index) => {
return <FamilyRow key={index} {...familyMember} imageServer={imageServer} />; return (
<FamilyRow
key={index}
{...familyMember}
imageServer={imageServer}
/>
);
})} })}
</tbody> </tbody>
</table> </table>