@@ -11,7 +11,7 @@ import { ICalendarDropdown } from '../types'
11
11
export const CalendarDropdownContainer = ( {
12
12
events,
13
13
loading,
14
- t ,
14
+ text ,
15
15
now,
16
16
redirectToCalendar,
17
17
courseColors : colors ,
@@ -22,20 +22,6 @@ export const CalendarDropdownContainer = ({
22
22
const [ isTooltipDisabled , setTooltipDisabled ] = useState ( false )
23
23
const [ isMenuOpen , setMenuOpen ] = useState ( false )
24
24
25
- const text = {
26
- buttonCalendar : t ( 'CalendarGoto' ) ,
27
- course : t ( 'CalendarCourse' ) ,
28
- empty : t ( 'CalendarDontEvent' ) ,
29
- events : {
30
- today : t ( 'CalendarToday' ) ,
31
- tomorrow : t ( 'CalendarTomorrow' ) ,
32
- next : t ( 'CalendarNext' ) ,
33
- } ,
34
- header : t ( 'CalendarNextDates' ) ,
35
- loading : t ( 'Cargando' ) ,
36
- tooltip : t ( 'Calendar' ) ,
37
- }
38
-
39
25
// Resuelve tooltip que se mantiene visible al cerrar el menu
40
26
useEffect ( ( ) => {
41
27
if ( isMenuOpen ) {
@@ -59,18 +45,23 @@ export const CalendarDropdownContainer = ({
59
45
position = "relative"
60
46
sx = { {
61
47
'>div' : {
62
- transform : 'translate3d(-409px, 38px, 0px) !important' ,
48
+ position : isMobile ? 'fixed !important' : 'absolute' ,
49
+ left : isMobile ? '0 !important' : 'auto' ,
50
+ top : isMobile ? '62px !important' : 'auto' ,
51
+ transform : isMobile ? 'none !important' : 'translate3d(-409px, 38px, 0px) !important' ,
63
52
} ,
53
+
64
54
'.chakra-menu__menu-list' : {
55
+ position : 'absolute' ,
56
+ width : isMobile ? '100vw' : '500px' ,
57
+ maxHeight : isMobile ? 'calc(100vh - 62px)' : 'auto' ,
58
+ overflowY : isMobile ? 'auto' : 'hidden' ,
65
59
borderRadius : isMobile ? '0' : '10px' ,
66
60
boxShadow : isMobile ? 'none' : 'rgba(47, 47, 47, 0.2) -1px 6px 40px 0px' ,
67
- width : isMobile ? '100vw' : '500px' ,
68
- height : isMobile || empty ? 'auto' : '560px' ,
69
61
animation : 'none !important' ,
70
62
transition : 'none !important' ,
71
63
transform : 'none !important' ,
72
64
opacity : '1 !important' ,
73
- position : 'absolute' ,
74
65
} ,
75
66
'.chakra-menu__group__title' : {
76
67
fontSize : '18px' ,
@@ -87,15 +78,18 @@ export const CalendarDropdownContainer = ({
87
78
< >
88
79
< GoToCalendar
89
80
hasNew = { hasNew ?? false }
90
- text = { text . tooltip }
81
+ text = { text ? .tooltip || 'Ir a Mi Calendario' }
91
82
tooltipDisabled = { isTooltipDisabled }
92
83
/>
93
84
< MenuList >
94
- < Header text = { text . header } isMobile = { isMobile } />
85
+ < Header
86
+ text = { text ?. header || 'Próximas fechas importantes de tus cursos' }
87
+ isMobile = { isMobile }
88
+ />
95
89
{ loading ? (
96
- < Loading text = { text . loading } />
90
+ < Loading text = { text ? .loading || 'Cargando' } />
97
91
) : events . length === 0 || empty ? (
98
- < Empty text = { text . empty } />
92
+ < Empty text = { text ? .empty || 'Aún no tienes eventos en tu calendario' } />
99
93
) : (
100
94
< Events
101
95
colors = { colors }
0 commit comments