From 9b061c2d6f9f87ca64bba4e0f9df60492627ce29 Mon Sep 17 00:00:00 2001 From: konenet Date: Sat, 11 Dec 2021 00:57:58 +0800 Subject: [PATCH] refactor: refactor project layout and spread to multiple components --- src/chat/Panel.jsx | 1142 +---------------- src/chat/panel/center/component/UserList.jsx | 146 +++ .../panel/center/component/UserSearch.jsx | 227 ++++ src/chat/panel/center/index.jsx | 16 + src/chat/panel/left/component/SwitchChat.jsx | 125 ++ .../{ => panel/left}/component/UserInfo.jsx | 23 +- src/chat/panel/left/index.jsx | 16 + src/chat/panel/right/component/ChatAudio.jsx | 127 ++ .../panel/right/component/ChatAudioOline.jsx | 180 +++ .../panel/right/component/ChatDetails.jsx | 156 +++ src/chat/panel/right/component/ChatEdit.jsx | 153 +++ src/chat/panel/right/component/ChatFile.jsx | 121 ++ .../panel/right/component/ChatShareScreen.jsx | 162 +++ src/chat/panel/right/component/ChatVideo.jsx | 148 +++ .../panel/right/component/ChatVideoOline.jsx | 180 +++ src/chat/panel/right/index.jsx | 199 +++ src/chat/redux/module/index.jsx | 4 +- src/chat/redux/module/panel.jsx | 76 ++ 18 files changed, 2116 insertions(+), 1085 deletions(-) create mode 100644 src/chat/panel/center/component/UserList.jsx create mode 100644 src/chat/panel/center/component/UserSearch.jsx create mode 100644 src/chat/panel/center/index.jsx create mode 100644 src/chat/panel/left/component/SwitchChat.jsx rename src/chat/{ => panel/left}/component/UserInfo.jsx (86%) create mode 100644 src/chat/panel/left/index.jsx create mode 100644 src/chat/panel/right/component/ChatAudio.jsx create mode 100644 src/chat/panel/right/component/ChatAudioOline.jsx create mode 100644 src/chat/panel/right/component/ChatDetails.jsx create mode 100644 src/chat/panel/right/component/ChatEdit.jsx create mode 100644 src/chat/panel/right/component/ChatFile.jsx create mode 100644 src/chat/panel/right/component/ChatShareScreen.jsx create mode 100644 src/chat/panel/right/component/ChatVideo.jsx create mode 100644 src/chat/panel/right/component/ChatVideoOline.jsx create mode 100644 src/chat/panel/right/index.jsx create mode 100644 src/chat/redux/module/panel.jsx diff --git a/src/chat/Panel.jsx b/src/chat/Panel.jsx index 4ce2b33..b77b838 100755 --- a/src/chat/Panel.jsx +++ b/src/chat/Panel.jsx @@ -1,78 +1,29 @@ import React from 'react'; import { - Comment, Avatar, Form, Button, List, Input, Row, Col, Badge, - Card, + Button, + Row, + Col, message, - Modal, Drawer, - Tag, - Popover, Tooltip, } from 'antd'; import { - UserOutlined, - TeamOutlined, - MoreOutlined, - SyncOutlined, - FileAddOutlined, - VideoCameraAddOutlined, - AudioOutlined, PoweroffOutlined, - PhoneOutlined, - VideoCameraOutlined, - UngroupOutlined, - DesktopOutlined, - FileOutlined + FileOutlined, } from '@ant-design/icons'; -import InfiniteScroll from 'react-infinite-scroll-component'; import moment from 'moment'; -import { axiosGet, axiosPostBody } from './util/Request'; import * as Params from './common/param/Params' import * as Constant from './common/constant/Constant' -import UserInfo from './component/UserInfo' +import Center from './panel/center/index' +import Left from './panel/left/index' +import Right from './panel/right/index' import protobuf from './proto/proto' -import Recorder from 'js-audio-recorder'; import { connect } from 'react-redux' -import { actions } from './redux/module/userInfo' +import { actions } from './redux/module/panel' var socket = null; var peer = null; - -const { TextArea } = Input; - -const CommentList = ({ comments }) => ( - } - // endMessage={It is all, nothing more 🤐} - scrollableTarget="scrollableDiv" - > - 1 ? 'replies' : 'reply'}`} - itemLayout="horizontal" - renderItem={props => } - /> - -); - -const Editor = ({ onChange, onSubmit, submitting, value, toUser }) => ( - <> - -