0 ? messageList[i - 1].userId : 0}
isSelf={1 == item.userId}
key={i}
file={this.state.image}
@@ -446,7 +447,6 @@ class Body extends Component {
}
export default connect(
(state) => {
- console.log(state);
return {
chatInfo: state.chat.info,
userId: state.user.isLogin.id,
diff --git a/src/views/ChatRoom/Body/Body.scss b/src/views/ChatRoom/Body/Body.scss
index bfaf266..1291825 100644
--- a/src/views/ChatRoom/Body/Body.scss
+++ b/src/views/ChatRoom/Body/Body.scss
@@ -11,6 +11,7 @@
font-family: 'IRANSansNumeralBold';
}
}
+
.chat-body {
background-color: rgb(210, 196, 214);
justify-content: flex-start;
@@ -18,6 +19,7 @@
height: 100%;
border-top-left-radius: 40px;
border-top-right-radius: 40px;
+
&__content {
background: url(../../../assets/images/chat.png);
background-size: cover;
diff --git a/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js b/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js
index a6fd659..abdd70f 100644
--- a/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js
+++ b/src/views/ChatRoom/Body/Message/DraggableMessage/DraggableMessage.js
@@ -24,6 +24,7 @@ export default class DraggableMessage extends Component {
style={{
marginRight: isSelf ? 0 : 70,
marginLeft: isSelf ? 70 : 0,
+ maxWidth: 400,
}}
>
diff --git a/src/views/ChatRoom/Body/Message/Message.js b/src/views/ChatRoom/Body/Message/Message.js
index c01c715..e302c71 100644
--- a/src/views/ChatRoom/Body/Message/Message.js
+++ b/src/views/ChatRoom/Body/Message/Message.js
@@ -8,10 +8,11 @@ import RadioMessage from './RadioMessage/RadioMessage.js';
export default class Message extends Component {
render() {
- const { message, user, isSelf, file, document } = this.props;
+ const { message, user, isSelf, file, document, prevUserId, isActive } = this.props;
return (
- <>
+
- {message.type === '2d' ? : null}
+ {message.type === '2d' ? (
+
+ ) : null}
{message.type === 'draggable' ? (
-
+
) : null}
{message.type === 'slider' ? (
-
+
) : null}
{message.type === 'radio' ? (
-
+
) : null}
- >
+
);
}
}
diff --git a/src/views/ChatRoom/Body/Message/Message2D/Message2D.js b/src/views/ChatRoom/Body/Message/Message2D/Message2D.js
index c0c6f9d..f34ca09 100644
--- a/src/views/ChatRoom/Body/Message/Message2D/Message2D.js
+++ b/src/views/ChatRoom/Body/Message/Message2D/Message2D.js
@@ -12,6 +12,7 @@ export default class Message2D extends Component {
style={{
marginRight: isSelf ? 0 : 70,
marginLeft: isSelf ? 70 : 0,
+ maxWidth: 400,
}}
>
diff --git a/src/views/ChatRoom/Body/Message/Message2D/Message2D.scss b/src/views/ChatRoom/Body/Message/Message2D/Message2D.scss
index d465dc8..601f745 100644
--- a/src/views/ChatRoom/Body/Message/Message2D/Message2D.scss
+++ b/src/views/ChatRoom/Body/Message/Message2D/Message2D.scss
@@ -47,7 +47,7 @@
span {
font-size: 16px;
color: black;
- font-weight: 600;
+ font-weight: 400;
}
}
}
diff --git a/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.js b/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.js
index 7f2210f..2cf060c 100644
--- a/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.js
+++ b/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.js
@@ -9,135 +9,218 @@ import DoneAllIcon from '@material-ui/icons/DoneAll';
import EditIcon from '@material-ui/icons/Edit';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import './NormalMessage.scss';
-
+import Menu from '@material-ui/core/Menu';
+import MenuItem from '@material-ui/core/MenuItem';
+import ReplyIcon from '@material-ui/icons/Reply';
+import ForwardIcon from '@material-ui/icons/Forward';
+import DeleteIcon from '@material-ui/icons/Delete';
+import FavoriteIcon from '@material-ui/icons/Favorite';
+import TextsmsIcon from '@material-ui/icons/Textsms';
export default class NormalMessage extends Component {
+ state = { messageMenu: null };
+ handleClose = () => {
+ this.setState({
+ messageMenu: null,
+ });
+ };
+ handleClick = (event) => {
+ this.setState({
+ messageMenu: event.currentTarget,
+ });
+ };
render() {
- const { message, user, document, isSelf } = this.props;
+ const { message, user, document, isSelf, prevUserId } = this.props;
+ const { messageMenu } = this.state;
+ const hasavatar = prevUserId != message.userId;
return (
-
- {user.name
- .split(' ')
- .map((e) => e.slice(0, 1))
- .join(' ')}
-
- {/*
*/}
-
+ {user.name
+ .split(' ')
+ .map((e) => e.slice(0, 1))
+ .join(' ')}
+
+ )}
+
+
+
+ {message.voice === null &&
message.video === null &&
message.image === null &&
message.music === null &&
- message.document === null
- ? `normal-message__box d-flex`
- : `normal-message__box d-flex normal-message__box--file`
- }
- style={{ backgroundColor: isSelf ? 'rgb(15, 93, 190)' : 'white' }}
- >
- {message.voice === null &&
- message.video === null &&
- message.image === null &&
- message.music === null &&
- message.document === null ? (
-
-
-
+ direction: isSelf ? 'ltr' : 'rtl',
+ paddingRight: isSelf ? 70 : 0,
+ paddingLeft: isSelf ? 0 : 70,
+ }}
+ >
+
+
+
+
+ {hasavatar &&
{user.name}
}
-
{user.name}
-
- ) : null}
+ ) : null}
- {message.text !== null &&
- message.video === null &&
- message.image === null &&
- message.music === null &&
- message.document === null ? (
-
- {message.text}
-
- ) : null}
- {message.voice !== null ?
: null}
- {message.image !== null ? (
-
-
-
-
-
- {message.text}
-
-
- ) : null}
- {message.video !== null ? (
-
-
-
-
-
+ {message.text !== null &&
+ message.video === null &&
+ message.image === null &&
+ message.music === null &&
+ message.document === null ? (
+
{message.text}
-
- ) : null}
- {message.music !== null ?
: null}
- {message.document !== null ? (
-
- : null}
+ {message.image !== null ? (
+
+
+
+
+
+ {message.text}
+
+
+ ) : null}
+ {message.video !== null ? (
+
+
+
+
+
+ {message.text}
+
+
+ ) : null}
+ {message.music !== null ? : null}
+ {message.document !== null ? (
+
-
{message.document.name}
-
- ) : null}
-
-
- {message.status == 1 && }
- {message.status == 2 && }
- {message.updatedAt ? (
- <>
- ویرایش در
+ >
+
+ {message.document.name}
+
+ ) : null}
+
+
+ {message.status == 1 && }
+ {message.status == 2 && }
+ {message.updatedAt ? (
+ <>
+ ویرایش در
- {moment(message.updatedAt).format(' hh:mm jMM/jDD')}
- >
- ) : (
- moment(message.createdAt).format('hh:mm')
- )}
-
+ {moment(message.updatedAt).format(' hh:mm jMM/jDD')}
+ >
+ ) : (
+ moment(message.createdAt).format('hh:mm')
+ )}
+
+
+
+
+
+
+ {10}
+
+
+ {/*
+
+ {10}
+
+
+ {'+5 اعتماد به نفس'}
+
*/}
diff --git a/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.scss b/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.scss
index 0f58daf..1e2192d 100644
--- a/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.scss
+++ b/src/views/ChatRoom/Body/Message/NormalMessage/NormalMessage.scss
@@ -1,8 +1,43 @@
@media screen and (max-width: 4500px) {
+ .icons {
+ //position: absolute;
+ width: 90px;
+ padding: 0 5px;
+ display: inline-block !important;
+ // top: 55px;
+ // right: -35px;
+ direction: ltr;
+ & .MuiSvgIcon-root {
+ font-size: 18px !important;
+ opacity: 0.8;
+ }
+ & span {
+ font-size: 11px !important;
+ opacity: 0.8;
+ }
+ }
+ .self {
+ direction: rtl;
+ text-align: right;
+ // left: -35px;
+ // right: none;
+ }
+ .MuiMenuItem-root {
+ min-height: 10px !important;
+ font-size: 12px !important;
+ color: grey;
+ padding: 5px 10px !important;
+ & .MuiSvgIcon-root {
+ font-size: 16px !important;
+ padding: 2px;
+ color: grey;
+ }
+ }
+
.normal-message {
// width: 100%;
position: relative;
- margin-bottom: 5px;
+ margin-bottom: 2px;
img {
width: 65px;
height: 65px;
@@ -14,9 +49,12 @@
z-index: 50;
}
&__box {
+ line-height: 1em;
+ max-width: 400px;
+ display: flex;
justify-content: flex-end;
width: 100%;
- padding: 35px 7px 5px;
+ padding: 20px 7px 5px;
background-color: white;
border-radius: 15px;
position: relative;
@@ -38,13 +76,12 @@
font-family: IRANSansNumeralLight;
}
}
- &--dete {
+ &--date {
position: absolute;
width: 100%;
- padding-top: 20px;
- padding-left: 20px;
+ padding: 20px 50px 0;
bottom: 0px;
- justify-content: space-between;
+ justify-content: flex-end;
font-size: 11px;
span {
font-family: IRANSansNumeralLight;
diff --git a/src/views/ChatRoom/Body/Message/RadioMessage/RadioMessage.js b/src/views/ChatRoom/Body/Message/RadioMessage/RadioMessage.js
index 95729f6..af71696 100644
--- a/src/views/ChatRoom/Body/Message/RadioMessage/RadioMessage.js
+++ b/src/views/ChatRoom/Body/Message/RadioMessage/RadioMessage.js
@@ -24,6 +24,7 @@ export default class RadioMessage extends Component {
style={{
marginRight: isSelf ? 0 : 70,
marginLeft: isSelf ? 70 : 0,
+ maxWidth: 400,
}}
>
diff --git a/src/views/ChatRoom/Body/Message/SliderMessage/SliderMessage.js b/src/views/ChatRoom/Body/Message/SliderMessage/SliderMessage.js
index fbb1a80..6ad4cf6 100644
--- a/src/views/ChatRoom/Body/Message/SliderMessage/SliderMessage.js
+++ b/src/views/ChatRoom/Body/Message/SliderMessage/SliderMessage.js
@@ -37,8 +37,11 @@ export default class SliderMessage extends Component {
diff --git a/src/views/ChatRoom/Header/Header.js b/src/views/ChatRoom/Header/Header.js
index d0ef4ff..445a74b 100644
--- a/src/views/ChatRoom/Header/Header.js
+++ b/src/views/ChatRoom/Header/Header.js
@@ -59,19 +59,19 @@ export default class Header extends Component {
style={{ direction: 'rtl', fontFamily: 'IRANSansNumeralLight' }}
>