Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat: finishing responsive-ness on manage teams screens

Andrejbf5c55c073f0
diff --git a/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx b/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx
index 70d88ee46..daec1835f 100644
--- a/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx
+++ b/apps/web/src/components/common/sidebar/sections/manage-teams/index.tsx
@@ -16,7 +16,7 @@ function ManageTeams() {
const onManageTeams = () => {
setProject(undefined);
navigate({
- to: "/dashboard/workspace/$workspaceId/team",
+ to: "/dashboard/workspace/$workspaceId/team/members",
params: {
workspaceId,
},
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/team/invitations.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/team/invitations.tsx
index 022663165..f555b8f4f 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/team/invitations.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/team/invitations.tsx
@@ -41,7 +41,7 @@ function RouteComponent() {
key={invitation.id}
className="p-4 border-b border-zinc-200 dark:border-zinc-800 last:border-0"
>
- <div className="flex items-center gap-3 mb-3">
+ <div className="flex items-center gap-3">
<Avatar className="h-8 w-8">
<AvatarFallback className="bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 uppercase">
{invitation.email[0]}
@@ -64,11 +64,6 @@ function RouteComponent() {
</div>
</div>
</div>
- <div className="flex items-center justify-between">
- <span className="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700 dark:bg-indigo-500/10 dark:text-indigo-400">
- Admin
- </span>
- </div>
</div>
))}
</div>
diff --git a/apps/web/src/routes/dashboard/workspace/$workspaceId/team/members.tsx b/apps/web/src/routes/dashboard/workspace/$workspaceId/team/members.tsx
index 20c18c9ca..e40bf6e8c 100644
--- a/apps/web/src/routes/dashboard/workspace/$workspaceId/team/members.tsx
+++ b/apps/web/src/routes/dashboard/workspace/$workspaceId/team/members.tsx
@@ -1,5 +1,10 @@
-import TeamTable from "@/components/team/team-table";
+import InviteTeamMemberModal from "@/components/team/invite-team-member-modal";
+import { Avatar, AvatarFallback } from "@/components/ui/avatar";
+import useGetWorkspaceUsers from "@/hooks/queries/workspace-users/use-get-workspace-users";
import { createFileRoute } from "@tanstack/react-router";
+import { motion } from "framer-motion";
+import { Shield } from "lucide-react";
+import { useState } from "react";
export const Route = createFileRoute(
"/dashboard/workspace/$workspaceId/team/members",
@@ -8,20 +13,125 @@ export const Route = createFileRoute(
});
function RouteComponent() {
+ const { workspaceId } = Route.useParams();
+ const { data: users } = useGetWorkspaceUsers({ workspaceId });
+ const [isInviteTeamMemberModalOpen, setIsInviteTeamMemberModalOpen] =
+ useState(false);
+
return (
- <>
- <div className="flex-1 p-6">
- <div className="w-full">
- <div className="flex items-center justify-between mb-6">
- <h1 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
- Team Members
- </h1>
+ <motion.div
+ className="flex-1 p-4 md:p-6"
+ initial={{ opacity: 0, y: 20 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.2 }}
+ >
+ <div className="flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6">
+ <h1 className="text-xl md:text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
+ Team Members
+ </h1>
+ </div>
+
+ <div className="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden">
+ <div className="overflow-x-auto">
+ <div className="md:hidden">
+ {users?.map((member) => (
+ <motion.div
+ key={member.userEmail}
+ initial={{ opacity: 0, y: 20 }}
+ animate={{ opacity: 1, y: 0 }}
+ className="p-4 border-b border-zinc-200 dark:border-zinc-800 last:border-0"
+ >
+ <div className="flex items-center justify-between mb-3">
+ <div className="flex items-center gap-3">
+ <Avatar className="h-8 w-8">
+ <AvatarFallback className="bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 uppercase">
+ {member.userName?.[0]}
+ </AvatarFallback>
+ </Avatar>
+ <div>
+ <div className="text-sm font-medium text-zinc-900 dark:text-zinc-100">
+ {member.userName}
+ </div>
+ <div className="text-xs text-zinc-500 dark:text-zinc-400">
+ {member.userEmail}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div className="flex items-center gap-2">
+ <span className="inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700 dark:bg-indigo-500/10 dark:text-indigo-400">
+ <Shield className="w-3 h-3" />
+ Admin
+ </span>
+ </div>
+ </motion.div>
+ ))}
</div>
+
+ <table className="w-full hidden md:table">
+ <thead>
+ <tr className="border-b border-zinc-200 dark:border-zinc-800">
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Member
+ </th>
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Role
+ </th>
+ <th className="text-left py-3 px-4 text-sm font-medium text-zinc-500 dark:text-zinc-400">
+ Email
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {users?.map((member) => (
+ <motion.tr
+ key={member.userEmail}
+ initial={{ opacity: 0, y: 20 }}
+ animate={{ opacity: 1, y: 0 }}
+ className="border-b border-zinc-200 dark:border-zinc-800 last:border-0"
+ >
+ <td className="py-3 px-4">
+ <div className="flex items-center gap-3">
+ <Avatar className="h-6 w-6">
+ <AvatarFallback className="bg-indigo-100 dark:bg-indigo-900/50 text-indigo-600 dark:text-indigo-400 uppercase text-xs">
+ {member.userName?.[0]}
+ </AvatarFallback>
+ </Avatar>
+ <span className="text-sm font-medium text-zinc-900 dark:text-zinc-100">
+ {member.userName}
+ </span>
+ </div>
+ </td>
+ <td className="py-3 px-4">
+ <div className="flex items-center gap-2">
+ <span className="inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium bg-indigo-50 text-indigo-700 dark:bg-indigo-500/10 dark:text-indigo-400">
+ <Shield className="w-3 h-3" />
+ Admin
+ </span>
+ </div>
+ </td>
+ <td className="py-3 px-4 text-sm text-zinc-500 dark:text-zinc-400">
+ {member.userEmail}
+ </td>
+ </motion.tr>
+ ))}
+ </tbody>
+ </table>
</div>
- <div className="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden">
- <TeamTable />
- </div>
+
+ {users?.length === 0 && (
+ <div className="py-12 text-center">
+ <p className="text-zinc-500 dark:text-zinc-400">
+ No team members found
+ </p>
+ </div>
+ )}
</div>
- </>
+
+ <InviteTeamMemberModal
+ open={isInviteTeamMemberModalOpen}
+ onClose={() => setIsInviteTeamMemberModalOpen(false)}
+ />
+ </motion.div>
);
}