diff --git a/frontend/components/dashboard/projectCard/dropdown.tsx b/frontend/components/dashboard/projectCard/dropdown.tsx index 752c878..1d9148b 100644 --- a/frontend/components/dashboard/projectCard/dropdown.tsx +++ b/frontend/components/dashboard/projectCard/dropdown.tsx @@ -7,8 +7,6 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" @@ -52,7 +50,6 @@ export default function ProjectCardDropdown({ )} - { e.stopPropagation() diff --git a/frontend/components/editor/live/avatars.tsx b/frontend/components/editor/live/avatars.tsx index 2766083..92c72ff 100644 --- a/frontend/components/editor/live/avatars.tsx +++ b/frontend/components/editor/live/avatars.tsx @@ -1,21 +1,33 @@ -import { useOthers, useSelf } from "@/liveblocks.config" -import Avatar from "@/components/ui/avatar" +"use client" + +import { colorClasses, colors } from "@/lib/colors" +import { useOthers } from "@/liveblocks.config" +import { useState } from "react" export function Avatars() { const users = useOthers() - const currentUser = useSelf() + + const colorNames = Object.keys(colors) + const [activeColors, setActiveColors] = useState([]) return ( -
+
{users.map(({ connectionId, info }) => { - return - })} + const c = colorNames[ + connectionId % colorNames.length + ] as keyof typeof colors - {currentUser && ( -
- -
- )} + return ( +
+ {info.name + .split(" ") + .slice(0, 2) + .map((letter) => letter[0].toUpperCase())} +
+ ) + })}
) } diff --git a/frontend/components/ui/userButton.tsx b/frontend/components/ui/userButton.tsx index 9cb7747..20f0440 100644 --- a/frontend/components/ui/userButton.tsx +++ b/frontend/components/ui/userButton.tsx @@ -29,13 +29,19 @@ export default function UserButton({ userData }: { userData: User }) { .map((name) => name[0].toUpperCase())}
- + +
+
{userData.name}
+
+ {userData.email} +
+
+ + Edit Profile - {/* open modal with name and email (disabled) */} - signOut(() => router.push("/"))} className="!text-destructive cursor-pointer" diff --git a/frontend/lib/colors.ts b/frontend/lib/colors.ts new file mode 100644 index 0000000..8967c38 --- /dev/null +++ b/frontend/lib/colors.ts @@ -0,0 +1,40 @@ +export const colors = { + red: "#dc2626", + orange: "#ea580c", + yellow: "#ca8a04", + green: "#16a34a", + blue: "#0284c7", + purple: "#7c3aed", + pink: "#db2777", +} + +export const colorClasses = { + red: { + ring: "ring-red-700", + bg: "from-red-950 to-red-600", + }, + orange: { + ring: "ring-orange-700", + bg: "from-orange-950 to-orange-600", + }, + yellow: { + ring: "ring-yellow-700", + bg: "from-yellow-950 to-yellow-600", + }, + green: { + ring: "ring-green-700", + bg: "from-green-950 to-green-600", + }, + blue: { + ring: "ring-blue-700", + bg: "from-blue-950 to-blue-600", + }, + purple: { + ring: "ring-purple-700", + bg: "from-purple-950 to-purple-600", + }, + pink: { + ring: "ring-pink-700", + bg: "from-pink-950 to-pink-600", + }, +}