From 5e7be5545dfd8d413d3d9ad6f2f5034ed059ce5a Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Mon, 4 Oct 2021 00:15:53 +0200 Subject: [PATCH] implemented popup (subject to change) --- src/pages/CreateEvent/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pages/CreateEvent/index.js b/src/pages/CreateEvent/index.js index a4c784a..9769054 100644 --- a/src/pages/CreateEvent/index.js +++ b/src/pages/CreateEvent/index.js @@ -7,6 +7,7 @@ import { fromLonLat, toLonLat } from "ol/proj"; import { useHistory } from "react-router"; import { API_CLIENT, EVENT_CONTEXT } from "../../constants"; import styles from "./index.module.scss"; +import { spawnPopup } from "../../utils/spawnPopup"; export const CreateEvent = () => { const context = useContext(EVENT_CONTEXT); @@ -23,7 +24,18 @@ export const CreateEvent = () => { date: "0", description: "", }, - onSubmit: (data) => { + onSubmit: async (data) => { + if (data.type === 0) { + await spawnPopup((close) => { + return ( + <> +

Nie podałeś typu wydarzenia

+ + + ); + }); + return; + } const cords = toLonLat([center[0], center[1]]); const rqObj = { name: data.name,