fix: update ClientModal submit button logic to include email comparison and adjust ManagerSelect to ensure selected manager displays correctly
This commit is contained in:
@@ -16,7 +16,7 @@ function ManagerSelect({
|
||||
}) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [selectedManager, setSelectedManager] = useState<Manager | null>(
|
||||
data[0] || null
|
||||
data[0]
|
||||
);
|
||||
const [position, setPosition] = useState<"top" | "bottom">("bottom");
|
||||
const selectRef = useClickAway<HTMLDivElement>(() => setIsOpen(false));
|
||||
@@ -58,9 +58,7 @@ function ManagerSelect({
|
||||
</div>
|
||||
<div className="flex items-center gap-[0.556vw]">
|
||||
<div className="size-[1.111vw] rounded-full bg-[#7D7D7D]" />
|
||||
<div className="text-s">
|
||||
{selectedManager?.fullname || data[0].fullname}
|
||||
</div>
|
||||
<div className="text-s">{selectedManager?.fullname}</div>
|
||||
</div>
|
||||
</div>
|
||||
<span className="size-[1.389vw] text-[#7D7D7D]">
|
||||
|
||||
@@ -108,7 +108,15 @@ function ClientModal({ client }: { client: Client }) {
|
||||
size="large"
|
||||
className="w-full"
|
||||
type="submit"
|
||||
disabled={!clientData.name || !clientData.phone || isPending}
|
||||
disabled={
|
||||
!clientData.name ||
|
||||
!clientData.phone ||
|
||||
isPending ||
|
||||
(clientData.name === client.name &&
|
||||
clientData.phone.replace(/\D/g, "") ===
|
||||
client.phone.replace(/\D/g, "") &&
|
||||
clientData.email === client.email)
|
||||
}
|
||||
>
|
||||
{isPending ? (
|
||||
<span className="size-[1.111vw] animate-spin text-[#7B60F3] flex items-center justify-center">
|
||||
|
||||
@@ -146,7 +146,7 @@ function SessionsPage() {
|
||||
) : grouppedSessions?.length ? (
|
||||
grouppedSessions?.map(([timestamp, sessions]) => (
|
||||
<div key={timestamp} className="space-y-[0.833vw]">
|
||||
<p className="caption-m font-medium opacity-40">
|
||||
<p className="caption-s font-medium opacity-40">
|
||||
{isToday(new Date(timestamp))
|
||||
? "Сегодня"
|
||||
: format(new Date(timestamp), "d MMMM", { locale: ru })}
|
||||
|
||||
Reference in New Issue
Block a user