Skip to content

Commit

Permalink
Fix reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
Isti01 committed Sep 10, 2024
1 parent c20f089 commit fa78f38
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/events/components/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ interface EventListProps {
const EventList = ({ eventList, groupByDay }: EventListProps) => {
const config = useConfigContext()
const eventGroups = useMemo(() => groupEventsByDay(eventList), [eventList])
if (!groupByDay) return <EventListGroup eventList={eventList} useLink={config?.components.event?.enableDetailedView} />
if (!groupByDay) return <EventListGroup eventList={eventList} useLink={config?.components?.event?.enableDetailedView} />

return (
<VStack>
{eventGroups.map((group) => (
<Box key={group.date.getTime()} w="full">
<Heading mb={2}>{group.date.toLocaleDateString('hu-HU', { month: '2-digit', day: '2-digit' })}</Heading>
<EventListGroup eventList={group.events} useLink={config?.components.event?.enableDetailedView} />
<EventListGroup eventList={group.events} useLink={config?.components?.event?.enableDetailedView} />
</Box>
))}
</VStack>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/events/components/EventListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EventListItem = ({ event, useLink }: EventListItemProps) => {

return (
<Box w="100%">
{config.components.event?.enableDetailedView ? (
{config.components?.event?.enableDetailedView ? (
<Link to={`${AbsolutePaths.EVENTS}/${event.url}`}> {innerComponent} </Link>
) : (
innerComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface EventBoxProps {
}

export function EventBox({ event, boxRef }: EventBoxProps) {
const component = useConfigContext().components.event
const component = useConfigContext()?.components?.event
const eventBg = useColorModeValue('brand.500', 'brand.300')
const eventTextColor = useColorModeValue('white', 'black')
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/events/eventCalendar.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { DayCalendar } from './components/event-calendar/DayCalendar'
import { WeekCalendar } from './components/event-calendar/WeekCalendar'

function EventCalendarPage() {
const component = useConfigContext()?.components.event
const component = useConfigContext()?.components?.event

const { isLoading, isError, data } = useEventListQuery()

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/events/eventList.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { EventListView } from '../../util/views/event.view'

const EventListPage = () => {
const { isLoading, isError, data } = useEventListQuery()
const component = useConfigContext()?.components.event
const component = useConfigContext()?.components?.event
const { isOpen, onToggle } = useDisclosure()
const tabsSize = useBreakpointValue({ base: 'sm', md: 'md' })
const breakpoint = useBreakpoint()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/home/components/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Schedule = ({ events, verbose }: ScheduleProps) => {
return (
<>
{events.map((event, idx) => (
<EventDisplay verbose={verbose} key={idx} event={event} useLink={config?.components.event.enableDetailedView} />
<EventDisplay verbose={verbose} key={idx} event={event} useLink={config?.components?.event?.enableDetailedView} />
))}
</>
)
Expand Down

0 comments on commit fa78f38

Please sign in to comment.