Skip to content

Commit

Permalink
Set minWidth on participant actions column (#379)
Browse files Browse the repository at this point in the history
- To avoid text wrapping on Check In/Promote action text
- Include `ColumnDefinition` type
  • Loading branch information
taesungh authored Jan 27, 2024
1 parent 40a5ebd commit fe1505f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -46,6 +46,11 @@ const SEARCHABLE_COLUMNS: (keyof Participant)[] = [
"badge_number",
];

type StrictColumnDefinition = TableProps.ColumnDefinition<Participant> & {
id: string;
header: string;
};

function createLabelFunction(columnName: string) {
return ({ sorted, descending }: { sorted: boolean; descending: boolean }) => {
const sortState = sorted
Expand Down Expand Up @@ -164,7 +169,7 @@ function ParticipantsTable({
[initiateCheckIn, initiatePromotion, initiateConfirm],
);

const columnDefinitions = [
const columnDefinitions: StrictColumnDefinition[] = [
{
id: "uid",
header: "UID",
Expand Down Expand Up @@ -230,6 +235,7 @@ function ParticipantsTable({
id: "action",
header: "Action",
cell: ActionCell,
minWidth: 108,
},
];

Expand Down

0 comments on commit fe1505f

Please sign in to comment.