From 7bd3acdf36643d809b1cbab8da8278fa128e5685 Mon Sep 17 00:00:00 2001 From: ShingiJP Date: Tue, 16 Jan 2018 10:39:54 +0200 Subject: [PATCH 1/5] Added alt name to prfile image import --- v-tech-app/src/containers/chats/profile/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v-tech-app/src/containers/chats/profile/index.js b/v-tech-app/src/containers/chats/profile/index.js index e5b18bd..4d5c4b9 100644 --- a/v-tech-app/src/containers/chats/profile/index.js +++ b/v-tech-app/src/containers/chats/profile/index.js @@ -36,7 +36,7 @@ class Profile extends React.Component { let {imagePreviewUrl} = this.state; let $imagePreview = null; if (imagePreviewUrl) { - $imagePreview = (); + $imagePreview = ({"User); } else { $imagePreview = ({"ChatterBox); From 809bb6709e6cc72d8adf3c4fca98a7202bfad350 Mon Sep 17 00:00:00 2001 From: ShingiJP Date: Tue, 16 Jan 2018 15:35:48 +0200 Subject: [PATCH 2/5] Sidebar updates last message after sending message and switching person. Sent messages store send in store. --- .../src/containers/chats/chat_area/index.css | 12 ++++-- .../src/containers/chats/chat_area/index.js | 21 +++++++++- .../src/containers/chats/side_bar/index.css | 7 +++- .../src/containers/chats/side_bar/index.js | 8 +++- v-tech-app/src/modules/chats_reducer.js | 41 +++++++++++++++++-- 5 files changed, 76 insertions(+), 13 deletions(-) diff --git a/v-tech-app/src/containers/chats/chat_area/index.css b/v-tech-app/src/containers/chats/chat_area/index.css index e215a3f..7dbb57c 100644 --- a/v-tech-app/src/containers/chats/chat_area/index.css +++ b/v-tech-app/src/containers/chats/chat_area/index.css @@ -4,8 +4,6 @@ background:whitesmoke; } - - .text > p:first-of-type{ width:100%; margin-top:0; @@ -42,6 +40,10 @@ background:whitesmoke; bottom: 10px; + width: 735px; + margin-top: 15px; + height: 50px; + border-radius: 40px; } .msj{ float:left; @@ -50,9 +52,10 @@ } .frame{ background:rgb(243, 243, 243); - height:480px; + height:500px; padding:0px; width: 735px; + margin-bottom: 38px; } .frame > div:last-of-type{ @@ -95,4 +98,5 @@ input:focus{ display: inline-block; padding: 10px; -} \ No newline at end of file +} + diff --git a/v-tech-app/src/containers/chats/chat_area/index.js b/v-tech-app/src/containers/chats/chat_area/index.js index ca30501..d4bdbaf 100644 --- a/v-tech-app/src/containers/chats/chat_area/index.js +++ b/v-tech-app/src/containers/chats/chat_area/index.js @@ -11,6 +11,7 @@ import { connect } from 'react-redux'; //import { msg_successful } from '../../../modules/messages_reducer' import { append_chat } from '../../../modules/chats_reducer' import { get_all_msgs } from '../../../modules/messages_reducer' +import { chats_on_load } from '../../../modules/chats_reducer' //-- No use time. It is a javaScript effect. @@ -49,6 +50,16 @@ import { get_all_msgs } from '../../../modules/messages_reducer' // eslint-disable-next-line +/*window.onload = function () { + if (! localStorage.justOnce) { + localStorage.setItem("justOnce", "true"); + alert("This works") + window.location.reload(); + this.forceUpdate() + } +}*/ + + class AppChatArea extends React.Component { handleKeyPress = (event) => { @@ -61,14 +72,18 @@ class AppChatArea extends React.Component { //var array = this.props.get_all_msgs() this.props.append_chat(text2) + //this.props.messages.map(all_msgs) } this.forceUpdate(); + } + + addMessage() { //return this.props.friends.map((friend) => { return this.props.open_chat.map((each_msg) => { @@ -120,8 +135,9 @@ class AppChatArea extends React.Component { +
- +
@@ -143,7 +159,8 @@ const mapStateToProps = state => ({ const mapDispatchToProps = dispatch => bindActionCreators({ //msg_successful, append_chat, - get_all_msgs + get_all_msgs, + chats_on_load }, dispatch) diff --git a/v-tech-app/src/containers/chats/side_bar/index.css b/v-tech-app/src/containers/chats/side_bar/index.css index 4abe483..61db900 100644 --- a/v-tech-app/src/containers/chats/side_bar/index.css +++ b/v-tech-app/src/containers/chats/side_bar/index.css @@ -15,9 +15,14 @@ .open_chats{ height: 410px; width: 100%; + /*overflow: scroll;*/ overflow: scroll; + height: 565px; +} +::-webkit-scrollbar{ + /*border: 2px solid red !important;*/ + } - .chat_friend_name{ margin-left: 20px; diff --git a/v-tech-app/src/containers/chats/side_bar/index.js b/v-tech-app/src/containers/chats/side_bar/index.js index 8888b09..57679f5 100644 --- a/v-tech-app/src/containers/chats/side_bar/index.js +++ b/v-tech-app/src/containers/chats/side_bar/index.js @@ -7,6 +7,7 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { get_convo } from '../../../modules/chats_reducer'; +import { chats_on_load } from '../../../modules/chats_reducer' //import { append_chat } from '../../../modules/chats_reducer' /*function link_chat (){ @@ -23,7 +24,7 @@ class AppSideBar extends React.Component { this.props.get_convo(active_id); } - + createChatListItems() { return this.props.friends.map((friend) => { @@ -36,7 +37,6 @@ class AppSideBar extends React.Component {
); - }); } @@ -56,6 +56,9 @@ class AppSideBar extends React.Component { render() { return (
+