diff --git a/src/app/directory/components/EditCell.tsx b/src/app/directory/components/EditCell.tsx new file mode 100644 index 00000000..53a7cb16 --- /dev/null +++ b/src/app/directory/components/EditCell.tsx @@ -0,0 +1,29 @@ +import { PencilSquareIcon } from "@heroicons/react/24/solid"; +import { TeamMember } from "."; +import { Button } from "@/components"; + +interface EditCellProps { + teamMember: TeamMember; + currentUserId: string; +} + +export default function EditCell({ teamMember, currentUserId }: EditCellProps) { + return ( +
+ {teamMember.averageHour === 0 ? "Add hours" : teamMember.averageHour} + {teamMember.id === currentUserId && ( + + )} +
+ ); +} diff --git a/src/app/directory/components/TeamCard.tsx b/src/app/directory/components/TeamCard.tsx new file mode 100644 index 00000000..125c6366 --- /dev/null +++ b/src/app/directory/components/TeamCard.tsx @@ -0,0 +1,43 @@ +import { EditCell, TeamMember } from "."; + +interface TeamCardProps { + teamMember: TeamMember; + currentUserId: string; +} + +export default function TeamCard({ teamMember, currentUserId }: TeamCardProps) { + return ( +
+ +
+ ); +} diff --git a/src/app/directory/components/TeamCardsContainer.tsx b/src/app/directory/components/TeamCardsContainer.tsx new file mode 100644 index 00000000..fa00fddd --- /dev/null +++ b/src/app/directory/components/TeamCardsContainer.tsx @@ -0,0 +1,19 @@ +import { TeamCard, teamMembers } from "."; + +// Temp: +const currentUserId = "1"; + +export default function TeamCardsContainer() { + return ( +
+ {/* cards */} + {teamMembers.map((teamMember) => ( + + ))} +
+ ); +} diff --git a/src/app/directory/components/TeamDirectory.tsx b/src/app/directory/components/TeamDirectory.tsx new file mode 100644 index 00000000..4d3e02d8 --- /dev/null +++ b/src/app/directory/components/TeamDirectory.tsx @@ -0,0 +1,12 @@ +import { TeamCardsContainer, TeamTable } from "."; + +export default function TeamDirectory() { + return ( + <> + {/* For screens > 1920px */} + + {/* For screens < 1920px */} + + + ); +} diff --git a/src/app/directory/components/TeamRow.tsx b/src/app/directory/components/TeamRow.tsx index 00db8611..4a950098 100644 --- a/src/app/directory/components/TeamRow.tsx +++ b/src/app/directory/components/TeamRow.tsx @@ -1,28 +1,17 @@ -import { PencilSquareIcon } from "@heroicons/react/24/solid"; -import { TeamMember } from "."; - +import { EditCell, TeamMember } from "."; interface TeamRowProps { teamMember: TeamMember; currentUserId: string; } -function TeamRow({ teamMember, currentUserId }: TeamRowProps) { +export default function TeamRow({ teamMember, currentUserId }: TeamRowProps) { return ( {teamMember.name} {teamMember.discordId} -
- {teamMember.averageHour === 0 ? "Add hours" : teamMember.averageHour} - {teamMember.id === currentUserId && ( -
- -
- )} -
+ {teamMember.location} {teamMember.timeZone} @@ -31,5 +20,3 @@ function TeamRow({ teamMember, currentUserId }: TeamRowProps) { ); } - -export default TeamRow; diff --git a/src/app/directory/components/TeamTable.tsx b/src/app/directory/components/TeamTable.tsx index 2db71ef2..ea25d1c2 100644 --- a/src/app/directory/components/TeamTable.tsx +++ b/src/app/directory/components/TeamTable.tsx @@ -4,11 +4,11 @@ import { TeamRow, teamMembers } from "."; // Temp: const currentUserId = "1"; -function TeamTable() { +export default function TeamTable() { return ( -
+
{/* head */} @@ -36,5 +36,3 @@ function TeamTable() { ); } - -export default TeamTable; diff --git a/src/app/directory/components/index.ts b/src/app/directory/components/index.ts index 0ecd173c..9c89cbb7 100644 --- a/src/app/directory/components/index.ts +++ b/src/app/directory/components/index.ts @@ -1,3 +1,7 @@ export { default as TeamTable } from "./TeamTable"; export { default as TeamRow } from "./TeamRow"; +export { default as TeamCard } from "./TeamCard"; +export { default as TeamCardsContainer } from "./TeamCardsContainer"; +export { default as EditCell } from "./EditCell"; +export { default as TeamDirectory } from "./TeamDirectory"; export * from "./fixtures/MyTeam"; diff --git a/src/app/directory/page.tsx b/src/app/directory/page.tsx index 47471041..96f2aec8 100644 --- a/src/app/directory/page.tsx +++ b/src/app/directory/page.tsx @@ -1,4 +1,4 @@ -import { TeamTable } from "."; +import { TeamDirectory } from "."; import { Banner } from "@/components"; function DirectoryPage() { @@ -10,7 +10,7 @@ function DirectoryPage() { title="Directory" description="Behold, your mighty band of teammates! If you want them to plan with precision and prowess, make sure your deets are up to date, or else prepare for some serious spreadsheet confusion!" /> - ; + ); }