diff --git a/public/favicon.ico b/public/favicon.ico index 302b29ec..5221f91a 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/ChatItem/ChatItem.css b/src/ChatItem/ChatItem.css index 891a77de..4e042daf 100644 --- a/src/ChatItem/ChatItem.css +++ b/src/ChatItem/ChatItem.css @@ -14,6 +14,7 @@ user-select: none; max-width: 100%; overflow: hidden; + min-width: 240px; } .rce-citem:hover { diff --git a/src/MessageBox/MessageBox.css b/src/MessageBox/MessageBox.css index 78bc0bdd..c0bb6b4f 100644 --- a/src/MessageBox/MessageBox.css +++ b/src/MessageBox/MessageBox.css @@ -11,7 +11,7 @@ border-top-right-radius: 0px; margin-right: 20px; margin-top: 5px; - display: inline-block; + display: flex; flex-direction: column; margin-bottom: 5px; padding: 6px 9px 8px 9px; @@ -106,4 +106,58 @@ .rce-mbox-photo--download:active { opacity: .3; +} + +.rce-mbox-file { + background: #e9e9e9; + display: flex; + border-radius: 5px; + margin-top: -3px; + margin-right: -6px; + margin-left: -6px; + align-items: center; + min-height: 52px; + max-width: 500px; + padding: 5px 0; + cursor: pointer; + user-select: none; + outline: none; + border:none; +} + +.rce-mbox-file > * { + padding: 0px 10px; +} + +.rce-mbox-file--icon { + font-size: 30px; + align-items: center; + display: flex; + flex-direction: column; +} + +.rce-mbox-file--size { + font-size: 10px; + margin-top: 3px; + max-width: 52px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.rce-mbox-file--text { + font-size: 13.6px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.rce-mbox-file--buttons { + font-size: 30px; + align-items: center; + display: flex; +} + +.rce-mbox-file--loading { + font-size: 15px; } \ No newline at end of file diff --git a/src/MessageBox/MessageBox.js b/src/MessageBox/MessageBox.js index c2cd6266..498d40c0 100644 --- a/src/MessageBox/MessageBox.js +++ b/src/MessageBox/MessageBox.js @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import './MessageBox.css'; import FaCloudDownload from 'react-icons/lib/fa/cloud-download'; +import FaFile from 'react-icons/lib/fa/file'; const classNames = require('classnames'); const ProgressBar = require('react-progressbar.js'); @@ -26,6 +27,10 @@ export class MessageBox extends Component { circle.setText(value); } }; + var fileProgressOptions = Object.assign({}, progressOptions); + fileProgressOptions.strokeWidth = 5; + fileProgressOptions.color = '#333'; + fileProgressOptions.trailWidth = 5; return (
@@ -74,6 +79,40 @@ export class MessageBox extends Component {
} + { + this.props.type === 'file' && + + }
12:30
diff --git a/src/assets/style.css b/src/assets/style.css index fc8350fc..fa6ad813 100644 --- a/src/assets/style.css +++ b/src/assets/style.css @@ -1,4 +1,9 @@ body { font-family: verdana, ubuntu; background: navajowhite; +} + +input, +button { + font-family: verdana, ubuntu; } \ No newline at end of file diff --git a/src/example/App.js b/src/example/App.js index 25527334..e849668d 100644 --- a/src/example/App.js +++ b/src/example/App.js @@ -1,17 +1,22 @@ import React, { Component } from 'react'; import MessageBox from '../MessageBox/MessageBox'; -import ChatItem from '../ChatItem/ChatItem'; const loremIpsum = require('lorem-ipsum'); export class App extends Component { random() { return { - unread: parseInt(Math.random() * 10 % 2), - title: loremIpsum({count: 1, units: 'sentences'}), - avatar: 'https://avatars0.githubusercontent.com/u/15075759?v=4', - subtitle: loremIpsum({count: 1, units: 'sentences'}), - date: new Date().setDate(1), + position: (parseInt(Math.random() * 10 % 2) && 'right'), + type: (parseInt(Math.random() * 10 % 2) ? 'file' : 'photo'), + text: loremIpsum({count: 1, units: 'sentences'}), + data: { + uri: 'https://user-images.githubusercontent.com/15075759/29005175-1d023bea-7ade-11e7-86d5-21f87225ef56.png', + status: { + click: true, + loading: 1, + } + }, + date: new Date(), }; } @@ -22,20 +27,21 @@ export class App extends Component { { arr.map((x, i) => { var tmp = this.random(); - return ; - // return ; + // title={tmp.title} + // subtitle={tmp.subtitle} + // avatar={tmp.avatar} + // unread={tmp.unread} + // date={tmp.date}/>; + + return }) }