Skip to content

Commit a7e7913

Browse files
JaviMunitaDaniel Montoya
andauthored
feat(PDYE-1116): avance dropdown uikit y prueba con mock data (#662)
Co-authored-by: Daniel Montoya <daniel.montoya@eclass.cl>
1 parent c0fdaf7 commit a7e7913

File tree

7 files changed

+89
-162
lines changed

7 files changed

+89
-162
lines changed

package-lock.json

Lines changed: 44 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@types/eclass__api": "git+ssh://git@gitlab.com/eclass/types-eclass-api.git#v3.108.0",
6666
"@types/eclass__sequelize-models": "git+ssh://git@gitlab.com/eclass/types-sequelize-models.git#v5.40.0",
6767
"@types/jest": "27.5.2",
68+
"@types/node": "^16.11.17",
6869
"@types/react": "17.0.64",
6970
"@types/react-dom": "17.0.20",
7071
"@typescript-eslint/eslint-plugin": "5.17.0",
@@ -108,7 +109,7 @@
108109
"sort-by": "1.2.0",
109110
"ts-jest": "27.1.5",
110111
"ts-patch": "2.0.1",
111-
"typescript": "4.6.3",
112+
"typescript": "4.9.5",
112113
"typescript-transform-paths": "3.3.1",
113114
"vite": "2.9.16",
114115
"vite-tsconfig-paths": "3.4.1"

src/organisms/Calendar/Dropdown/CalendarDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ICalendarDropdown } from './types'
33

44
export const CalendarDropdown = ({
55
redirectToCalendar,
6-
t,
6+
text,
77
courseColors,
88
now,
99
events,
@@ -19,7 +19,7 @@ export const CalendarDropdown = ({
1919
now={isoDate}
2020
courseColors={courseColors}
2121
redirectToCalendar={redirectToCalendar}
22-
t={t}
22+
text={text}
2323
/>
2424
)
2525
}

src/organisms/Calendar/Dropdown/CalendarDropdown/CalendarDropdownContainer.tsx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ICalendarDropdown } from '../types'
1111
export const CalendarDropdownContainer = ({
1212
events,
1313
loading,
14-
t,
14+
text,
1515
now,
1616
redirectToCalendar,
1717
courseColors: colors,
@@ -22,20 +22,6 @@ export const CalendarDropdownContainer = ({
2222
const [isTooltipDisabled, setTooltipDisabled] = useState(false)
2323
const [isMenuOpen, setMenuOpen] = useState(false)
2424

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-
3925
// Resuelve tooltip que se mantiene visible al cerrar el menu
4026
useEffect(() => {
4127
if (isMenuOpen) {
@@ -59,18 +45,23 @@ export const CalendarDropdownContainer = ({
5945
position="relative"
6046
sx={{
6147
'>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',
6352
},
53+
6454
'.chakra-menu__menu-list': {
55+
position: 'absolute',
56+
width: isMobile ? '100vw' : '500px',
57+
maxHeight: isMobile ? 'calc(100vh - 62px)' : 'auto',
58+
overflowY: isMobile ? 'auto' : 'hidden',
6559
borderRadius: isMobile ? '0' : '10px',
6660
boxShadow: isMobile ? 'none' : 'rgba(47, 47, 47, 0.2) -1px 6px 40px 0px',
67-
width: isMobile ? '100vw' : '500px',
68-
height: isMobile || empty ? 'auto' : '560px',
6961
animation: 'none !important',
7062
transition: 'none !important',
7163
transform: 'none !important',
7264
opacity: '1 !important',
73-
position: 'absolute',
7465
},
7566
'.chakra-menu__group__title': {
7667
fontSize: '18px',
@@ -87,15 +78,18 @@ export const CalendarDropdownContainer = ({
8778
<>
8879
<GoToCalendar
8980
hasNew={hasNew ?? false}
90-
text={text.tooltip}
81+
text={text?.tooltip || 'Ir a Mi Calendario'}
9182
tooltipDisabled={isTooltipDisabled}
9283
/>
9384
<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+
/>
9589
{loading ? (
96-
<Loading text={text.loading} />
90+
<Loading text={text?.loading || 'Cargando'} />
9791
) : events.length === 0 || empty ? (
98-
<Empty text={text.empty} />
92+
<Empty text={text?.empty || 'Aún no tienes eventos en tu calendario'} />
9993
) : (
10094
<Events
10195
colors={colors}

0 commit comments

Comments
 (0)