From facb76e90473cb2a6657975276b677c6bdb7ed57 Mon Sep 17 00:00:00 2001 From: Lanskikh Date: Tue, 17 Jun 2025 12:27:42 +0500 Subject: [PATCH] upd --- src/components/Badge.tsx | 2 +- src/components/Button.tsx | 6 +- src/components/DesktopCard.tsx | 2 +- src/components/Header.tsx | 35 ---- src/components/Input.tsx | 42 ++++- src/components/MultySelect.tsx | 155 ++++++++++++++++++ src/components/Navbar.tsx | 10 +- src/components/NewInput.tsx | 45 ----- src/components/NewSelect.tsx | 147 ----------------- src/components/SearchInput.tsx | 69 ++++++-- src/components/SessionComments.tsx | 4 +- src/components/SessionFiles.tsx | 4 +- src/components/TableSelector.tsx | 7 +- src/components/icons/SearchIcon.tsx | 20 ++- src/components/modals/CreateSessionModal.tsx | 8 +- src/components/modals/CurrentSessionModal.tsx | 2 +- src/components/modals/EditTableModal.tsx | 8 +- src/components/modals/SessionModal.tsx | 49 +++--- src/index.css | 4 + src/pages/DashboardPage.tsx | 42 +---- src/pages/LoginPage.tsx | 6 +- src/pages/SessionsPage.tsx | 76 +++++---- src/types/Server.ts | 2 +- 23 files changed, 369 insertions(+), 376 deletions(-) delete mode 100644 src/components/Header.tsx create mode 100644 src/components/MultySelect.tsx delete mode 100644 src/components/NewInput.tsx delete mode 100644 src/components/NewSelect.tsx diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index dc9d0f7..07bd448 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -1,6 +1,6 @@ function Badge({ count }: { count: number }) { return ( -
+
{count}
); diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 9a6bc25..7cc013d 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -2,7 +2,7 @@ import clsx from "clsx"; interface ButtonProps extends React.ButtonHTMLAttributes { children: React.ReactNode; - variant: "critical" | "secondary" | "primary" | "cta" | "menu"; + variant?: "critical" | "secondary" | "primary" | "cta" | "menu"; className?: string; size?: "small" | "medium" | "large"; ref?: React.RefObject; @@ -10,7 +10,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes { function Button({ children, - variant = "primary", + variant = "cta", size = "medium", className, ref, @@ -27,7 +27,7 @@ function Button({ onClick?.(e); }} className={clsx( - "transition-all flex 2xl:gap-[0.556vw] gap-2 items-center justify-center font-medium disabled:bg-[#F6F6F6] disabled:text-[#D6D6D6]", + "transition-all flex outline-none 2xl:gap-[0.556vw] gap-2 items-center justify-center font-medium disabled:bg-[#F6F6F6] disabled:text-[#D6D6D6] cursor-pointerdisabled:cursor-default", variant === "critical" && "text-[#FF4517] bg-[#FEF3F2] hover:bg-[#FEE4E2]", variant === "secondary" && diff --git a/src/components/DesktopCard.tsx b/src/components/DesktopCard.tsx index b9257c8..30d70f5 100644 --- a/src/components/DesktopCard.tsx +++ b/src/components/DesktopCard.tsx @@ -48,7 +48,7 @@ export default function DesktopCard({ server }: IDesktopCardProps) {

{server.name}

-

{server.location}

+

{server.description}

diff --git a/src/components/Header.tsx b/src/components/Header.tsx deleted file mode 100644 index 13558b2..0000000 --- a/src/components/Header.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { useQueryClient } from "@tanstack/react-query"; -import ChevronDownIcon from "./icons/ChevronDownIcon"; -import { IUser } from "../types/User"; -import SearchInput from "./SearchInput"; - -function Header() { - const queryClient = useQueryClient(); - const me = queryClient.getQueryData(["me"]); - - return ( -
-
-
-
- logo -
- -
-
-
-

{me?.fullname}

-

- Старший менеджер -

-
-
- -
-
-
-
- ); -} - -export default Header; diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 6306076..a7024de 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,18 +1,44 @@ -import React from "react"; +import clsx from "clsx"; -interface InputProps extends React.InputHTMLAttributes { - label?: string; +interface NewInputProps extends React.InputHTMLAttributes { + placeholder?: string; + isError?: boolean; + errorMessage?: string; } -function Input({ label, ...props }: InputProps) { +function Input({ + placeholder, + isError, + errorMessage, + ...props +}: NewInputProps) { return ( -
- ); -} - -export default NewSelect; diff --git a/src/components/SearchInput.tsx b/src/components/SearchInput.tsx index 7f4fa10..83631cc 100644 --- a/src/components/SearchInput.tsx +++ b/src/components/SearchInput.tsx @@ -1,23 +1,62 @@ -import React, { useState } from "react"; +import React, { useRef } from "react"; import SearchIcon from "./icons/SearchIcon"; +import CloseIcon from "./icons/CloseIcon"; +import Button from "./Button"; +import clsx from "clsx"; -function SearchInput(props: React.InputHTMLAttributes) { - const [value, setValue] = useState(""); +function SearchInput( + props: React.InputHTMLAttributes & { + onEnter?: () => void; + } +) { + const ref = useRef(null); return ( -
- setValue(e.target.value)} - {...props} - /> - {!value && ( -
- -
+
+
+ + + + { + if (e.key === "Enter") props.onEnter?.(); + }} + /> +
+
+ + {props.onEnter && ( + + )} +
); } diff --git a/src/components/SessionComments.tsx b/src/components/SessionComments.tsx index 97fe66d..e7b940f 100644 --- a/src/components/SessionComments.tsx +++ b/src/components/SessionComments.tsx @@ -80,7 +80,7 @@ function SessionComments({ sessionId }: { sessionId: string }) { }; const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Enter") { + if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); handleSubmit(e as unknown as React.FormEvent); } @@ -115,11 +115,13 @@ function SessionComments({ sessionId }: { sessionId: string }) {