Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: resolve text overflow issues for workspace empty state
  • Loading branch information
Parkreiner committed Jul 25, 2024
commit fe5421c014f7008a1928d3125579b84f8dacf2f2
33 changes: 26 additions & 7 deletions site/src/pages/WorkspacesPage/WorkspacesEmpty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export const WorkspacesEmpty = (props: {
>
{featuredTemplates?.map((t) => (
<Link
to={`/templates/${t.name}/workspace`}
key={t.id}
to={`/templates/${t.name}/workspace`}
css={(theme) => ({
width: "320px",
padding: 16,
Expand All @@ -120,19 +120,38 @@ export const WorkspacesEmpty = (props: {
{t.name}
</Avatar>
</div>
<div>
<h4 css={{ fontSize: 14, fontWeight: 600, margin: 0 }}>
{t.display_name.length > 0 ? t.display_name : t.name}

<div css={{ width: "100%", minWidth: "0" }}>
<h4
css={{
fontSize: 14,
fontWeight: 600,
margin: 0,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{t.display_name || t.name}
</h4>
<span

<p
css={(theme) => ({
fontSize: 13,
color: theme.palette.text.secondary,
lineHeight: "0.5",
lineHeight: "1.4",
margin: 0,
paddingTop: "4px",

// We've had users plug URLs directly into the
// descriptions, when those URLS have no hyphens or other
// easy semantic breakpoints. Need to set this to ensure
// those URLs don't break outside their containing boxes
wordBreak: "break-word",
})}
>
{t.description}
</span>
</p>
</div>
</Link>
))}
Expand Down
Loading