Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aligned blob pictures #546

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions frontend/src/components/Staffing/ConsultantRow.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { ConsultantReadModel, ProjectWithCustomerModel } from "@/api-types";
import React, { useContext, useEffect, useState } from "react";
import { AlertCircle, ChevronDown, Plus } from "react-feather";
import { AlertCircle, CheckCircle, ChevronDown, Plus } from "react-feather";
import { DetailedBookingRows } from "@/components/Staffing/DetailedBookingRows";
import { WeekCell } from "@/components/Staffing/WeekCell";
import { useModal } from "@/hooks/useModal";
Expand Down Expand Up @@ -161,7 +161,7 @@ export default function ConsultantRows({
.map((e) => e.bookingDetails.endDateAgreement);

if (dates.some((e) => e === null)) {
return <AlertCircle color="red" size={20} />;
return <AlertCircle color="red" size={20} className="w-1/12" />;
} else if (dates.length > 0) {
const newestDate = dates.reduce((a, b) => {
return new Date(a as string) < new Date(b as string) ? a : b;
Expand All @@ -170,10 +170,12 @@ export default function ConsultantRows({
const now = DateTime.now();
const endDate = DateTime.fromISO(newestDate as string);
if (endDate < now) {
return <AlertCircle color="orange" size={20} />;
return <AlertCircle color="orange" size={20} className="w-1/12" />;
} else {
return null;
return <CheckCircle color="transparent" size={20} className="w-1/12" />;
}
} else {
return <CheckCircle color="transparent" size={20} className="w-1/12" />;
}
}

Expand Down Expand Up @@ -203,22 +205,21 @@ export default function ConsultantRows({
</button>
</td>
<td>
<div className="flex gap-1 items-center">
{getAlert()}
<div className="flex flex-row align-center self-center gap-2">
<div className="flex justify-start gap-1 items-center">
<div className="flex flex-row justify-center self-center gap-2 w-3/12">
{consultant.imageThumbUrl ? (
<Image
src={consultant.imageThumbUrl}
alt={consultant.name}
className="w-8 h-8 rounded-full self-center object-contain"
className="w-10 h-10 rounded-full self-center object-contain"
width={32}
height={32}
/>
) : (
<div className="w-8 h-8 rounded-full bg-primary"></div>
)}
</div>
<div className="flex flex-col gap-1 ">
<div className="flex flex-col gap-1 w-7/12 ">
<p
className={`text-black text-start ${
isListElementVisible ? "normal-medium" : "normal"
Expand All @@ -230,6 +231,7 @@ export default function ConsultantRows({
{`${currentConsultant.yearsOfExperience} års erfaring`}
</p>
</div>
{getAlert()}
{isListElementVisible && (
<EditEngagementHourModal
modalRef={changeEngagementModalRef}
Expand Down
Loading