Skip to content

Commit

Permalink
fix: 🚑 Fixed events .map key in calendar
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel Doneda <[email protected]>
  • Loading branch information
Genio2003 and Melagranata committed Jan 26, 2024
1 parent 338902f commit 5745cda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ export function Calendar() {
*/
function renderPreviewEvents(events: ExtendedEventDto[]) {
// Render a preview card for each event in each calendar
return events.map((event) => (
return events.map((event, index) => (
<Card
key={event.id}
key={index}
className={styles.event}
style={{ backgroundColor: getColorValue(event.color) }}
>
Expand Down Expand Up @@ -496,7 +496,7 @@ export function Calendar() {
{
// Foreach event in the current calendar render the detailed preview card
filteredEvents.length > 0 ?
filteredEvents.map((event) => <EventDetails as="card" key={event.id} event={event} title="subject" backgroundColor={getColorValue(calendar.color)} />)
filteredEvents.map((event, index) => <EventDetails as="card" key={index} event={event} title="subject" backgroundColor={getColorValue(calendar.color)} />)
:
<Subtitle2>Nessuna</Subtitle2>
}
Expand Down

0 comments on commit 5745cda

Please sign in to comment.