mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-01-20 16:30:34 +00:00
feat: add navigate to manual create
This commit is contained in:
parent
0789ad2d72
commit
43cd20af57
@ -7,6 +7,7 @@ import Icon from '../../components/General/Icon'
|
||||
import ConnectionIcon from '/icons/connection.svg'
|
||||
import { convertSecondsToTimerFormat } from '../../utilities'
|
||||
import { RefreshIcon } from '@status-im/icons'
|
||||
import { useNavigate } from 'react-router'
|
||||
|
||||
type SyncStatusProps = {
|
||||
isPairing: boolean
|
||||
@ -20,11 +21,13 @@ const SyncStatus = ({
|
||||
changeSetIsAwaitingPairing,
|
||||
}: SyncStatusProps) => {
|
||||
const [elapsedTime, setElapsedTime] = useState(0)
|
||||
const navigate = useNavigate()
|
||||
|
||||
const resetTimer = () => {
|
||||
setElapsedTime(0)
|
||||
changeSetIsAwaitingPairing(false)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
let timer: ReturnType<typeof setTimeout>
|
||||
|
||||
@ -42,7 +45,11 @@ const SyncStatus = ({
|
||||
return () => clearInterval(timer)
|
||||
}, [isPairing, elapsedTime])
|
||||
|
||||
const timer = convertSecondsToTimerFormat(elapsedTime) // Assuming you've imported the convertSecondsToTimerFormat function
|
||||
const timer = convertSecondsToTimerFormat(elapsedTime)
|
||||
|
||||
const connectViaIpHandler = () => {
|
||||
navigate('/connect-device');
|
||||
};
|
||||
|
||||
return (
|
||||
<YStack space={'$2'}>
|
||||
@ -84,7 +91,7 @@ const SyncStatus = ({
|
||||
)}
|
||||
{isAwaitingPairing && (
|
||||
<XStack>
|
||||
<Button icon={<Icon src={ConnectionIcon} />} size={40}>
|
||||
<Button icon={<Icon src={ConnectionIcon} />} size={40} onPress={connectViaIpHandler} >
|
||||
Connect via IP
|
||||
</Button>
|
||||
</XStack>
|
||||
|
Loading…
x
Reference in New Issue
Block a user