changed to square brackets and reduced font #612

Merged
ameye merged 1 commits from home-banners-dashboard into master 2024-03-04 16:46:09 +00:00
+24 -9
View File
@@ -19,7 +19,7 @@ export default function FamilyTable({
familyList,
loader,
popUpHandler,
imageServer
imageServer,
}) {
const navigate = useNavigate();
const [currentPage, setCurrentPage] = useState(0);
@@ -56,14 +56,18 @@ export default function FamilyTable({
enable_traking,
profile_picture,
imageServer,
username
username,
}) => {
// Check for valid dates
const addedDate = added ? added.split(" ")[0] : "N/A";
const loginDate = last_login ? formatDateString(last_login) : "N/A";
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 =
enable_traking === "0"
? "Stopped"
@@ -81,14 +85,19 @@ export default function FamilyTable({
<div className="w-[60px] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
<img
// src={profile_picture}
src={image || profile_picture || localImgLoad(`images/icons/${banner}`)}
src={
image ||
profile_picture ||
localImgLoad(`images/icons/${banner}`)
}
alt={`Avatar of ${firstname} ${lastname}`}
className="w-full h-full"
/>
</div>
<div className="flex flex-col flex-[0.9]">
<h1 className="font-bold text-xl text-dark-gray dark:text-white whitespace-nowrap">
{`${firstname} ${lastname} (${username})`}
<h1 className="font-bold text-lg text-dark-gray dark:text-white whitespace-nowrap">
{`${firstname} ${lastname}`}{" "}
<span className="ml-1 text-sm">{`[${username}]`}</span>
</h1>
<span className="text-sm text-thin-light-gray">
Added: <span className="text-purple ml-1">{addedDate}</span>
@@ -137,7 +146,7 @@ export default function FamilyTable({
task_count,
family_uid,
banner,
image
image,
})
}
type="button"
@@ -187,7 +196,13 @@ export default function FamilyTable({
</thead>
<tbody className="h-full">
{currentFamilyList?.map((familyMember, index) => {
return <FamilyRow key={index} {...familyMember} imageServer={imageServer} />;
return (
<FamilyRow
key={index}
{...familyMember}
imageServer={imageServer}
/>
);
})}
</tbody>
</table>