feat: update ManagerSelect positioning and enhance ProjectSelector with dynamic positioning and animations
This commit is contained in:
@@ -14,6 +14,7 @@ import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { AnimatePresence, motion } from "motion/react";
|
||||
import useClientSearch from "../../hooks/useClientSearch.tsx";
|
||||
import ManagerSelect from "../ManagerSelect.tsx";
|
||||
import { Manager } from "../../types/Manager.ts";
|
||||
|
||||
interface Props {
|
||||
targetServerId: string | null;
|
||||
@@ -36,6 +37,11 @@ export default function CreateSessionModal({ targetServerId, client }: Props) {
|
||||
refetchInterval: 1000,
|
||||
});
|
||||
|
||||
const { data: managers } = useQuery({
|
||||
queryKey: ["managers"],
|
||||
queryFn: () => api.get("managers").json<Manager[]>(),
|
||||
});
|
||||
|
||||
const targetServer = targetServerId
|
||||
? servers?.find((server) => server.id === targetServerId) || null
|
||||
: null;
|
||||
@@ -170,10 +176,6 @@ export default function CreateSessionModal({ targetServerId, client }: Props) {
|
||||
selectedServer,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(selectedServer);
|
||||
}, [selectedServer]);
|
||||
|
||||
const ref = useRef<HTMLFormElement>(null);
|
||||
|
||||
return (
|
||||
@@ -208,65 +210,6 @@ export default function CreateSessionModal({ targetServerId, client }: Props) {
|
||||
required
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
<ManagerSelect
|
||||
placeholder="Менеджер сеанса"
|
||||
data={[
|
||||
{
|
||||
id: "1",
|
||||
email: "2@2",
|
||||
fullname: "СЕМЁН Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
email: "2@2",
|
||||
fullname: "ВОВА Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
email: "2@2",
|
||||
fullname: "САНЯ Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
email: "2@2",
|
||||
fullname: "АНТОН Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
email: "2@2",
|
||||
fullname: "БОЛЬШОЙ АНТОН",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
email: "2@2",
|
||||
fullname: "Константин Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
email: "2@2",
|
||||
fullname: "Константин Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "8",
|
||||
email: "2@2",
|
||||
fullname: "Константин Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
{
|
||||
id: "9",
|
||||
email: "2@2",
|
||||
fullname: "Константин Лобанов",
|
||||
companyId: "1",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<AnimatePresence>
|
||||
{isFullPhone && (
|
||||
<>
|
||||
@@ -303,6 +246,7 @@ export default function CreateSessionModal({ targetServerId, client }: Props) {
|
||||
</div>
|
||||
<div className="flex flex-col gap-y-[0.833vw]">
|
||||
<p className="title-s font-medium">Выберите параметры сеанса</p>
|
||||
<ManagerSelect placeholder="Менеджер сеанса" data={managers || []} />
|
||||
{selectedServer &&
|
||||
selectedServer?.appsToServers &&
|
||||
selectedServer.appsToServers?.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user