aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Post.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-28 15:27:15 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commite1644f8dc734b81b1faf3b3f4488c70e28ef1c21 (patch)
tree54bcaf47e6a030ef75a4749d49338229c1755f3e /vnext/src/components/Post.js
parentc8406a729b849c22b5e1fb707cdee45bfad7c402 (diff)
accept text for Post and MessageInput
Diffstat (limited to 'vnext/src/components/Post.js')
-rw-r--r--vnext/src/components/Post.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/vnext/src/components/Post.js b/vnext/src/components/Post.js
index fd577603..7bde7432 100644
--- a/vnext/src/components/Post.js
+++ b/vnext/src/components/Post.js
@@ -1,4 +1,5 @@
import React from 'react';
+import * as qs from 'query-string';
import MessageInput from './MessageInput';
@@ -7,9 +8,10 @@ import { post } from '../api';
export default class Post extends React.Component {
constructor(props) {
super(props)
+ let params = qs.parse(window.location.search);
this.state = {
attach: '',
- body: ''
+ body: params.body || ''
}
this.fileinput = React.createRef();
console.log(props)
@@ -39,7 +41,7 @@ export default class Post extends React.Component {
render() {
return (
<article>
- <MessageInput rows="7" data={{ mid: 0, timestamp: "0" }} onSend={this.postMessage}>
+ <MessageInput rows="7" text={this.state.body} data={{ mid: 0, timestamp: "0" }} onSend={this.postMessage}>
*weather It's very cold today!
</MessageInput>
</article>