Иван Иванович {id}
Роль
diff --git a/client/src/components/ui/ActionsPopover.tsx b/client/src/components/ui/ActionsPopover.tsx
index 044a449..89cb045 100644
--- a/client/src/components/ui/ActionsPopover.tsx
+++ b/client/src/components/ui/ActionsPopover.tsx
@@ -1,4 +1,6 @@
import { useState, useRef, useEffect } from "react";
+import Button from "./Button";
+import MoreIcon from "../icons/MoreIcon";
interface ActionsPopoverProps {
options: {
@@ -37,9 +39,6 @@ export default function ActionsPopover({ options }: ActionsPopoverProps) {
const buttonRect = buttonRef.current.getBoundingClientRect();
const spaceBelow = window.innerHeight - buttonRect.bottom;
const spaceAbove = buttonRect.top;
-
- console.log(spaceBelow, menuHeight, spaceAbove);
- // Если снизу недостаточно места, но сверху достаточно - открываем вверх
if (spaceBelow < menuHeight && spaceAbove > menuHeight) {
setOpenUpwards(true);
} else {
@@ -52,12 +51,12 @@ export default function ActionsPopover({ options }: ActionsPopoverProps) {
{isOpened && (
@@ -65,24 +64,21 @@ export default function ActionsPopover({ options }: ActionsPopoverProps) {
ref={(el) => {
setMenuHeight(el?.offsetHeight || 0);
}}
- className={`absolute z-10 right-0 w-[13.333vw] bg-white rounded-[1.111vw] shadow-[0_4px_40px_0_rgba(15,16,17,0.1)] ${
+ className={`absolute z-10 right-0 w-[13.333vw] bg-white rounded-[1.111vw] shadow-[0_4px_40px_0_rgba(15,16,17,0.1)] overflow-hidden ${
openUpwards ? "bottom-[100%]" : "top-[100%]"
}`}
>
{options.map((option) => (
-
+
))}
)}
diff --git a/client/src/components/ui/Avatar.tsx b/client/src/components/ui/Avatar.tsx
new file mode 100644
index 0000000..45552ca
--- /dev/null
+++ b/client/src/components/ui/Avatar.tsx
@@ -0,0 +1,65 @@
+import clsx from "clsx";
+import Warning from "../indicators/Warning";
+import Admin from "../indicators/Admin";
+
+interface AvatarProps {
+ size: "small" | "medium" | "large";
+ status?: "caution" | "admin";
+ src?: string;
+ name?: string;
+}
+
+export default function Avatar({ size, status, src, name }: AvatarProps) {
+ return (
+
+ {GetAvatarImage(src, name)}
+
+ {status === "caution" &&
}
+ {status === "admin" &&
}
+
+
+ );
+}
+
+function GetAvatarImage(src?: string, name?: string) {
+ // Aninymous avatar
+ if (!src && !name) {
+ return

;
+ }
+
+ // Name avatar
+ if (name && !src) {
+ const nameParts = name.split(" ");
+ const firstLetter = nameParts[0][0].toUpperCase();
+ const secondLetter =
+ nameParts.length > 1
+ ? nameParts[nameParts.length - 1][0].toUpperCase()
+ : "";
+
+ return (
+
+
+ {firstLetter}
+ {secondLetter}
+
+
+ );
+ }
+
+ // Src avatar
+ return

;
+}
diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx
index 5f55ef6..ab75ce3 100644
--- a/client/src/pages/HomePage.tsx
+++ b/client/src/pages/HomePage.tsx
@@ -7,7 +7,7 @@ import usePopupStore from "../store/popupStore";
import SettingsModal from "../components/modals/SettingsModal";
import useModalStore from "../store/modalStore";
import CogFilledIcon from "../components/icons/CogFilledIcon";
-import SharePopup from "../components/popups/SharePopup";
+import ParticipantsPopup from "../components/popups/ParticipantsPopup";
function HomePage() {
const { data: user } = useMe();
@@ -32,11 +32,7 @@ function HomePage() {
- setPopup(
-
- )
- }
+ onClick={() => setPopup()}
>