Skip to content

Commit

Permalink
fix: move temp variable to TeamTable
Browse files Browse the repository at this point in the history
  • Loading branch information
JaneMoroz committed Sep 7, 2023
1 parent f60d41b commit 6ec6fae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/app/my-team/components/TeamRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { PencilSquareIcon } from "@heroicons/react/24/solid";
import { TeamMember } from "./fixtures/MyTeam";
import { Button } from "@/components";

// Temp:
const currentUserId = "1";

interface TeamRowProps {
teamMemeber: TeamMember;
currentUserId: string;
}

function TeamRow({ teamMemeber }: TeamRowProps) {
function TeamRow({ teamMemeber, currentUserId }: TeamRowProps) {
return (
<tr>
<td className="text-black">{teamMemeber.name}</td>
Expand All @@ -20,7 +18,7 @@ function TeamRow({ teamMemeber }: TeamRowProps) {
{teamMemeber.id === currentUserId && (
<Button
title={"edit"}
customClassName="gap-x-0 px-2 h-8 p-0 min-h-full text-sm font-semibold text-black bg-white border-transparent"
customClassName="pl-2 pr-1 h-8 p-0 min-h-full text-sm font-semibold text-black bg-white border-transparent"
>
<PencilSquareIcon className="w-4 h-4 text-black" />
</Button>
Expand Down
9 changes: 8 additions & 1 deletion src/app/my-team/components/TeamTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { teamMembers } from "./fixtures/MyTeam";
import { TeamRow } from ".";

// Temp:
const currentUserId = "1";

function TeamTable() {
return (
<div className="overflow-x-auto">
Expand All @@ -20,7 +23,11 @@ function TeamTable() {
<tbody className="text-base font-medium text-neutral">
{/* rows */}
{teamMembers.map((teamMemeber) => (
<TeamRow key={teamMemeber.id} teamMemeber={teamMemeber} />
<TeamRow
key={teamMemeber.id}
teamMemeber={teamMemeber}
currentUserId={currentUserId}
/>
))}
</tbody>
</table>
Expand Down

0 comments on commit 6ec6fae

Please sign in to comment.