Skip to content

Commit 837bcbc

Browse files
authored
Style: Mobile breadcrumb updates (#952)
1 parent cb5f541 commit 837bcbc

File tree

19 files changed

+932
-923
lines changed

19 files changed

+932
-923
lines changed

frontend/src/components/layouts/AppLayout/AppLayout.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
background-color: #f9fafc;
3434

3535
@include mixins.scrollbar;
36+
37+
@media (max-width: 767px) {
38+
padding: 16px 16px 56px;
39+
}
3640
}
3741

3842
.sidebarOpen {

frontend/src/components/layouts/AppLayout/Topbar/Topbar.module.scss

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,47 @@
1313
.topBarMain {
1414
display: flex;
1515
align-items: center;
16-
padding: var(--hi-spacing-md);
16+
padding: 0 16px;
1717
height: 60px;
18+
19+
@include mixins.respond-below(md) {
20+
padding: 0 12px;
21+
}
1822
}
1923

2024
.breadcrumbsRow {
21-
padding: 6px var(--hi-spacing-md) 8px;
22-
padding-top: 7px;
25+
padding: 10px 20px;
2326
border-top: 1px solid rgba(0, 0, 0, 0.05);
2427
background-color: #fff;
2528
backdrop-filter: blur(8px);
2629
display: flex;
2730
align-items: center;
2831
justify-content: space-between;
32+
gap: 12px;
2933
border-top-left-radius: var(--hi-radius-md);
3034
box-shadow: 3px 0px 8px rgb(0 0 0 / 8%);
3135
position: relative;
3236
z-index: 5;
33-
min-height: 50px;
34-
35-
&::before {
36-
content: '';
37-
position: absolute;
38-
top: -1px;
39-
left: 0;
40-
width: 16px;
41-
height: 16px;
42-
background-color: #fff;
43-
border-top-left-radius: 16px;
44-
z-index: -1;
45-
}
37+
min-height: 44px;
4638

4739
@include mixins.respond-below(md) {
4840
border-top-left-radius: 0;
41+
padding: 10px 16px;
42+
}
43+
}
4944

50-
&::before {
45+
.breadcrumbContentRight {
46+
flex-shrink: 0;
47+
48+
@include mixins.respond-below(sm) {
49+
// Hide text in buttons, show only icons on very small screens
50+
:global(.mantine-Button-label) {
5151
display: none;
5252
}
53+
54+
:global(.mantine-Button-section) {
55+
margin: 0;
56+
}
5357
}
5458
}
5559

@@ -59,7 +63,8 @@
5963
align-items: center;
6064
font-size: 0.85rem;
6165
color: var(--hi-text-light);
62-
width: 100%;
66+
flex: 1;
67+
min-width: 0;
6368
overflow-x: auto;
6469
white-space: nowrap;
6570
scrollbar-width: none;
@@ -69,10 +74,36 @@
6974
display: none;
7075
}
7176

77+
// Mantine Breadcrumbs container
78+
:global(.mantine-Breadcrumbs-root) {
79+
flex-wrap: nowrap;
80+
min-width: 0;
81+
}
82+
83+
:global(.mantine-Breadcrumbs-breadcrumb) {
84+
@include mixins.ellipsis();
85+
max-width: 200px;
86+
87+
@include mixins.respond-below(md) {
88+
max-width: 120px;
89+
}
90+
91+
@include mixins.respond-below(sm) {
92+
max-width: 80px;
93+
}
94+
95+
// Don't truncate the last breadcrumb (often an action like "Create Event")
96+
&:last-child {
97+
max-width: none;
98+
flex-shrink: 0;
99+
}
100+
}
101+
72102
a {
73103
color: var(--hi-text-light);
74104
transition: color 0.2s ease;
75105
position: relative;
106+
@include mixins.ellipsis();
76107

77108
&:hover {
78109
color: var(--hi-text);

frontend/src/components/layouts/AppLayout/Topbar/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import {NavLink} from "react-router";
33
import {Breadcrumbs, Burger} from '@mantine/core';
4-
import {IconHome} from "@tabler/icons-react";
54
import classes from './Topbar.module.scss';
65
import {BreadcrumbItem} from "../types";
76
import {GlobalMenu} from "../../../common/GlobalMenu";
@@ -55,8 +54,7 @@ export const Topbar: React.FC<TopbarProps> = ({
5554

5655
<div className={classes.breadcrumbsRow}>
5756
<div className={classes.breadcrumbs}>
58-
<IconHome size={16} style={{marginRight: '8px', opacity: 0.6, minWidth: '16px'}}/>
59-
<Breadcrumbs separator={<span style={{margin: '0 0px', color: '#aaa'}}>/</span>}>
57+
<Breadcrumbs separator={<span style={{margin: '0 4px', color: '#aaa'}}>/</span>}>
6058
{breadcrumbItems.map((item, index) => (
6159
<NavLink key={index} to={item.link ?? '#'}>
6260
{item.content}

frontend/src/components/layouts/Event/index.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,17 @@ const EventLayout = () => {
131131
const screenWidth = useWindowWidth();
132132
const breadcrumbItemsWidth = screenWidth > 1100 ? 60 : 23;
133133

134-
const breadcrumbItems: BreadcrumbItem[] = [
134+
const breadcrumbItems: BreadcrumbItem[] = isEventFetched ? [
135135
{
136-
link: '/manage/events',
137-
content: t`Home`
136+
link: `/manage/organizer/${event?.organizer?.id}`,
137+
content: <Truncate length={breadcrumbItemsWidth} text={event?.organizer?.name} showTooltip={false}/>
138138
},
139-
...(isEventFetched ? [
140-
{
141-
link: `/manage/organizer/${event?.organizer?.id}`,
142-
content: <Truncate length={breadcrumbItemsWidth} text={event?.organizer?.name} showTooltip={false}/>
143-
},
144-
{
145-
link: `/manage/event/${event?.id}`,
146-
content: <Truncate length={breadcrumbItemsWidth} text={event?.title} showTooltip={false}/>
147-
}
148-
] : [
149-
{link: '#', content: '...'}
150-
])
139+
{
140+
link: `/manage/event/${event?.id}`,
141+
content: <Truncate length={breadcrumbItemsWidth} text={event?.title} showTooltip={false}/>
142+
}
143+
] : [
144+
{link: '#', content: '...'}
151145
];
152146

153147
const handleStatusToggle = () => {

frontend/src/components/layouts/OrganizerLayout/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,13 @@ const OrganizerLayout = () => {
136136
};
137137

138138
const breadcrumbItems: BreadcrumbItem[] = [
139-
{
140-
link: '/manage/events',
141-
content: t`Events`
142-
},
143139
{
144140
link: `/manage/organizer/${organizerId}`,
145141
content: organizer?.name,
146142
},
147143
{
148144
content: (
149-
<span
145+
<span
150146
className={classes.createEventBreadcrumb}
151147
onClick={() => setShowCreateEventModal(true)}
152148
>

0 commit comments

Comments
 (0)