-
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 #32 from chingu-x/feature/team-directory-responsive
Feature/team directory responsive
- Loading branch information
Showing
8 changed files
with
115 additions
and
23 deletions.
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,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 ( | ||
<div | ||
className={`flex items-center justify-between h-[35px] rounded-md pl-4 ${ | ||
teamMember.id === currentUserId && | ||
"bg-base-100 hover:bg-secondary transition" | ||
}`} | ||
> | ||
{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-medium text-base-300 bg-transparent border-transparent hover:bg-transparent hover:border-transparent" | ||
> | ||
<PencilSquareIcon className="w-4 h-4 text-base-300" /> | ||
</Button> | ||
)} | ||
</div> | ||
); | ||
} |
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,43 @@ | ||
import { EditCell, TeamMember } from "."; | ||
|
||
interface TeamCardProps { | ||
teamMember: TeamMember; | ||
currentUserId: string; | ||
} | ||
|
||
export default function TeamCard({ teamMember, currentUserId }: TeamCardProps) { | ||
return ( | ||
<div className="box-border flex flex-col items-center p-10 card bg-secondary-content"> | ||
<ul className="flex flex-col gap-6 min-w-[400px]"> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Name</span> | ||
<span>{teamMember.name}</span> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Discord ID</span> | ||
<span>{teamMember.discordId}</span> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Average Hour/Sprint</span> | ||
<EditCell teamMember={teamMember} currentUserId={currentUserId} /> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Location</span> | ||
<span>{teamMember.location}</span> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Timezone</span> | ||
<span>{teamMember.timeZone}</span> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Email</span> | ||
<span>{teamMember.email}</span> | ||
</li> | ||
<li className="grid grid-cols-2 gap-6"> | ||
<span className="font-semibold">Position</span> | ||
<span>{teamMember.position}</span> | ||
</li> | ||
</ul> | ||
</div> | ||
); | ||
} |
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,19 @@ | ||
import { TeamCard, teamMembers } from "."; | ||
|
||
// Temp: | ||
const currentUserId = "1"; | ||
|
||
export default function TeamCardsContainer() { | ||
return ( | ||
<div className="flex flex-col min-[1920px]:hidden gap-y-10 w-full text-base-300 text-medium"> | ||
{/* cards */} | ||
{teamMembers.map((teamMember) => ( | ||
<TeamCard | ||
key={teamMember.id} | ||
teamMember={teamMember} | ||
currentUserId={currentUserId} | ||
/> | ||
))} | ||
</div> | ||
); | ||
} |
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,12 @@ | ||
import { TeamCardsContainer, TeamTable } from "."; | ||
|
||
export default function TeamDirectory() { | ||
return ( | ||
<> | ||
{/* For screens > 1920px */} | ||
<TeamTable /> | ||
{/* For screens < 1920px */} | ||
<TeamCardsContainer /> | ||
</> | ||
); | ||
} |
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
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
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 |
---|---|---|
@@ -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"; |
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