diff --git a/frontend/src/components/Table.tsx b/frontend/src/components/Table.tsx index 4663dfd42..6540ef1f6 100644 --- a/frontend/src/components/Table.tsx +++ b/frontend/src/components/Table.tsx @@ -29,15 +29,15 @@ function Table({ bottomElement, }: TableProps): React.ReactElement { return ( -
+
{/* MOBILE PAGINATION */} -
+
{bottomElement}
{/* MOBILE TABLE */}
- +
{!loading && data.map((row, rowIdx) => ( ({ > {columns.map((col, colIdx) => ( ({
({ keyFromValue(row).toString() } scope="row" - className="text-ellipsis whitespace-normal px-8 py-3 font-medium text-gray-900" + className="min-w-0 place-items-center overflow-hidden text-ellipsis text-wrap py-3 pr-2 font-medium text-gray-900" > {col.value(row)} @@ -132,7 +133,9 @@ function Table({ )} -
+ + {/* WIDESCREEN PAGINATION */} +
{bottomElement}
diff --git a/frontend/src/components/tables/RankingsTable.tsx b/frontend/src/components/tables/RankingsTable.tsx index 1e9fb6e18..33ca09e50 100644 --- a/frontend/src/components/tables/RankingsTable.tsx +++ b/frontend/src/components/tables/RankingsTable.tsx @@ -19,13 +19,6 @@ interface RankingsTableProps { handlePage: (page: number) => void; } -function trimString(str: string, maxLength: number): string { - if (str.length > maxLength) { - return str.slice(0, maxLength - 1) + "..."; - } - return str; -} - const RankingsTable: React.FC = ({ data, loading, @@ -35,8 +28,6 @@ const RankingsTable: React.FC = ({ const { episodeId } = useEpisodeId(); const episode = useEpisodeInfo({ id: episodeId }); - const MAX_NAME_LENGTH = 20; - return ( = ({ key: "members", value: (team) => team.members.map((member, idx) => ( - <> - - {trimString(member.username, MAX_NAME_LENGTH)} - - {idx !== team.members.length - 1 ? ", " : ""} - + + {member.username + + (idx !== team.members.length - 1 ? ", " : "")} + )), }, { diff --git a/frontend/src/components/tables/TournamentsTable.tsx b/frontend/src/components/tables/TournamentsTable.tsx index 231651944..b5dd88996 100644 --- a/frontend/src/components/tables/TournamentsTable.tsx +++ b/frontend/src/components/tables/TournamentsTable.tsx @@ -45,7 +45,7 @@ const TournamentsTable: React.FC = ({ header: "Tournament", key: "name_long", value: (tour) => ( - {tour.name_long} + {tour.name_long} ), }, { @@ -66,7 +66,9 @@ const TournamentsTable: React.FC = ({ { header: "About", key: "blurb", - value: (tour) =>
{tour.blurb}
, + value: (tour) => ( +
{tour.blurb}
+ ), }, ]} /> diff --git a/frontend/src/components/tables/scrimmaging/TeamsTable.tsx b/frontend/src/components/tables/scrimmaging/TeamsTable.tsx index 21609dd2b..2b470e2ea 100644 --- a/frontend/src/components/tables/scrimmaging/TeamsTable.tsx +++ b/frontend/src/components/tables/scrimmaging/TeamsTable.tsx @@ -19,21 +19,12 @@ interface TeamsTableProps { handleSearch: (search: string) => void; } -function trimString(str: string, maxLength: number): string { - if (str.length > maxLength) { - return str.slice(0, maxLength - 1) + "..."; - } - return str; -} - const TeamsTable: React.FC = ({ search, teamsPage, handlePage, handleSearch, }) => { - const MAX_NAME_LENGTH = 13; - const { episodeId } = useEpisodeId(); const episodeInfo = useEpisodeInfo({ id: episodeId }); const queryClient = useQueryClient(); @@ -128,7 +119,7 @@ const TeamsTable: React.FC = ({ to={`/${episodeId}/team/${team.id}`} className="hover:underline" > - {trimString(team.name, MAX_NAME_LENGTH)} + {team.name} ), }, @@ -137,16 +128,14 @@ const TeamsTable: React.FC = ({ key: "members", value: (team) => team.members.map((member, idx) => ( - <> - - {trimString(member.username, MAX_NAME_LENGTH)} - - {idx !== team.members.length - 1 ? ", " : ""} - + + {member.username + + (idx !== team.members.length - 1 ? ", " : "")} + )), }, {