diff --git a/src/organisms/Calendar/EventsList/EventsList.test.tsx b/src/organisms/Calendar/EventsList/EventsList.test.tsx index 8ab69b31..2d253c15 100644 --- a/src/organisms/Calendar/EventsList/EventsList.test.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.test.tsx @@ -111,4 +111,16 @@ describe('EventsList', () => { expect(screen.queryByText('Curso:')).not.toBeInTheDocument() expect(screen.getByText('Curso demo')).toBeInTheDocument() }) + + it('adds isCourse class when course label is shown', () => { + renderComponent(undefined, { text: '' }) + + expect(screen.getByTestId('event-course')).toHaveClass('isCourse') + }) + + it('does not add isCourse class when course label is hidden for cv-events', () => { + renderComponent(undefined, { text: '', type: 'cv-events' }) + + expect(screen.getByTestId('event-course')).not.toHaveClass('isCourse') + }) }) diff --git a/src/organisms/Calendar/EventsList/EventsList.tsx b/src/organisms/Calendar/EventsList/EventsList.tsx index b95fd26e..dcbb7871 100644 --- a/src/organisms/Calendar/EventsList/EventsList.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.tsx @@ -43,6 +43,9 @@ export const EventsList = ({ const hoverBg = vars('colors-neutral-cultured2') ?? '#F8F8F8' const isCpr = type === 'cpr' const showEventLocation = !isCpr || Boolean(headquartersAddress) + const courseLabel = text || 'Curso' + const showCourseLabel = type !== 'cv-events' + const isCourse = showCourseLabel && courseLabel === 'Curso' const showEventDuration = ['online', 'in-person', 'cpr'].includes(type) && duration !== undefined && duration > 0 @@ -68,6 +71,9 @@ export const EventsList = ({ display: 'flex', gap: '4px', lineHeight: 'normal', + '&.isCourse': { + alignItems: 'self-start', + }, } const eventIconStyle = { @@ -134,9 +140,13 @@ export const EventsList = ({ {showCourse && !initOrEnd && ( - - {type === 'cv-events' ? <> : {text ? `${text}:` : 'Curso:'}}{' '} - {courseName} + + {showCourseLabel && {courseLabel}:} {courseName} )}