diff --git a/package.json b/package.json index cb06e9a..ba290dd 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "scripts": { "start": "react-app-rewired start", - "dev": "PORT=8000 BROWSER=firefox-developer-edition react-app-rewired start", + "dev": "BROWSER=firefox-developer-edition react-app-rewired start", "build": "react-app-rewired build", "test": "react-app-rewired test", "eject": "react-app-rewired eject" diff --git a/src/App.js b/src/App.js index e782697..89f789f 100644 --- a/src/App.js +++ b/src/App.js @@ -22,7 +22,7 @@ export default function App() { const [isAuthenticated, setIsAuthenticated] = useState(!!existingToken); const [currentUser, setCurrentUser] = useState(existingUser || ''); const [participant, setParticipant] = useState(); - const [possibleDates, setPossibleDates] = useState(); + const [possibleDates, setPossibleDates] = useState([]); const [currentMeeting, setCurrentMeeting] = useState({ title: '', description: '', // optional diff --git a/src/components/IntervalSelector.js b/src/components/IntervalSelector.js index f8b1a1f..c438503 100644 --- a/src/components/IntervalSelector.js +++ b/src/components/IntervalSelector.js @@ -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'); diff --git a/src/components/Schedule/SelectedDates.js b/src/components/Schedule/SelectedDates.js index e584743..2859b19 100644 --- a/src/components/Schedule/SelectedDates.js +++ b/src/components/Schedule/SelectedDates.js @@ -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 (