From c036d7d5ca0bc051592fb451ca48642323f70eae Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 16 Nov 2021 00:58:56 +0100 Subject: [PATCH] export modal --- src/components/App.tsx | 25 ++++++++++++++++++++----- src/components/Modal.tsx | 26 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 src/components/Modal.tsx diff --git a/src/components/App.tsx b/src/components/App.tsx index 9e920f0..8fdd670 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -2,25 +2,40 @@ import React, { useState } from "react" import RetakesConfig from "../types/RetakesConfig" import AllDecks from "./AllDecks" import MenuBar from "./MenuBar" +import Modal from "./Modal" const App: React.FC = () => { const [retakesConfig,setRetakesConfig] = useState(new RetakesConfig()) + const [showExport,setShowExport] = useState(false) + const [exportText,setExportText] = useState("") return (
{ - const exportString = retakesConfig.toCvar() - console.log(exportString) + setExportText(retakesConfig.toCvar()) + setShowExport(true) }} onExportJson={()=>{ - const jsonString = JSON.stringify(retakesConfig) - console.log(jsonString) - }} + setExportText(JSON.stringify(retakesConfig)) + setShowExport(true) + }} /> setRetakesConfig(newConfig)} /> + + setShowExport(false)}> +
+