-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from chingu-x/feature/CGD-34
Feature/cgd 34
- Loading branch information
Showing
9 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.table :where(td) { | ||
@apply py-1; | ||
} | ||
|
||
.table :where(th) { | ||
@apply pb-6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { PencilSquareIcon } from "@heroicons/react/24/solid"; | ||
import { TeamMember } from "./fixtures/MyTeam"; | ||
import { Button } from "@/components"; | ||
|
||
interface TeamRowProps { | ||
teamMember: TeamMember; | ||
currentUserId: string; | ||
} | ||
|
||
function TeamRow({ teamMember, currentUserId }: TeamRowProps) { | ||
return ( | ||
<tr> | ||
<td className="text-black">{teamMember.name}</td> | ||
<td>{teamMember.discordId}</td> | ||
<td> | ||
<div className="flex items-center justify-between h-[35px] bg-white rounded-md pl-4"> | ||
{teamMember.averageHour === 0 ? "Add hours" : teamMember.averageHour} | ||
{teamMember.id === currentUserId && ( | ||
<Button | ||
title={"edit"} | ||
customClassName="pl-2 pr-1 h-full rounded-l-none rounded-r-md p-0 min-h-0 text-sm font-semibold text-black bg-white border-transparent hover:bg-white hover:border-transparent" | ||
> | ||
<PencilSquareIcon className="w-4 h-4 text-black" /> | ||
</Button> | ||
)} | ||
</div> | ||
</td> | ||
<td>{teamMember.location}</td> | ||
<td>{teamMember.timeZone}</td> | ||
<td>{teamMember.email}</td> | ||
<td>{teamMember.position}</td> | ||
</tr> | ||
); | ||
} | ||
|
||
export default TeamRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import styles from "./TeamRow.module.css"; | ||
import { teamMembers } from "./fixtures/MyTeam"; | ||
import { TeamRow } from "."; | ||
|
||
// Temp: | ||
const currentUserId = "1"; | ||
|
||
function TeamTable() { | ||
return ( | ||
<div className="overflow-x-auto"> | ||
<table | ||
className={`table px-6 pb-10 border-separate border-none bg-primary-content pt-7 ${styles["table"]}`} | ||
> | ||
{/* head */} | ||
<thead className="mb-10 text-xl font-semibold text-black"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Discord ID</th> | ||
<th>Average Hour/Sprint</th> | ||
<th>Location</th> | ||
<th>Time Zone</th> | ||
<th>Email</th> | ||
<th>Position</th> | ||
</tr> | ||
</thead> | ||
<tbody className="text-base font-medium text-neutral"> | ||
{/* rows */} | ||
{teamMembers.map((teamMember) => ( | ||
<TeamRow | ||
key={teamMember.id} | ||
teamMember={teamMember} | ||
currentUserId={currentUserId} | ||
/> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
} | ||
|
||
export default TeamTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
export interface TeamMember { | ||
id: string; | ||
name: string; | ||
discordId: string; | ||
averageHour: number; | ||
location: string; | ||
timeZone: string; | ||
email: string; | ||
position: string; | ||
} | ||
|
||
export const teamMembers: TeamMember[] = [ | ||
{ | ||
id: "1", | ||
name: "Danney Trieu", | ||
discordId: "danneytrieuwork#2558", | ||
averageHour: 0, | ||
location: "Denver, CO, USA", | ||
timeZone: "MDT", | ||
email: "[email protected]", | ||
position: "Product Owner", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Jane Morez", | ||
discordId: "Jan_morez#2341", | ||
averageHour: 0, | ||
location: "Las Vegas, NY, USA", | ||
timeZone: "PDT", | ||
email: "[email protected]", | ||
position: "Back-end Developer", | ||
}, | ||
{ | ||
id: "3", | ||
name: "Kayla Montre", | ||
discordId: "KaylaMon#5678", | ||
averageHour: 12, | ||
location: "Las Vegas, NY, USA", | ||
timeZone: "PDT", | ||
email: "[email protected]", | ||
position: "UX/UI Designer", | ||
}, | ||
{ | ||
id: "4", | ||
name: "Jackson Pez", | ||
discordId: "jackson#2558", | ||
averageHour: 10, | ||
location: "Denver, CO, USA", | ||
timeZone: "MDT", | ||
email: "[email protected]", | ||
position: "Front-end Developer", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as TeamTable } from "./TeamTable"; | ||
export { default as TeamRow } from "./TeamRow"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DirectoryPage } from "./page"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { TeamTable } from "./components"; | ||
|
||
function DirectoryPage() { | ||
return <TeamTable />; | ||
} | ||
|
||
export default DirectoryPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
::-webkit-scrollbar { | ||
width: 4px; | ||
height: 6px | ||
} | ||
|
||
::-webkit-scrollbar-track { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters