Commit 5bf614fc authored by tom's avatar tom

fix user op call data switch

parent eb585d45
......@@ -25,6 +25,7 @@ const UserOpDecodedCallData = ({ data }: Props) => {
const toggler = data.call_data && data.execute_call_data ? (
<UserOpCallDataSwitch
id="call-data-switch"
onChange={ handleSwitchChange }
initialValue={ false }
ml={{ base: 3, lg: 'auto' }}
......
......@@ -5,13 +5,14 @@ import { Switch } from 'toolkit/chakra/switch';
import { Hint } from 'toolkit/components/Hint/Hint';
interface Props {
id: string;
onChange: (isChecked: boolean) => void;
initialValue?: boolean;
isDisabled?: boolean;
className?: string;
}
const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange }: Props) => {
const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange, id }: Props) => {
const [ isChecked, setIsChecked ] = React.useState(initialValue ?? false);
const handleChange = React.useCallback(() => {
......@@ -26,7 +27,7 @@ const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange }:
<Flex ml="auto" alignItems="center" gap={ 2 }>
<Switch
className={ className }
id="call-data-switch"
id={ id }
checked={ isChecked }
disabled={ isDisabled }
onCheckedChange={ handleChange }
......
......@@ -25,6 +25,7 @@ const UserOpDecodedCallData = ({ data }: Props) => {
const toggler = data.decoded_call_data && data.decoded_execute_call_data ? (
<UserOpCallDataSwitch
id="decoded-call-data-switch"
onChange={ handleSwitchChange }
initialValue={ false }
ml={{ base: 0, lg: 'auto' }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment