Skip to content

Commit

Permalink
style: move logo into company column for event table
Browse files Browse the repository at this point in the history
  • Loading branch information
matalex412 committed Aug 22, 2024
1 parent dde66c1 commit 2e20edf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions app/events/EventTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,26 @@ const EventTable = ({
const columnDefsMap = useMemo(() => {
const columnDefsMap_: Partial<Record<ColumnName, ColumnDef<EventRow, any>>> = {
"company.name": {
cell: info => <Link href={getCompanyLink(info.row.original.company)}>{info.getValue()}</Link>,
header: "Company",
id: "company.name",
sortingFn: "alphanumeric",
},
"company.logo": {
cell: info => (
<Flex align="center" justify="center">
<Flex align="center" justify="start" gap="4">
<Flex justify="center" height="4em" maxWidth="8em">
{info.getValue() && (
<Image
unoptimized
src={`/api/uploads/${info.getValue()}`}
src={`/api/uploads/${info.row.original.company.logo}`}
alt="profile teaser"
width={100}
height={100}
className={styles.logo}
/>
)}
</Flex>
<Link href={getCompanyLink(info.row.original.company)}>{info.getValue()}</Link>
</Flex>
),
header: "",
enableSorting: false,
header: "Company",
id: "company.name",
sortingFn: "alphanumeric",
},
title: {
cell: info => <Link href={`/events/${info.row.original.id}`}>{info.getValue()}</Link>,
Expand Down
2 changes: 1 addition & 1 deletion app/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const EventsPage = async () => {
<Heading size="8">Events</Heading>
<EventTable
events={events}
columns={["company.logo", "company.name", "title", "dateStart", "shortDescription", "location", "spaces"]}
columns={["company.name", "title", "dateStart", "shortDescription", "location", "spaces"]}
/>
</Flex>
</RestrictedArea>
Expand Down

0 comments on commit 2e20edf

Please sign in to comment.