Update prime values in UI on compiler change

pull/5370/head
ioedeveloper 12 months ago committed by yann300
parent 77861e208a
commit cfd0c411bc
  1. 27
      apps/circuit-compiler/src/app/components/configurations.tsx
  2. 6
      apps/circuit-compiler/src/app/components/container.tsx
  3. 3
      apps/circuit-compiler/src/app/types/index.ts

@ -1,8 +1,8 @@
import { CustomTooltip } from "@remix-ui/helper"
import { CustomTooltip, RenderIf } from "@remix-ui/helper"
import { FormattedMessage } from "react-intl"
import { ConfigurationsProps, PrimeValue } from "../types"
export function Configurations ({primeValue, setPrimeValue}: ConfigurationsProps) {
export function Configurations ({primeValue, setPrimeValue, versionValue}: ConfigurationsProps) {
return (
<div className="pb-2 border-bottom flex-column">
<div className="flex-column d-flex">
@ -25,12 +25,23 @@ export function Configurations ({primeValue, setPrimeValue}: ConfigurationsProps
pointerEvents: 'auto'
}}
>
<option value="bn128">bn128</option>
<option value="bls12381">bls12381</option>
<option value="goldilocks">goldilocks</option>
<option value="grumpkin">grumpkin</option>
<option value="pallas">pallas</option>
<option value="vesta">vesta</option>
<RenderIf condition={versionValue === '2.1.5'}>
<>
<option value="bn128">bn128</option>
<option value="bls12381">bls12381</option>
<option value="goldilocks">goldilocks</option>
</>
</RenderIf>
<RenderIf condition={versionValue === '2.1.6'}>
<>
<option value="bn128">bn128</option>
<option value="bls12381">bls12381</option>
<option value="goldilocks">goldilocks</option>
<option value="grumpkin">grumpkin</option>
<option value="pallas">pallas</option>
<option value="vesta">vesta</option>
</>
</RenderIf>
</select>
</div>
</CustomTooltip>

@ -29,6 +29,7 @@ export function Container () {
}
const handleVersionSelect = (version: string) => {
circuitApp.plugin.compilerVersion = version
circuitApp.dispatch({ type: 'SET_COMPILER_VERSION', payload: version })
}
@ -44,7 +45,8 @@ export function Container () {
}
}
const handlePrimeChange = (value: string) => {
const handlePrimeChange = (value: PrimeValue) => {
circuitApp.plugin.compilerPrime = value
circuitApp.dispatch({ type: 'SET_PRIME_VALUE', payload: value as PrimeValue })
}
@ -75,7 +77,7 @@ export function Container () {
<VersionList setVersion={handleVersionSelect} versionList={circuitApp.appState.versionList} currentVersion={circuitApp.appState.version} />
<CompileOptions setCircuitAutoCompile={handleCircuitAutoCompile} setCircuitHideWarnings={handleCircuitHideWarnings} autoCompile={circuitApp.appState.autoCompile} hideWarnings={circuitApp.appState.hideWarnings} />
<ConfigToggler>
<Configurations setPrimeValue={handlePrimeChange} primeValue={circuitApp.appState.primeValue} />
<Configurations setPrimeValue={handlePrimeChange} primeValue={circuitApp.appState.primeValue} versionValue={circuitApp.appState.version} />
</ConfigToggler>
<CircuitActions />
<RenderIf condition={circuitApp.appState.signalInputs.length > 0}>

@ -76,7 +76,8 @@ export type FeedbackAlertProps = {
export type ConfigurationsProps = {
setPrimeValue: (prime: PrimeValue) => void,
primeValue: PrimeValue
primeValue: PrimeValue,
versionValue: string
}
export type CompileOptionsProps = {

Loading…
Cancel
Save