@@ -8,7 +8,7 @@ import illustrationPerson4Peach from '@/public/illustration_person4_peach.svg';
8
8
import { breadcrumbButtonStyle } from '@/styles/common' ;
9
9
import theme from '@/styles/theme' ;
10
10
import CircleIcon from '@mui/icons-material/Circle' ;
11
- import { Button , Typography , useMediaQuery } from '@mui/material' ;
11
+ import { Box , Button , Typography , useMediaQuery } from '@mui/material' ;
12
12
import { ISbRichtext , ISbStoryData } from '@storyblok/react/rsc' ;
13
13
import { useLocale , useTranslations } from 'next-intl' ;
14
14
import { useEffect , useState } from 'react' ;
@@ -36,6 +36,7 @@ export const SessionHeader = (props: SessionHeaderProps) => {
36
36
37
37
const t = useTranslations ( 'Courses' ) ;
38
38
const locale = useLocale ( ) ;
39
+
39
40
const isSmallScreen = useMediaQuery ( theme . breakpoints . down ( 'sm' ) ) ;
40
41
41
42
const [ weekString , setWeekString ] = useState < string > ( '' ) ;
@@ -69,21 +70,47 @@ export const SessionHeader = (props: SessionHeaderProps) => {
69
70
imageAlt = { headerProps . imageAlt }
70
71
progressStatus = { sessionProgress }
71
72
>
72
- < Button variant = "contained" href = "/courses" sx = { breadcrumbButtonStyle } size = "small" >
73
- { t ( 'courses' ) }
74
- </ Button >
73
+ < Box
74
+ component = "nav"
75
+ sx = { {
76
+ display : 'flex' ,
77
+ alignItems : 'center' ,
78
+ flexWrap : isSmallScreen ? 'wrap' : 'nowrap' ,
79
+ overflowX : isSmallScreen ? 'visible' : 'auto' ,
80
+ gap : 1 ,
81
+ } }
82
+ >
83
+ < Button
84
+ size = "small"
85
+ variant = "contained"
86
+ href = "/courses"
87
+ sx = { {
88
+ ...breadcrumbButtonStyle ,
89
+ whiteSpace : 'nowrap' ,
90
+ } }
91
+ >
92
+ { t ( 'courses' ) }
93
+ </ Button >
75
94
76
- < CircleIcon color = "error" sx = { { ...dotStyle , marginX : 1 } } />
95
+ < CircleIcon color = "error" sx = { dotStyle } />
96
+
97
+ < Button
98
+ size = "small"
99
+ variant = "contained"
100
+ component = { i18nLink }
101
+ href = { getDefaultFullSlug ( course . full_slug , locale ) }
102
+ sx = { {
103
+ ...breadcrumbButtonStyle ,
104
+ flexShrink : 1 ,
105
+ minWidth : 0 ,
106
+ whiteSpace : isSmallScreen ? 'normal' : 'nowrap' ,
107
+ wordBreak : 'break-word' ,
108
+ } }
109
+ >
110
+ { courseNameEllipses }
111
+ </ Button >
112
+ </ Box >
77
113
78
- < Button
79
- variant = "contained"
80
- sx = { breadcrumbButtonStyle }
81
- href = { getDefaultFullSlug ( course . full_slug , locale ) }
82
- component = { i18nLink }
83
- size = "small"
84
- >
85
- { courseNameEllipses }
86
- </ Button >
87
114
< Typography sx = { sessionSubtitleStyle } variant = "body2" >
88
115
{ weekString } -{ ' ' }
89
116
{ storyPosition !== undefined ? `${ t ( 'session' ) } ${ storyPosition / 10 - 1 } ` : subtitle }
0 commit comments