|
@@ -29,7 +29,6 @@ export const MessageForm = () => {
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
scrollToBottom(endMessages)
|
|
scrollToBottom(endMessages)
|
|
- console.log('useEffect', endMessages)
|
|
|
|
}, [startMessages]);
|
|
}, [startMessages]);
|
|
|
|
|
|
return (
|
|
return (
|
|
@@ -91,47 +90,46 @@ export const MessageForm = () => {
|
|
|
|
|
|
</iframe>
|
|
</iframe>
|
|
:
|
|
:
|
|
- <p>{item.text}</p>
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- (item.file && item.file.split('.')[1] !== 'jpeg') ?
|
|
|
|
|
|
+
|
|
|
|
+ (item.file && item.fileType && item.fileType.split('/')[0] !== 'image') ?
|
|
|
|
|
|
|
|
+ <div style={{'display': 'flex', 'alignItems': 'center'}} >
|
|
|
|
+
|
|
<a href={SERVER_URL + item.file} download>
|
|
<a href={SERVER_URL + item.file} download>
|
|
<Button
|
|
<Button
|
|
variant="contained"
|
|
variant="contained"
|
|
component="label"
|
|
component="label"
|
|
sx = {{
|
|
sx = {{
|
|
minWidth: 'auto',
|
|
minWidth: 'auto',
|
|
- minHeight: '40px',
|
|
|
|
|
|
+ minHeight: '25px',
|
|
backgroundImage:'url(' + imgBtn + ')' ,
|
|
backgroundImage:'url(' + imgBtn + ')' ,
|
|
backgroundPosition: 'center',
|
|
backgroundPosition: 'center',
|
|
backgroundRepeat: "no-repeat",
|
|
backgroundRepeat: "no-repeat",
|
|
- backgroundSize: '20px 40px'
|
|
|
|
-
|
|
|
|
- }}
|
|
|
|
|
|
+ backgroundSize: '15px 20px',
|
|
|
|
+ backgroundColor: '#d3d3d3'
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }}
|
|
>
|
|
>
|
|
</Button>
|
|
</Button>
|
|
</a>
|
|
</a>
|
|
|
|
+ <p style={{'marginLeft': '15px'}} >{item.text}</p>
|
|
|
|
+ </div>
|
|
:
|
|
:
|
|
- ''
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ <p>{item.text}</p>
|
|
|
|
+ }
|
|
|
|
|
|
- {
|
|
|
|
- (item.file && item.file.split('.')[1] == 'jpeg' ) //need to fix for other type files
|
|
|
|
|
|
+ {
|
|
|
|
+ (item.file && item.fileType && item.fileType.split('/')[0] == 'image' ) //need to fix for other type files
|
|
?
|
|
?
|
|
|
|
+
|
|
<img width={150} height={150} src={ SERVER_URL + item.file} alt={'error load image'}/>
|
|
<img width={150} height={150} src={ SERVER_URL + item.file} alt={'error load image'}/>
|
|
:
|
|
:
|
|
''
|
|
''
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
-
|
|
|
|
<div className={
|
|
<div className={
|
|
(item.userName === user.userName)? 'myDate' :'date'}>
|
|
(item.userName === user.userName)? 'myDate' :'date'}>
|
|
{dateFormat(item).time}
|
|
{dateFormat(item).time}
|