Skip to content

Commit 2d835cb

Browse files
fix(PDYE-1230): evento con nombre unidad (#713)
Co-authored-by: Javiera Munita <javiera.munita@eclass.cl>
1 parent f1b632b commit 2d835cb

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

src/organisms/Calendar/Dropdown/CalendarDropdown/Components/EventsGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const EventsGroup = ({ title, events, text, colors }: IEventsGroupProps):
5858
text={text}
5959
type={event.type}
6060
hasNotification={event.isNew}
61-
showsCourseName
61+
showCourse
6262
/>
6363
</Box>
6464
)

src/organisms/Calendar/EventsList/EventsList.tsx

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@ import { vars } from '@theme'
55

66
import { NotificationIcon } from './NotificationIcon'
77

8-
// Nuevo componente que recibe el texto de día y hora en tres partes
98
export interface IEventList {
109
color?: string
1110
courseName?: string
1211
day: string
1312
date: string
13+
name: string
1414
hasNotification?: boolean
15-
showsCourseName?: boolean
15+
showCourse?: boolean
16+
showUnit?: boolean
1617
time: string
17-
name: string
1818
text: string
1919
type: string
20+
unitName?: string
2021
}
2122

2223
export const EventsList = ({
2324
courseName,
2425
color,
2526
day,
2627
date,
28+
name,
2729
hasNotification,
28-
showsCourseName,
30+
showCourse,
31+
showUnit,
2932
time,
30-
name,
3133
text,
3234
type,
35+
unitName,
3336
}: IEventList): JSX.Element => {
3437
const [isMobile] = useMediaQuery('(max-width: 580px)')
3538
const border = `1px solid ${vars('colors-neutral-platinum') ?? '#E8E8E8'}`
@@ -48,6 +51,14 @@ export const EventsList = ({
4851
lineHeight: '100%',
4952
}
5053

54+
const detailTextStyle = {
55+
color: vars('colors-neutral-gray') ?? '#808080',
56+
fontSize: '14px',
57+
display: 'flex',
58+
gap: '4px',
59+
lineHeight: 'normal',
60+
}
61+
5162
return (
5263
<Box className="eventsList" borderTop={border} p="16px 24px" display="flex" gap="12px">
5364
{!isMobile && (
@@ -75,7 +86,7 @@ export const EventsList = ({
7586
</Box>
7687
)}
7788

78-
<Box display="flex" flexDirection="column" gap="8px">
89+
<Box display="flex" flexDirection="column" gap="8px" w="100%">
7990
<Box
8091
lineHeight="21px"
8192
display="flex"
@@ -106,23 +117,25 @@ export const EventsList = ({
106117
</Box>
107118
)}
108119

109-
{showsCourseName && !initOrEnd && (
110-
<Box display="flex" gap="4px" alignItems="center">
120+
{showCourse && !initOrEnd && (
121+
<Box display="flex" gap="4px" alignItems="baseline">
111122
{isMobile && <Box height="10px" width="10px" bg={color} borderRadius="50%" />}
112123

113-
<Box
114-
as="span"
115-
color={vars('colors-neutral-gray') ?? '#808080'}
116-
fontSize="14px"
117-
display="flex"
118-
alignItems="center"
119-
gap="4px"
120-
lineHeight="normal"
121-
>
124+
<Box as="span" sx={detailTextStyle}>
122125
<strong>{text ? `${text}:` : 'Curso:'}</strong> {courseName}
123126
</Box>
124127
</Box>
125128
)}
129+
130+
{showUnit && !initOrEnd && (
131+
<Box display="flex" gap="4px" alignItems="baseline">
132+
{isMobile && <Box height="10px" width="10px" bg={color} borderRadius="50%" />}
133+
134+
<Box as="span" sx={detailTextStyle}>
135+
{unitName}
136+
</Box>
137+
</Box>
138+
)}
126139
</Box>
127140
</Box>
128141
)

0 commit comments

Comments
 (0)