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)}>
+
+
+
+ Copy to clipboard
+
)
}
diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx
new file mode 100644
index 0000000..c97b236
--- /dev/null
+++ b/src/components/Modal.tsx
@@ -0,0 +1,26 @@
+import React from "react"
+
+interface Props {
+ show: boolean
+ onCloseClick?: ()=>void
+}
+
+const Modal: React.FC = ({children,show,onCloseClick}) => {
+ return (
+ {
+ onCloseClick?.()
+ }}>
+
{
+ e.stopPropagation()
+ }}>
+ {children}
+
+
+ )
+}
+
+export default Modal