export to json

This commit is contained in:
Djeeberjr 2021-11-15 23:23:02 +01:00
parent e450020cda
commit a743eca07f
2 changed files with 15 additions and 5 deletions

View File

@ -9,10 +9,16 @@ function App() {
return ( return (
<div className="text-white"> <div className="text-white">
<MenuBar onExport={()=>{ <MenuBar
onExport={()=>{
const exportString = retakesConfig.toCvar() const exportString = retakesConfig.toCvar()
console.log(exportString) console.log(exportString)
}} /> }}
onExportJson={()=>{
const jsonString = JSON.stringify(retakesConfig)
console.log(jsonString)
}}
/>
<AllDecks retakesConfig={retakesConfig} onChange={(newConfig)=>setRetakesConfig(newConfig)} /> <AllDecks retakesConfig={retakesConfig} onChange={(newConfig)=>setRetakesConfig(newConfig)} />
</div> </div>
); );

View File

@ -2,14 +2,18 @@ import React from "react"
interface Props { interface Props {
onExport?: ()=>void onExport?: ()=>void
onExportJson?: ()=>void
} }
const MenuBar: React.FC<Props> = ({onExport}) => { const MenuBar: React.FC<Props> = ({onExport,onExportJson}) => {
return ( return (
<div className="bg-gray-800 h-10 m-1 p-1 flex"> <div className="bg-gray-800 h-10 m-1 p-1 flex">
<div className="bg-gray-700 button" onClick={onExport}> <div className="bg-gray-700 button" onClick={onExport}>
Export Export
</div> </div>
<div className="bg-gray-700 button" onClick={onExportJson}>
Export to JSON
</div>
<a href="https://developer.valvesoftware.com/wiki/CS:GO_Game_Mode_-_Retakes" target="_blank" rel='noreferrer'> <a href="https://developer.valvesoftware.com/wiki/CS:GO_Game_Mode_-_Retakes" target="_blank" rel='noreferrer'>
<div className="bg-gray-700 button"> <div className="bg-gray-700 button">
Help Help