diff options
author | Vitaly Takmazov | 2019-05-04 21:13:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:54 +0300 |
commit | f470636a70943a8ecad8bddc791a1c2dddd28e1e (patch) | |
tree | c43d109d88adbde9a696084070cdd92c6b9a004b /vnext/src/components/Post.js | |
parent | 3d7d213e3ddc5bf4f71d536f31677b768aa3b7c0 (diff) |
Components -> UI
Diffstat (limited to 'vnext/src/components/Post.js')
-rw-r--r-- | vnext/src/components/Post.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/vnext/src/components/Post.js b/vnext/src/components/Post.js deleted file mode 100644 index 3dc23613..00000000 --- a/vnext/src/components/Post.js +++ /dev/null @@ -1,38 +0,0 @@ -import React, { memo } from 'react'; - -import ReactRouterPropTypes from 'react-router-prop-types'; -import { UserType } from './Types'; - -import qs from 'qs'; - -import MessageInput from './MessageInput'; - -import { post } from '../api'; - -function PostComponent(props) { - let params = qs.parse(window.location.search.substring(1)); - let postMessage = (template) => { - const { attach, body } = template; - post(body, attach) - .then(response => { - if (response.status === 200) { - const msg = response.data.newMessage; - this.props.history.push(`/${this.props.visitor.uname}/${msg.mid}`); - } - }).catch(console.log); - }; - return ( - <div className="msg-cont"> - <MessageInput rows="7" text={params.body || ''} data={{ mid: 0, timestamp: '0' }} onSend={postMessage}> - *weather It is very cold today! - </MessageInput> - </div> - ); -} - -export default memo(PostComponent); - -PostComponent.propTypes = { - history: ReactRouterPropTypes.history.isRequired, - visitor: UserType -}; |