From 8c65b6020d0412eb5ef3f02892f527c61e2f9115 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 26 Jun 2018 17:12:20 +0300 Subject: [PATCH 1/6] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Chat/Chat.js | 0 src/components/Chat/index.js | 0 src/components/Message/Message.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/components/Chat/Chat.js create mode 100644 src/components/Chat/index.js create mode 100644 src/components/Message/Message.js diff --git a/src/components/Chat/Chat.js b/src/components/Chat/Chat.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Chat/index.js b/src/components/Chat/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Message/Message.js b/src/components/Message/Message.js new file mode 100644 index 0000000..e69de29 From e06a484d89e7947af1c7b0809e1ac6cfdebc01c6 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 26 Jun 2018 17:14:11 +0300 Subject: [PATCH 2/6] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/codeStyles/Project.xml | 37 + .idea/codeStyles/codeStyleConfig.xml | 6 + .idea/dictionaries/Andrey.xml | 3 + .idea/encodings.xml | 6 + .idea/inspectionProfiles/Project_Default.xml | 5 + .idea/june-loftschool-react-homeworks.iml | 12 + .idea/misc.xml | 10 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 464 + package-lock.json | 12542 +++++++++++++++++ src/components/Chat/Chat.js | 47 + src/components/Chat/index.js | 1 + src/components/Message/Message.js | 6 + src/index.js | 2 +- 15 files changed, 13154 insertions(+), 1 deletion(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/dictionaries/Andrey.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/june-loftschool-react-homeworks.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 package-lock.json diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..0eded9e --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..6e6eec1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/dictionaries/Andrey.xml b/.idea/dictionaries/Andrey.xml new file mode 100644 index 0000000..59fb6f7 --- /dev/null +++ b/.idea/dictionaries/Andrey.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8d66637 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/june-loftschool-react-homeworks.iml b/.idea/june-loftschool-react-homeworks.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/june-loftschool-react-homeworks.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..577f01a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..777e8ac --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..da64237 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + true + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ; + } + + changeInputMessage = event => { + this.setState({ + messageInput: event.target.value + }); + }; + + sendMessageOnEnter = event => { + if (event.key !== "Enter" || !this.state.messageInput) { + return; + } + + this.setState({ + messages: [...this.state.messages, {"text": this.state.messageInput}], + messageInput: "" + }); + }; +} diff --git a/src/components/Chat/index.js b/src/components/Chat/index.js index e69de29..c21b661 100644 --- a/src/components/Chat/index.js +++ b/src/components/Chat/index.js @@ -0,0 +1 @@ +export { default } from './Chat' \ No newline at end of file diff --git a/src/components/Message/Message.js b/src/components/Message/Message.js index e69de29..47ee17e 100644 --- a/src/components/Message/Message.js +++ b/src/components/Message/Message.js @@ -0,0 +1,6 @@ +import React from 'react' +import './Message.css' + +export default ({text}) => { + return {text} +} diff --git a/src/index.js b/src/index.js index 2a5849d..b359852 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import Chat from 'components/Chat'; +import Chat from './components/Chat'; import './index.css'; ReactDOM.render(, document.getElementById('root')); From cb10a07f00f7612dedce87d0d0e357abbc8ae33a Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 26 Jun 2018 18:13:00 +0300 Subject: [PATCH 3/6] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/codeStyles/Project.xml | 37 -- .idea/codeStyles/codeStyleConfig.xml | 6 - .idea/dictionaries/Andrey.xml | 3 - .idea/encodings.xml | 6 - .idea/inspectionProfiles/Project_Default.xml | 5 - .idea/june-loftschool-react-homeworks.iml | 12 - .idea/misc.xml | 10 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 464 ------------------- 10 files changed, 557 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/dictionaries/Andrey.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/june-loftschool-react-homeworks.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 0eded9e..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 6e6eec1..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/dictionaries/Andrey.xml b/.idea/dictionaries/Andrey.xml deleted file mode 100644 index 59fb6f7..0000000 --- a/.idea/dictionaries/Andrey.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 8d66637..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/june-loftschool-react-homeworks.iml b/.idea/june-loftschool-react-homeworks.iml deleted file mode 100644 index 24643cc..0000000 --- a/.idea/june-loftschool-react-homeworks.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 577f01a..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 777e8ac..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index da64237..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,464 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - true - true - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1529462275004 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/Chat/Chat.js b/src/components/Chat/Chat.js index b8277a5..78b7c64 100644 --- a/src/components/Chat/Chat.js +++ b/src/components/Chat/Chat.js @@ -40,7 +40,7 @@ export default class Chat extends Component { } this.setState({ - messages: [...this.state.messages, {"text": this.state.messageInput}], + messages: [...this.state.messages, { "text": this.state.messageInput }], messageInput: "" }); }; From c789068fcbc613b4a565b11c3d67e64d067eab38 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 30 Jun 2018 13:49:38 +0300 Subject: [PATCH 5/6] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20setState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Chat/Chat.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Chat/Chat.js b/src/components/Chat/Chat.js index 78b7c64..7d42f81 100644 --- a/src/components/Chat/Chat.js +++ b/src/components/Chat/Chat.js @@ -39,9 +39,9 @@ export default class Chat extends Component { return; } - this.setState({ - messages: [...this.state.messages, { "text": this.state.messageInput }], + this.setState((prevState, props) => ({ + messages: [...prevState.messages, { "text": prevState.messageInput }], messageInput: "" - }); + })); }; } From 701762902e469dbc9dea0f6027a7a441891f6490 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sun, 8 Jul 2018 20:08:43 +0300 Subject: [PATCH 6/6] add
  • --- .idea/workspace.xml | 447 ------------------------------------ src/components/Chat/Chat.js | 8 +- 2 files changed, 7 insertions(+), 448 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3dd5933..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,447 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - true - true - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - -