Fix rendering of events in Availability & refactor
- Possible dates were not ordered by dates, which in turn crashed the rendering of Availability component - Token was not added to headers after login - Refactor Schedule by removing useless UseEffect - Simplify rendering of events in Selected Dates (for now)
This commit is contained in:
@@ -28,10 +28,7 @@ export default function IntervalSelector({
|
||||
.toFormat('yyyy-MM-dd');
|
||||
|
||||
// Create an event dates list used to create the days columns
|
||||
const daysList = [];
|
||||
selectedDates.forEach((event) => {
|
||||
daysList.push(event.start);
|
||||
});
|
||||
const daysList = selectedDates.map((event) => event.start);
|
||||
|
||||
const handleDayDidMount = (info) => {
|
||||
let currentDate = DateTime.fromJSDate(info.date).toFormat('yyyy-MM-dd');
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import React from 'react';
|
||||
import { Divider, Icon, IconButton } from 'rsuite';
|
||||
|
||||
export default function SelectedDates({ datesList, handleDelete }) {
|
||||
export default function SelectedDates({ possibleDates, handleDelete }) {
|
||||
return (
|
||||
<ul>
|
||||
{datesList.map((date) => (
|
||||
<li key={date}>
|
||||
{date.setLocale('en-gb').toLocaleString()}
|
||||
{` (${date.weekdayShort})`}
|
||||
{possibleDates.map((date) => (
|
||||
<li key={date.start}>
|
||||
{date.start}
|
||||
<Divider vertical />
|
||||
<IconButton
|
||||
icon={<Icon icon='close' />}
|
||||
|
||||
Reference in New Issue
Block a user