From fe1505fd2eea2f25c6a4421ab41a6c25f73730e4 Mon Sep 17 00:00:00 2001 From: Taesung Hwang <44419552+taesungh@users.noreply.github.com> Date: Sat, 27 Jan 2024 12:09:01 -0800 Subject: [PATCH] Set `minWidth` on participant actions column (#379) - To avoid text wrapping on Check In/Promote action text - Include `ColumnDefinition` type --- .../participants/components/ParticipantsTable.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/site/src/app/admin/participants/components/ParticipantsTable.tsx b/apps/site/src/app/admin/participants/components/ParticipantsTable.tsx index cde9f734..f8294f72 100644 --- a/apps/site/src/app/admin/participants/components/ParticipantsTable.tsx +++ b/apps/site/src/app/admin/participants/components/ParticipantsTable.tsx @@ -8,7 +8,7 @@ import Header from "@cloudscape-design/components/header"; import { MultiselectProps } from "@cloudscape-design/components/multiselect"; import Pagination from "@cloudscape-design/components/pagination"; import SpaceBetween from "@cloudscape-design/components/space-between"; -import Table from "@cloudscape-design/components/table"; +import Table, { TableProps } from "@cloudscape-design/components/table"; import ApplicantStatus from "@/app/admin/applicants/components/ApplicantStatus"; import { Participant } from "@/lib/admin/useParticipants"; @@ -46,6 +46,11 @@ const SEARCHABLE_COLUMNS: (keyof Participant)[] = [ "badge_number", ]; +type StrictColumnDefinition = TableProps.ColumnDefinition & { + id: string; + header: string; +}; + function createLabelFunction(columnName: string) { return ({ sorted, descending }: { sorted: boolean; descending: boolean }) => { const sortState = sorted @@ -164,7 +169,7 @@ function ParticipantsTable({ [initiateCheckIn, initiatePromotion, initiateConfirm], ); - const columnDefinitions = [ + const columnDefinitions: StrictColumnDefinition[] = [ { id: "uid", header: "UID", @@ -230,6 +235,7 @@ function ParticipantsTable({ id: "action", header: "Action", cell: ActionCell, + minWidth: 108, }, ];