Skip to content

Commit 0fb854d

Browse files
fix(PDYE-1230): evento mobile (#712)
Co-authored-by: Javiera Munita <javiera.munita@eclass.cl>
1 parent d00eb8b commit 0fb854d

File tree

1 file changed

+60
-25
lines changed

1 file changed

+60
-25
lines changed

src/organisms/Calendar/EventsList/EventsList.tsx

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Box } from '@chakra-ui/react'
1+
import { Calendar } from '@/atoms/Icons/Calendar'
2+
import { Clock } from '@/atoms/Icons/Clock'
3+
import { Box, useMediaQuery } from '@chakra-ui/react'
24
import { vars } from '@theme'
35

46
import { NotificationIcon } from './NotificationIcon'
@@ -29,6 +31,7 @@ export const EventsList = ({
2931
text,
3032
type,
3133
}: IEventList): JSX.Element => {
34+
const [isMobile] = useMediaQuery('(max-width: 580px)')
3235
const border = `1px solid ${vars('colors-neutral-platinum') ?? '#E8E8E8'}`
3336

3437
const initOrEnd = [
@@ -47,28 +50,30 @@ export const EventsList = ({
4750

4851
return (
4952
<Box className="eventsList" borderTop={border} p="16px 24px" display="flex" gap="12px">
50-
<Box
51-
bg={color}
52-
minW="80px"
53-
minH="80px"
54-
maxW="80px"
55-
maxH="80px"
56-
borderRadius="4px"
57-
p="8px"
58-
display="flex"
59-
flexDirection="column"
60-
justifyContent="space-around"
61-
>
62-
<Box as="span" sx={dateTextStyle}>
63-
{day}
64-
</Box>
65-
<Box as="span" sx={dateTextStyle}>
66-
{date}
67-
</Box>
68-
<Box as="span" fontSize="14px" fontWeight="700" color={vars('colors-neutral-white')}>
69-
{time}
53+
{!isMobile && (
54+
<Box
55+
bg={color}
56+
minW="80px"
57+
minH="80px"
58+
maxW="80px"
59+
maxH="80px"
60+
borderRadius="4px"
61+
p="8px"
62+
display="flex"
63+
flexDirection="column"
64+
justifyContent="space-around"
65+
>
66+
<Box as="span" sx={dateTextStyle}>
67+
{day}
68+
</Box>
69+
<Box as="span" sx={dateTextStyle}>
70+
{date}
71+
</Box>
72+
<Box as="span" fontSize="14px" fontWeight="700" color={vars('colors-neutral-white')}>
73+
{time}
74+
</Box>
7075
</Box>
71-
</Box>
76+
)}
7277

7378
<Box display="flex" flexDirection="column" gap="8px">
7479
<Box
@@ -77,13 +82,43 @@ export const EventsList = ({
7782
justifyContent="space-between"
7883
alignItems="center"
7984
fontSize="16px"
80-
fontWeight="700"
85+
fontWeight={isMobile ? '400' : '700'}
8186
>
8287
{name} {hasNotification && <NotificationIcon />}
8388
</Box>
89+
90+
{isMobile && (
91+
<Box lineHeight="normal" sx={{ '>svg': { marginRight: '4px' } }}>
92+
<Calendar />
93+
<Box
94+
as="span"
95+
verticalAlign="middle"
96+
p="0 8px 0 0"
97+
borderRight={`1px solid ${vars('colors-neutral-platinum')}`}
98+
mr="8px"
99+
>
100+
{day} {date}
101+
</Box>
102+
<Clock />
103+
<Box as="span" verticalAlign="middle">
104+
{time}
105+
</Box>
106+
</Box>
107+
)}
108+
84109
{showsCourseName && !initOrEnd && (
85-
<Box display="flex" alignItems="center" gap="4px" lineHeight="19px">
86-
<Box as="span" color={vars('colors-neutral-gray') ?? '#808080'} fontSize="14px">
110+
<Box display="flex" gap="4px" alignItems="center">
111+
{isMobile && <Box height="10px" width="10px" bg={color} borderRadius="50%" />}
112+
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+
>
87122
<strong>{text ? `${text}:` : 'Curso:'}</strong> {courseName}
88123
</Box>
89124
</Box>

0 commit comments

Comments
 (0)