Skip to content

Commit 5bf614f

Browse files
committed
fix user op call data switch
1 parent eb585d4 commit 5bf614f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

ui/userOp/UserOpCallData.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const UserOpDecodedCallData = ({ data }: Props) => {
2525

2626
const toggler = data.call_data && data.execute_call_data ? (
2727
<UserOpCallDataSwitch
28+
id="call-data-switch"
2829
onChange={ handleSwitchChange }
2930
initialValue={ false }
3031
ml={{ base: 3, lg: 'auto' }}

ui/userOp/UserOpCallDataSwitch.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { Switch } from 'toolkit/chakra/switch';
55
import { Hint } from 'toolkit/components/Hint/Hint';
66

77
interface Props {
8+
id: string;
89
onChange: (isChecked: boolean) => void;
910
initialValue?: boolean;
1011
isDisabled?: boolean;
1112
className?: string;
1213
}
1314

14-
const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange }: Props) => {
15+
const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange, id }: Props) => {
1516
const [ isChecked, setIsChecked ] = React.useState(initialValue ?? false);
1617

1718
const handleChange = React.useCallback(() => {
@@ -26,7 +27,7 @@ const UserOpCallDataSwitch = ({ className, initialValue, isDisabled, onChange }:
2627
<Flex ml="auto" alignItems="center" gap={ 2 }>
2728
<Switch
2829
className={ className }
29-
id="call-data-switch"
30+
id={ id }
3031
checked={ isChecked }
3132
disabled={ isDisabled }
3233
onCheckedChange={ handleChange }

ui/userOp/UserOpDecodedCallData.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const UserOpDecodedCallData = ({ data }: Props) => {
2525

2626
const toggler = data.decoded_call_data && data.decoded_execute_call_data ? (
2727
<UserOpCallDataSwitch
28+
id="decoded-call-data-switch"
2829
onChange={ handleSwitchChange }
2930
initialValue={ false }
3031
ml={{ base: 0, lg: 'auto' }}

0 commit comments

Comments
 (0)