Skip to content

Commit

Permalink
Small modifications made
Browse files Browse the repository at this point in the history
  • Loading branch information
Duosi-Dai committed Aug 9, 2024
1 parent 86649dc commit ecb033a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 87 deletions.
60 changes: 60 additions & 0 deletions src/app/about/_components/OrganizationList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"use client"
import PersonCard from "@/app/about/_components/PersonCard"
import { Organization } from "@/components/shared/hooks/api/useOrganization"
import { Button } from "@/components/ui/button"
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react"
import { useState } from "react"

const OrganizationList = ({ group }: { group: Organization }) => {
const [showOTs, setShowOTs] = useState(false)

const handleButtonClick = () => {
setShowOTs(prevState => !prevState)
}

const projectGroup = group.people.filter(
person =>
person.role.toLowerCase().includes("project group") ||
person.role.toLowerCase().includes("project manager")
)
const operationTeam = group.people.filter(person =>
person.role.toLowerCase().includes("operation team")
)

return (
<div key={group.name} className="mt-16">
<h2 className="font-bebas-neue text-3xl">{group.name}</h2>
<div className="mt-5 flex flex-wrap items-start justify-center gap-6 md:justify-start">
{projectGroup.map(person => (
<PersonCard key={person.id} person={person} />
))}
{showOTs &&
operationTeam.map(person => (
<PersonCard key={person.id} person={person} />
))}
<div className="my-20 flex justify-center">
{group.name === "Project Manager" ? null : (
<Button
variant={"secondary"}
className="dark:bg-liqorice-700"
onClick={handleButtonClick}>
{showOTs ? (
<>
<ArrowLeftIcon className="mr-4 h-4 w-4" />
See Less Members
</>
) : (
<>
See More Members
<ArrowRightIcon className="ml-4 h-4 w-4" />
</>
)}
</Button>
)}
</div>
</div>
</div>
)
}

export default OrganizationList
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { LinkedinIcon, MailIcon } from "lucide-react"
import Image from "next/image"
import Link from "next/link"

const TeamUpdateList = (person: Person) => {
const PersonCard = ({ person }: { person: Person }) => {
return (
<>
{" "}
<div key={person.id} className="w-52">
{person.picture == null || person.picture.includes("no-image") ? (
<div className="flex aspect-square w-52 flex-1 items-center justify-center">
Expand Down Expand Up @@ -51,4 +50,4 @@ const TeamUpdateList = (person: Person) => {
</>
)
}
export default TeamUpdateList
export default PersonCard
80 changes: 0 additions & 80 deletions src/app/about/_components/TeamUpdate.tsx

This file was deleted.

6 changes: 2 additions & 4 deletions src/app/about/team/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TeamUpdate from "@/app/about/_components/TeamUpdate"
import OrganizationList from "@/app/about/_components/OrganizationList"
import { Page } from "@/components/shared/Page"
import { fetchOrganization } from "@/components/shared/hooks/api/useOrganization"
import { Metadata } from "next"
Expand All @@ -21,9 +21,7 @@ export default async function TeamPage() {
<Page.Header>Meet the team</Page.Header>
<div className="">
{organization.map(group => (
<>
<TeamUpdate name={group.name} people={group.people} />
</>
<OrganizationList key={group.name} group={group} />
))}
</div>
</Page.Boundary>
Expand Down

0 comments on commit ecb033a

Please sign in to comment.