Skip to content

Commit

Permalink
DEAR-125: show marked user in team members table
Browse files Browse the repository at this point in the history
  • Loading branch information
baurnick committed Jul 21, 2024
1 parent 2471425 commit 1745125
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/(main)/team/(teammember)/[id]/members/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const TeamMembersPage: React.FC<TeamMembersPageProps> = ({ params }) => {
const inputRef = React.useRef<HTMLInputElement>(null);
const { data, isLoading, error } = useSWRClient<TeamWithMembers>(`/v1/team-member/${teamId}`);
const { code: teamCode } = data?.team || {};
const { userId: currentUserId } = useAuth();
const { userId } = useAuth();
const currentUserId = parseInt(userId || '0', 10);

const copyToClipboard = () => {
const inputValue = inputRef.current?.value;
Expand Down
6 changes: 2 additions & 4 deletions app/(main)/team/components/TeamMembersTable/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import cn from '@/lib/utils';
import DataTableColumnHeader from '@components/ui/Table/DataTableColumnHeader';
import { Asterisk } from 'lucide-react';

export const columns = (currentUserId: string | undefined): ColumnDef<TeamMemberWithUser>[] => [
export const columns = (currentUserId: number): ColumnDef<TeamMemberWithUser>[] => [
{
id: 'activeUser',
cell: ({ row }) => (
<div>{currentUserId === row.original.user.id.toString() && <Asterisk className="h-4 w-4" />}</div>
),
cell: ({ row }) => <div>{currentUserId === row.original.user.id && <Asterisk className="h-4 w-4" />}</div>,
},
{
id: 'name',
Expand Down

0 comments on commit 1745125

Please sign in to comment.