From 0c88b58b3803728b9a6cd69b69588d93203909b4 Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 13 Oct 2020 17:16:43 +0200 Subject: [PATCH] Tror det funker --- src/BackOffice/AddPost.jsx | 1 - src/BackOffice/CreateNewEvent.jsx | 14 +++++++++++++- src/BackOffice/EventWithPosts.js | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/BackOffice/AddPost.jsx b/src/BackOffice/AddPost.jsx index 70724f4..712269e 100644 --- a/src/BackOffice/AddPost.jsx +++ b/src/BackOffice/AddPost.jsx @@ -49,7 +49,6 @@ const AddPost = ({ address, googleMaps, timeOnEveryPost, - updateCallback, ], ); diff --git a/src/BackOffice/CreateNewEvent.jsx b/src/BackOffice/CreateNewEvent.jsx index 7e8c3b9..a1affe8 100644 --- a/src/BackOffice/CreateNewEvent.jsx +++ b/src/BackOffice/CreateNewEvent.jsx @@ -11,6 +11,7 @@ import LocationFields from "./form-fields/LocationFields"; import LinkFields from "./form-fields/LinkFields"; import GroupPicker from "./form-fields/GroupPicker"; import EventWithPosts from "./EventWithPosts"; +import uuid from "react-uuid"; const CreateNewEvent = ({ editing, @@ -49,7 +50,18 @@ const CreateNewEvent = ({ const [linkTextEN, setLinkTextEN] = useState(linkText_EN); /** Her er syntaxen til subeventene */ - const [posts, setPosts] = useState([]); + const [posts, setPosts] = useState( + [ + { + id: uuid(), + title: "", + startGroup: "", + address: "", + googleMaps: "", + timeOnEveryPost: "" + } + ] + ); /** *************************************************************************** */ diff --git a/src/BackOffice/EventWithPosts.js b/src/BackOffice/EventWithPosts.js index 3676dbd..c416187 100644 --- a/src/BackOffice/EventWithPosts.js +++ b/src/BackOffice/EventWithPosts.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useCallback, useState } from "react"; import AddPost from "./AddPost"; import AddEventButton from "./AddEventButton"; import uuid from "react-uuid";