feat: add manual template editor with view/edit modes
This commit is contained in:
11
src/App.tsx
11
src/App.tsx
@@ -90,6 +90,15 @@ function App() {
|
||||
});
|
||||
}
|
||||
|
||||
function handleTemplateSaved(newContent: string) {
|
||||
setConfig(prevConfig => {
|
||||
const newConfig = new Config();
|
||||
newConfig.envs = prevConfig.envs;
|
||||
newConfig.addTemplate(newContent);
|
||||
return newConfig;
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<main className="container-fluid m-2">
|
||||
@@ -111,7 +120,7 @@ function App() {
|
||||
onRemove={handleEnvRemoved} />
|
||||
</section>
|
||||
<section id="content" className="col-8 col-xl-7 border-start ms-1">
|
||||
<Content env={currentEnv} config={config} />
|
||||
<Content env={currentEnv} config={config} onTemplateSaved={handleTemplateSaved} />
|
||||
</section>
|
||||
</div>)
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user