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 (
<div className="text-white">
<MenuBar onExport={()=>{
const exportString = retakesConfig.toCvar()
console.log(exportString)
}} />
<MenuBar
onExport={()=>{
const exportString = retakesConfig.toCvar()
console.log(exportString)
}}
onExportJson={()=>{
const jsonString = JSON.stringify(retakesConfig)
console.log(jsonString)
}}
/>
<AllDecks retakesConfig={retakesConfig} onChange={(newConfig)=>setRetakesConfig(newConfig)} />
</div>
);

View File

@ -2,14 +2,18 @@ import React from "react"
interface Props {
onExport?: ()=>void
onExportJson?: ()=>void
}
const MenuBar: React.FC<Props> = ({onExport}) => {
const MenuBar: React.FC<Props> = ({onExport,onExportJson}) => {
return (
<div className="bg-gray-800 h-10 m-1 p-1 flex">
<div className="bg-gray-700 button" onClick={onExport}>
Export
</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'>
<div className="bg-gray-700 button">
Help