From fe0be684639a038f8475b5b84f5042295a7dcc18 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Mon, 29 Jul 2024 15:21:44 +0100 Subject: [PATCH] Show icons for setup export --- apps/circuit-compiler/src/app/app.tsx | 1 + .../src/app/components/container.tsx | 4 +- .../src/app/components/setupExports.tsx | 3 ++ .../src/app/components/toggler.tsx | 9 +++- .../src/app/components/witness.tsx | 54 +++++++++---------- .../src/app/reducers/state.ts | 7 +++ apps/circuit-compiler/src/app/types/index.ts | 6 ++- 7 files changed, 51 insertions(+), 33 deletions(-) diff --git a/apps/circuit-compiler/src/app/app.tsx b/apps/circuit-compiler/src/app/app.tsx index 8dddf3c09d..747d0b89d7 100644 --- a/apps/circuit-compiler/src/app/app.tsx +++ b/apps/circuit-compiler/src/app/app.tsx @@ -81,6 +81,7 @@ function App() { if (appState.autoCompile) await compileCircuit(plugin, appState) })() setIsContentChanged(false) + if (appState.setupExportStatus === 'done') dispatch({ type: 'SET_SETUP_EXPORT_STATUS', payload: 'update' }) } }, [appState.autoCompile, isContentChanged]) diff --git a/apps/circuit-compiler/src/app/components/container.tsx b/apps/circuit-compiler/src/app/components/container.tsx index 165c8c2ded..179cc7b941 100644 --- a/apps/circuit-compiler/src/app/components/container.tsx +++ b/apps/circuit-compiler/src/app/components/container.tsx @@ -121,7 +121,7 @@ export function Container () { 0}> - + <> @@ -131,7 +131,7 @@ export function Container () { 0}> - + <> diff --git a/apps/circuit-compiler/src/app/components/setupExports.tsx b/apps/circuit-compiler/src/app/components/setupExports.tsx index b60d9b9ec9..3fd5598720 100644 --- a/apps/circuit-compiler/src/app/components/setupExports.tsx +++ b/apps/circuit-compiler/src/app/components/setupExports.tsx @@ -21,6 +21,7 @@ export function SetupExports () { circuitApp.dispatch({ type: 'SET_COMPILER_STATUS', payload: 'exporting' }) await runSetupAndExport(circuitApp.plugin, circuitApp.appState) circuitApp.dispatch({ type: 'SET_COMPILER_STATUS', payload: 'idle' }) + circuitApp.dispatch({ type: 'SET_SETUP_EXPORT_STATUS', payload: 'done' }) } catch (e) { circuitApp.dispatch({ type: 'SET_COMPILER_STATUS', payload: 'errored' }) circuitApp.dispatch({ type: 'SET_SETUP_EXPORT_FEEDBACK', payload: e.message }) @@ -44,6 +45,7 @@ export function SetupExports () { onClick={() => circuitApp.dispatch({ type: 'SET_PROVING_SCHEME', payload: 'groth16' })} value='groth16' checked={circuitApp.appState.provingScheme === 'groth16'} + readOnly />