From fb94ca76d562c59dbc62951ea47a186552221d8d Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 26 Sep 2023 13:01:02 +0300 Subject: [PATCH] style: format --- .../BeaconAddress.stories.tsx | 16 +-- .../ConnectExistingInstance/BeaconAddress.tsx | 134 ++++++++++------- .../ClientAddressRow.stories.tsx | 16 +-- .../ClientAddressRow.tsx | 135 +++++++++++------- .../ConnectExistingInstance.tsx | 128 ++++++++--------- src/pages/PairDevice/PairDevice.tsx | 5 +- 6 files changed, 246 insertions(+), 188 deletions(-) diff --git a/src/pages/ConnectExistingInstance/BeaconAddress.stories.tsx b/src/pages/ConnectExistingInstance/BeaconAddress.stories.tsx index 93242de0..a6dae199 100644 --- a/src/pages/ConnectExistingInstance/BeaconAddress.stories.tsx +++ b/src/pages/ConnectExistingInstance/BeaconAddress.stories.tsx @@ -4,18 +4,18 @@ import BeaconAddress from './BeaconAddress' import { withRouter } from 'storybook-addon-react-router-v6' const meta = { - title: 'Connect-Device/BeaconAddress', - component: BeaconAddress, - parameters: { - layout: 'centered', - }, - tags: ['autodocs'], - decorators: [withRouter], + title: 'Connect-Device/BeaconAddress', + component: BeaconAddress, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + decorators: [withRouter], } satisfies Meta export default meta type Story = StoryObj export const Page: Story = { - args: {}, + args: {}, } diff --git a/src/pages/ConnectExistingInstance/BeaconAddress.tsx b/src/pages/ConnectExistingInstance/BeaconAddress.tsx index 159c43e7..07b793fe 100644 --- a/src/pages/ConnectExistingInstance/BeaconAddress.tsx +++ b/src/pages/ConnectExistingInstance/BeaconAddress.tsx @@ -1,60 +1,88 @@ -import { Checkbox, Input, Text } from "@status-im/components" -import { useState } from "react" -import { Stack, Switch, XStack, YStack } from "tamagui" +import { Checkbox, Input, Text } from '@status-im/components' +import { useState } from 'react' +import { Stack, Switch, XStack, YStack } from 'tamagui' const BeaconAddress = () => { - const [isBeaconSwitchOn, setIsBeaconSwitchOn] = useState(false) - const [inputAdress, setInputAdress] = useState('') - const [vcPort, setVcPort] = useState('') - const [isClientAddressChecked, setIsClientAddressChecked] = useState(false) + const [isBeaconSwitchOn, setIsBeaconSwitchOn] = useState(false) + const [inputAdress, setInputAdress] = useState('') + const [vcPort, setVcPort] = useState('') + const [isClientAddressChecked, setIsClientAddressChecked] = useState(false) - return ( - - - - - Protocol - (HTTP/HTTPS) - + return ( + + + + + + {' '} + Protocol{' '} + + + {' '} + (HTTP/HTTPS) + + - setIsBeaconSwitchOn(prev => !prev)}> - - - - - - Beacon Address - - { setInputAdress(e) }} - /> - - - - - VC Port - - { setVcPort(e) }} - /> - - - setIsClientAddressChecked(prev => !prev)} - size={20} - /> - - - + setIsBeaconSwitchOn(prev => !prev)} + > + + - ) + + + Beacon Address + + { + setInputAdress(e) + }} + /> + + + + + VC Port + + { + setVcPort(e) + }} + /> + + + setIsClientAddressChecked(prev => !prev)} + size={20} + /> + + + + + ) } -export default BeaconAddress \ No newline at end of file +export default BeaconAddress diff --git a/src/pages/ConnectExistingInstance/ClientAddressRow.stories.tsx b/src/pages/ConnectExistingInstance/ClientAddressRow.stories.tsx index 45fd9f55..c6eff0ff 100644 --- a/src/pages/ConnectExistingInstance/ClientAddressRow.stories.tsx +++ b/src/pages/ConnectExistingInstance/ClientAddressRow.stories.tsx @@ -4,18 +4,18 @@ import ClientAddressRow from './ClientAddressRow' import { withRouter } from 'storybook-addon-react-router-v6' const meta = { - title: 'Connect-Device/ClientAddressRow', - component: ClientAddressRow, - parameters: { - layout: 'centered', - }, - tags: ['autodocs'], - decorators: [withRouter], + title: 'Connect-Device/ClientAddressRow', + component: ClientAddressRow, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + decorators: [withRouter], } satisfies Meta export default meta type Story = StoryObj export const Page: Story = { - args: {}, + args: {}, } diff --git a/src/pages/ConnectExistingInstance/ClientAddressRow.tsx b/src/pages/ConnectExistingInstance/ClientAddressRow.tsx index a13e53ae..5fec41d0 100644 --- a/src/pages/ConnectExistingInstance/ClientAddressRow.tsx +++ b/src/pages/ConnectExistingInstance/ClientAddressRow.tsx @@ -1,60 +1,87 @@ -import { Checkbox, Input, Text } from "@status-im/components" -import { useState } from "react" -import { Stack, Switch, XStack, YStack } from "tamagui" +import { Checkbox, Input, Text } from '@status-im/components' +import { useState } from 'react' +import { Stack, Switch, XStack, YStack } from 'tamagui' const ClientAddressRow = () => { - const [isBeaconSwitchOn, setIsBeaconSwitchOn] = useState(false) - const [inputAdress, setInputAdress] = useState('') - const [vcPort, setVcPort] = useState('') - const [isClientAddressChecked, setIsClientAddressChecked] = useState(false) + const [isBeaconSwitchOn, setIsBeaconSwitchOn] = useState(false) + const [inputAdress, setInputAdress] = useState('') + const [vcPort, setVcPort] = useState('') + const [isClientAddressChecked, setIsClientAddressChecked] = useState(false) - return ( - - - - - Protocol - (HTTP/HTTPS) - - setIsBeaconSwitchOn(prev => !prev)}> - - - - - - Validator Client Address - - { setInputAdress(e) }} - /> - - - - - VC Port - - { setVcPort(e) }} - /> - - - setIsClientAddressChecked(prev => !prev)} - size={20} - - /> - - - + return ( + + + + + + {' '} + Protocol{' '} + + + {' '} + (HTTP/HTTPS) + + + setIsBeaconSwitchOn(prev => !prev)} + > + + - ) + + + Validator Client Address + + { + setInputAdress(e) + }} + /> + + + + + VC Port + + { + setVcPort(e) + }} + /> + + + setIsClientAddressChecked(prev => !prev)} + size={20} + /> + + + + + ) } -export default ClientAddressRow \ No newline at end of file +export default ClientAddressRow diff --git a/src/pages/ConnectExistingInstance/ConnectExistingInstance.tsx b/src/pages/ConnectExistingInstance/ConnectExistingInstance.tsx index 30edf3f3..a1e81385 100644 --- a/src/pages/ConnectExistingInstance/ConnectExistingInstance.tsx +++ b/src/pages/ConnectExistingInstance/ConnectExistingInstance.tsx @@ -12,72 +12,72 @@ import ClientAddressRow from './ClientAddressRow' import BeaconAddress from './BeaconAddress' const ConnectExistingInstance = () => { - const [encryptedPassword, setEncryptedPassword] = useState('') + const [encryptedPassword, setEncryptedPassword] = useState('') - const changeEncryptedPasswordHandler = (value: string) => { - setEncryptedPassword(value) - } + const changeEncryptedPasswordHandler = (value: string) => { + setEncryptedPassword(value) + } - return ( - - -
- - - - Connect via IP - - - - - - - - - API Token - - setEncryptedPassword('')} - style={{ cursor: 'pointer' }} - /> - } - value={encryptedPassword} - onChangeText={changeEncryptedPasswordHandler} - /> - - - - Advanced Settings - - - - - - - - - - - ) + return ( + + +
+ + + + Connect via IP + + + + + + + + + API Token + + setEncryptedPassword('')} + style={{ cursor: 'pointer' }} + /> + } + value={encryptedPassword} + onChangeText={changeEncryptedPasswordHandler} + /> + + + + Advanced Settings + + + + + + + + + + + ) } export default ConnectExistingInstance diff --git a/src/pages/PairDevice/PairDevice.tsx b/src/pages/PairDevice/PairDevice.tsx index a27e1ebb..d77ce79a 100644 --- a/src/pages/PairDevice/PairDevice.tsx +++ b/src/pages/PairDevice/PairDevice.tsx @@ -44,7 +44,10 @@ const PairDevice = () => { Advanced Settings - + {isPaired && }