fix: change name of address and port inputs component

This commit is contained in:
RadoslavDimchev 2024-01-05 10:39:11 +02:00
parent 1a2c443c8a
commit 32c939a308
3 changed files with 12 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import { Button, Input, Text } from '@status-im/components'
import { SettingsIcon, ClearIcon } from '@status-im/icons' import { SettingsIcon, ClearIcon } from '@status-im/icons'
import { useSelector } from 'react-redux' import { useSelector } from 'react-redux'
import AddressPortInputs from './AddressAndPortInputs' import InputsRow from './InputsRow'
import { RootState } from '../../../redux/store' import { RootState } from '../../../redux/store'
const ConnectViaIP = () => { const ConnectViaIP = () => {
@ -47,7 +47,7 @@ const ConnectViaIP = () => {
</XStack> </XStack>
{isAdvanced ? ( {isAdvanced ? (
<YStack space={'$3'}> <YStack space={'$3'}>
<AddressPortInputs <InputsRow
addressType={'Validator Client'} addressType={'Validator Client'}
portType={'VC'} portType={'VC'}
address={vcAddress} address={vcAddress}
@ -56,7 +56,7 @@ const ConnectViaIP = () => {
isSwitchOn={isVcSwitchOn} isSwitchOn={isVcSwitchOn}
isChecked={isVcChecked} isChecked={isVcChecked}
/> />
<AddressPortInputs <InputsRow
addressType={'Beacon'} addressType={'Beacon'}
portType={'Beacon'} portType={'Beacon'}
address={beaconAddress} address={beaconAddress}
@ -67,7 +67,7 @@ const ConnectViaIP = () => {
/> />
</YStack> </YStack>
) : ( ) : (
<AddressPortInputs addressType={'Node'} address={nodeAddress} /> <InputsRow addressType={'Node'} address={nodeAddress} />
)} )}
<Separator borderColor={'#e3e3e3'} /> <Separator borderColor={'#e3e3e3'} />
<YStack space={'$2'}> <YStack space={'$2'}>

View File

@ -1,17 +1,17 @@
import type { Meta, StoryObj } from '@storybook/react' import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6' import { withRouter } from 'storybook-addon-react-router-v6'
import AddressAndPortInputs from './AddressAndPortInputs' import InputsRow from './InputsRow'
const meta = { const meta = {
title: 'Pair Device/AddressAndPortInputs', title: 'Pair Device/InputsRow',
component: AddressAndPortInputs, component: InputsRow,
parameters: { parameters: {
layout: 'centered', layout: 'centered',
}, },
tags: ['autodocs'], tags: ['autodocs'],
decorators: [withRouter], decorators: [withRouter],
} satisfies Meta<typeof AddressAndPortInputs> } satisfies Meta<typeof InputsRow>
export default meta export default meta
type Story = StoryObj<typeof meta> type Story = StoryObj<typeof meta>

View File

@ -4,7 +4,7 @@ import { Stack, Switch, XStack, YStack } from 'tamagui'
import { RootState } from '../../../redux/store' import { RootState } from '../../../redux/store'
type AddressAndPortInputsProps = { type InputsRowProps = {
addressType: string addressType: string
portType?: string portType?: string
isAdvanced?: boolean isAdvanced?: boolean
@ -14,7 +14,7 @@ type AddressAndPortInputsProps = {
isChecked?: boolean isChecked?: boolean
} }
const AddressAndPortInputs = ({ const InputsRow = ({
isAdvanced, isAdvanced,
addressType, addressType,
portType, portType,
@ -22,7 +22,7 @@ const AddressAndPortInputs = ({
port, port,
isSwitchOn, isSwitchOn,
isChecked, isChecked,
}: AddressAndPortInputsProps) => { }: InputsRowProps) => {
const { beaconPort, vcPort, isNodeChecked, isNodeSwitchOn } = useSelector( const { beaconPort, vcPort, isNodeChecked, isNodeSwitchOn } = useSelector(
(state: RootState) => state.pairDevice, (state: RootState) => state.pairDevice,
) )
@ -127,4 +127,4 @@ const AddressAndPortInputs = ({
) )
} }
export default AddressAndPortInputs export default InputsRow