mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-03 23:24:20 +00:00
feat: delete state and reducer for checked addresses
This commit is contained in:
parent
efd4e26cf2
commit
00ff0138ac
@ -20,8 +20,6 @@ const ConnectViaIP = () => {
|
||||
vcAddress,
|
||||
isBeaconSwitchOn,
|
||||
isVcSwitchOn,
|
||||
isBeaconChecked,
|
||||
isVcChecked,
|
||||
} = useSelector((state: RootState) => state.pairDevice)
|
||||
|
||||
const changeApiToken = (value: string) => {
|
||||
@ -56,7 +54,6 @@ const ConnectViaIP = () => {
|
||||
port={vcPort}
|
||||
isAdvanced={isAdvanced}
|
||||
isSwitchOn={isVcSwitchOn}
|
||||
isChecked={isVcChecked}
|
||||
/>
|
||||
<InputsRow
|
||||
addressType={BEACON}
|
||||
@ -65,7 +62,6 @@ const ConnectViaIP = () => {
|
||||
port={beaconPort}
|
||||
isAdvanced={isAdvanced}
|
||||
isSwitchOn={isBeaconSwitchOn}
|
||||
isChecked={isBeaconChecked}
|
||||
/>
|
||||
</YStack>
|
||||
) : (
|
||||
|
@ -25,9 +25,8 @@ const InputsRow = ({
|
||||
address,
|
||||
port,
|
||||
isSwitchOn,
|
||||
isChecked,
|
||||
}: InputsRowProps) => {
|
||||
const { beaconPort, vcPort, isNodeChecked, isNodeSwitchOn } = useSelector(
|
||||
const { beaconPort, vcPort, isNodeSwitchOn } = useSelector(
|
||||
(state: RootState) => state.pairDevice,
|
||||
)
|
||||
const dispatch = useDispatch()
|
||||
@ -40,10 +39,6 @@ const InputsRow = ({
|
||||
dispatch({ type: 'pairDevice/setIsSwitchOn', payload: { value, switchType: addressType } })
|
||||
}
|
||||
|
||||
const onCheckboxChange = (value: boolean) => {
|
||||
dispatch({ type: 'pairDevice/setIsChecked', payload: { value, checkType: addressType } })
|
||||
}
|
||||
|
||||
const onAddressChange = (value: string) => {
|
||||
dispatch({ type: 'pairDevice/setAddress', payload: { value, addressType } })
|
||||
}
|
||||
|
@ -11,9 +11,6 @@ type PairDeviceStateType = {
|
||||
isNodeSwitchOn: boolean
|
||||
isBeaconSwitchOn: boolean
|
||||
isVcSwitchOn: boolean
|
||||
isNodeChecked: boolean
|
||||
isBeaconChecked: boolean
|
||||
isVcChecked: boolean
|
||||
}
|
||||
|
||||
const initialState: PairDeviceStateType = {
|
||||
@ -25,9 +22,6 @@ const initialState: PairDeviceStateType = {
|
||||
isNodeSwitchOn: true,
|
||||
isBeaconSwitchOn: true,
|
||||
isVcSwitchOn: true,
|
||||
isNodeChecked: true,
|
||||
isBeaconChecked: true,
|
||||
isVcChecked: true,
|
||||
}
|
||||
|
||||
const pairDeviceSlice = createSlice({
|
||||
@ -59,15 +53,6 @@ const pairDeviceSlice = createSlice({
|
||||
state.isNodeSwitchOn = action.payload.value
|
||||
}
|
||||
},
|
||||
setIsChecked: (state, action) => {
|
||||
if (action.payload.checkType === BEACON) {
|
||||
state.isBeaconChecked = action.payload.value
|
||||
} else if (action.payload.checkType === VALIDATOR_CLIENT) {
|
||||
state.isVcChecked = action.payload.value
|
||||
} else {
|
||||
state.isNodeChecked = action.payload.value
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user