feat: add connections at tags

This commit is contained in:
RadoslavDimchev 2023-08-22 12:58:10 +03:00
parent 1bccf7642f
commit 0789ad2d72
1 changed files with 36 additions and 3 deletions

View File

@ -2,19 +2,52 @@ import { Tag } from '@status-im/components'
import { XStack } from 'tamagui' import { XStack } from 'tamagui'
import './TagContainer.css' import './TagContainer.css'
import { ConnectionIcon, AddSmallIcon, SwapIcon } from '@status-im/icons' import { ConnectionIcon, AddSmallIcon, SwapIcon } from '@status-im/icons'
import { useNavigate } from 'react-router'
type TagContainerProps = { type TagContainerProps = {
selectedTag: 'pair' | 'create' | 'connect' selectedTag: 'pair' | 'create' | 'connect'
} }
const TagContainer = ({ selectedTag }: TagContainerProps) => { const TagContainer = ({ selectedTag }: TagContainerProps) => {
const navigate = useNavigate()
const onPressConnect = () => {
navigate('/connect-device')
}
const onPressPair = () => {
navigate('/pair-device')
}
const onPressCreate = () => {
navigate('/create-local-node')
}
return ( return (
<XStack space={'$2'} alignItems="center" className="tag-container"> <XStack space={'$2'} alignItems="center" className="tag-container">
{selectedTag === 'connect' ? ( {selectedTag === 'connect' ? (
<Tag selected={selectedTag === 'connect'} icon={ConnectionIcon} label="Connect" size={32} /> <Tag
selected={selectedTag === 'connect'}
icon={ConnectionIcon}
label="Connect"
size={32}
onPress={onPressConnect}
/>
) : null} ) : null}
<Tag selected={selectedTag === 'pair'} icon={SwapIcon} label="Pair" size={32} /> <Tag
<Tag selected={selectedTag === 'create'} icon={AddSmallIcon} label="Create" size={32} /> selected={selectedTag === 'pair'}
icon={SwapIcon}
label="Pair"
size={32}
onPress={onPressPair}
/>
<Tag
selected={selectedTag === 'create'}
icon={AddSmallIcon}
label="Create"
size={32}
onPress={onPressCreate}
/>
</XStack> </XStack>
) )
} }