Skip to content

Commit e92d5dc

Browse files
kevinortiz43claude
andcommitted
web/communities: keep community breadcrumb on one line on mobile
Address review feedback on the sub-community dropdown: on mobile the breadcrumb chain now stays on a single line and scrolls horizontally instead of wrapping (the "Select area" dropdown no longer drops to its own line), the breadcrumb font is slightly smaller, and the join/leave button sits on its own centered row below. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6ac8088 commit e92d5dc

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

app/web/features/communities/CommunityPage/CommunityPageSubHeader.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,30 @@ const StyledBreadcrumbsContainer = styled("div")(({ theme }) => ({
2626
},
2727
}));
2828

29-
const StyledBreadcrumbs = styled(Breadcrumbs)(() => ({
29+
const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({
3030
minWidth: 0,
3131
"& ol": {
3232
justifyContent: "flex-start",
3333
},
34+
[theme.breakpoints.down("sm")]: {
35+
width: "100%",
36+
fontSize: theme.typography.body2.fontSize,
37+
"& .MuiTypography-root, & .MuiLink-root, & .MuiButton-root": {
38+
fontSize: "inherit",
39+
},
40+
// Keep the whole chain on one line; scroll horizontally instead of wrapping
41+
// when it's wider than the screen (fits without scrolling at typical widths).
42+
"& ol": {
43+
flexWrap: "nowrap",
44+
overflowX: "auto",
45+
scrollbarWidth: "none",
46+
"&::-webkit-scrollbar": { display: "none" },
47+
},
48+
"& li": {
49+
flexShrink: 0,
50+
whiteSpace: "nowrap",
51+
},
52+
},
3453
}));
3554

3655
export default function CommunityPageSubHeader({

app/web/features/communities/CommunityPage/JoinCommunityButton.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export default function JoinCommunityButton({
7272
loading={isLoading}
7373
variant={community.member ? "outlined" : "contained"}
7474
onClick={() => (community.member ? leave.mutate() : join.mutate())}
75-
sx={{ whiteSpace: "nowrap", flexShrink: 0 }}
75+
sx={{
76+
whiteSpace: "nowrap",
77+
flexShrink: 0,
78+
alignSelf: { xs: "center", sm: "auto" },
79+
}}
7680
>
7781
{community.member
7882
? t("communities:leave_community")

app/web/features/communities/CommunityPage/SubCommunitiesDropdown.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export default function SubCommunitiesDropdown({
7878
aria-controls={open ? menuId : undefined}
7979
aria-label={t("communities:sub_community_dropdown_a11y")}
8080
onClick={(event) => setAnchorEl(event.currentTarget)}
81+
sx={{
82+
minWidth: { xs: 0, sm: 64 },
83+
pl: { xs: 0, sm: 1 },
84+
}}
8185
>
8286
{t(labelKey)}
8387
</Button>

0 commit comments

Comments
 (0)