Skip to content

Commit 93f1b24

Browse files
committed
restrict width of title link on mobile
1 parent 1ea83d5 commit 93f1b24

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/DashboardCard.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ const CardRoot = styled.div(({ theme }) => ({
5353
},
5454
}))
5555

56+
const TitleLink = styled(Link)(({ theme }) => ({
57+
[theme.breakpoints.down("md")]: {
58+
maxWidth: "calc(100% - 16px)",
59+
},
60+
}))
61+
5662
const MenuButton = styled(ActionButton)(({ theme }) => ({
5763
marginLeft: "-8px",
5864
[theme.breakpoints.down("md")]: {
@@ -262,9 +268,9 @@ const DashboardCard: React.FC<DashboardCardProps> = ({
262268
const desktopLayout = (
263269
<CardRoot data-testid="enrollment-card-desktop">
264270
<Stack justifyContent="start" alignItems="stretch" gap="8px" flex={1}>
265-
<Link size="medium" color="black" href={marketingUrl}>
271+
<TitleLink size="medium" color="black" href={marketingUrl}>
266272
{title}
267-
</Link>
273+
</TitleLink>
268274
{enrollment?.status === EnrollmentStatus.Completed ? (
269275
<SubtitleLink href="#">
270276
{<RiAwardLine size="16px" />}
@@ -311,9 +317,9 @@ const DashboardCard: React.FC<DashboardCardProps> = ({
311317
width="100%"
312318
>
313319
<Stack direction="column" gap="8px">
314-
<Link size="medium" color="black" href={marketingUrl}>
320+
<TitleLink size="medium" color="black" href={marketingUrl}>
315321
{title}
316-
</Link>
322+
</TitleLink>
317323
{enrollment?.status === EnrollmentStatus.Completed ? (
318324
<SubtitleLink href="#">
319325
{<RiAwardLine size="16px" />}

0 commit comments

Comments
 (0)