From 70c6ebcc5cea2a9d13fef55cc10d1d8ea664b58e Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Wed, 26 May 2021 18:15:52 +0430 Subject: [PATCH] reza add 2d support --- .../DraggableMessage/DraggableMessage.js | 41 ++++++++++--------- .../Body/Message/RadioMessage/RadioMessage.js | 23 ++++++----- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js b/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js index f6b78c6..244c0a9 100644 --- a/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js +++ b/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js @@ -1,26 +1,8 @@ -import React, { Component } from 'react'; +import React, { Component, useEffect } from 'react'; import { SortableContainer, SortableElement } from 'react-sortable-hoc'; import arrayMove from 'array-move'; import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; -const SortableItem = SortableElement(({ row }) => ( -
- {row.map((item) => ( -
{item.text}
- ))} -
-)); - -const SortableList = SortableContainer(({ items }) => { - return ( -
- {items.map((row, index) => ( - - ))} -
- ); -}); - export default class DraggableMessage extends Component { state = { items: ['استقلال', 'پرسپولیس', 'سپاهان'], @@ -31,6 +13,7 @@ export default class DraggableMessage extends Component { items: arrayMove(items, oldIndex, newIndex), })); }; + render() { const { message, user, isSelf } = this.props; return ( @@ -53,7 +36,7 @@ export default class DraggableMessage extends Component {

) : null} - +