diff options
author | 2018-06-28 15:27:15 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | e1644f8dc734b81b1faf3b3f4488c70e28ef1c21 (patch) | |
tree | 54bcaf47e6a030ef75a4749d49338229c1755f3e /vnext/src/components/Post.js | |
parent | c8406a729b849c22b5e1fb707cdee45bfad7c402 (diff) |
accept text for Post and MessageInput
Diffstat (limited to 'vnext/src/components/Post.js')
-rw-r--r-- | vnext/src/components/Post.js | 6 |
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> |