From 1adf63998898dfbf8112097806b8e63db3d52d43 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 19 Oct 2023 12:04:29 +0100 Subject: [PATCH] Reorder props --- .../src/app/components/configurations.tsx | 16 ++++----------- .../src/app/components/container.tsx | 17 ++++++++++++++-- .../src/app/components/options.tsx | 20 ++++++------------- apps/circuit-compiler/src/app/types/index.ts | 12 +++++++++++ 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/apps/circuit-compiler/src/app/components/configurations.tsx b/apps/circuit-compiler/src/app/components/configurations.tsx index 52f2abb5ff..34b5075b69 100644 --- a/apps/circuit-compiler/src/app/components/configurations.tsx +++ b/apps/circuit-compiler/src/app/components/configurations.tsx @@ -1,16 +1,8 @@ import { CustomTooltip } from "@remix-ui/helper" -import { useContext } from "react" import { FormattedMessage } from "react-intl" -import { CircuitAppContext } from "../contexts" -import { PrimeValue } from "../types" - -export function Configurations () { - const { appState, dispatch } = useContext(CircuitAppContext) - - const handlePrimeChange = (value: string) => { - dispatch({ type: 'SET_PRIME_VALUE', payload: value as PrimeValue }) - } +import { ConfigurationsProps, PrimeValue } from "../types" +export function Configurations ({primeValue, setPrimeValue}: ConfigurationsProps) { return (
@@ -26,8 +18,8 @@ export function Configurations () { >
handleCircuitAutoCompile(e.target.checked)} + onChange={(e) => setCircuitAutoCompile(e.target.checked)} title="Auto compile" - checked={appState.autoCompile} + checked={autoCompile} id="autoCompileCircuit" />