From b65c19fbf9923cb43b7e50227cf9d8cb3695f31c Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 15 Dec 2023 12:24:13 +0200 Subject: [PATCH] Update ConnectDevicePage.tsx --- .../ConnectDevicePage/ConnectDevicePage.tsx | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/src/pages/ConnectDevicePage/ConnectDevicePage.tsx b/src/pages/ConnectDevicePage/ConnectDevicePage.tsx index b90737ef..1343aabe 100644 --- a/src/pages/ConnectDevicePage/ConnectDevicePage.tsx +++ b/src/pages/ConnectDevicePage/ConnectDevicePage.tsx @@ -1,17 +1,42 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' import BreadcrumbBar from '../../components/General/BreadcrumbBar/BreadcrumbBar' import { Button as StatusButton, Text, Avatar, Checkbox } from '@status-im/components' -import { Label, Separator, XStack, YStack } from 'tamagui' +import { Label, Separator, Stack, XStack, YStack } from 'tamagui' import PageWrapperShadow from '../../components/PageWrappers/PageWrapperShadow' import Titles from '../../components/General/Titles' import LabelInputField from '../../components/General/LabelInputField' import Header from '../../components/General/Header' import { NodeIcon } from '@status-im/icons' - + const ConnectDevicePage = () => { const [autoConnectChecked, setAutoConnectChecked] = useState(false) const [portChecked, setPortChecked] = useState(false) + const [windowWidth, setWindowWidth] = useState(window.innerWidth) + useEffect(() => { + const handleResize = () => { + setWindowWidth(window.innerWidth) + } + window.addEventListener('resize', handleResize) + + return () => window.removeEventListener('resize', handleResize) + }, []) + + const breakpoint = 768 + + const responsiveXStackStyle = { + width: '100%', + alignItems: 'center', + justifyContent: 'space-between', + flexDirection: windowWidth <= breakpoint ? 'column' : 'row', + flexWrap: windowWidth <= breakpoint ? 'wrap' : 'nowrap', + } + + const responsiveInputStyle = { + width: windowWidth <= breakpoint ? '100%' : '40%', + marginBottom: windowWidth <= breakpoint ? '1rem' : '0', + } + return ( } @@ -27,25 +52,17 @@ const ConnectDevicePage = () => { subtitle="Configure your device to connect to the Nimbus Node Manager" /> - - + + - - + + - - + + - + +