diff --git a/src/components/General/RightSideBar/NodesList.tsx b/src/components/General/RightSideBar/NodesList.tsx index 46b6dd1c..677d1163 100644 --- a/src/components/General/RightSideBar/NodesList.tsx +++ b/src/components/General/RightSideBar/NodesList.tsx @@ -1,72 +1,50 @@ +import { useState } from 'react' +import { DndProvider } from 'react-dnd' +import { HTML5Backend } from 'react-dnd-html5-backend' +import { YStack } from 'tamagui' + import { Text } from '@status-im/components' -import { DragIcon, StatusIcon, ChevronRightIcon } from '@status-im/icons' -import { Stack, Tooltip, XStack, YStack } from 'tamagui' -import Icon from '../Icon' +import DraggableNode from './DragableNode' +interface NodeItem { + id: string + content: string +} + +const initialNodes: NodeItem[] = [ + { id: 'item-0', content: 'Nickname 0' }, + { id: 'item-1', content: 'Nickname 1' }, + { id: 'item-2', content: 'Nickname 2' }, +] const NodesList = () => { - return ( - - - Nodes - - - {Array.from(Array(3).keys()).map(e => { - return ( - - - - - - - Nickname {e} - - - Validators - - - + const [nodes, setNodes] = useState(initialNodes) - - - - - - - - - - - - Client Name - - - Host Name - - - - - - - ) - })} + const moveNode = (dragIndex: number, hoverIndex: number) => { + const dragNode = nodes[dragIndex] + const newNodes = [...nodes] + newNodes.splice(dragIndex, 1) + newNodes.splice(hoverIndex, 0, dragNode) + setNodes(newNodes) + } + + return ( + + + + Nodes + + {nodes.map((node, index) => ( + + ))} - + ) } + export default NodesList