Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-05-23 05:43:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0dd3fdf4f62aa1873a7faec20976d9b72cb55a06
0dd3fdf4
1 parent
5cac29cc
create ChatContainer.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
front/src/Routes/Chat/ChatContainer.js
front/src/Routes/Chat/ChatContainer.js
0 → 100644
View file @
0dd3fdf
import
React
from
"react"
;
import
{
useSubscription
,
useMutation
}
from
"@apollo/react-hooks"
;
import
ChatPresenter
from
"./ChatPresenter"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
NEW_MESSAGE
,
SUBSCRIPTION_MSG
}
from
"./ChatQueries"
;
import
useInput
from
"../../Hooks/useInput"
;
export
default
withRouter
(({
location
})
=>
{
const
[
createMsg
]
=
useMutation
(
NEW_MESSAGE
);
const
{
data
:
{
subMessage
},
}
=
useSubscription
(
SUBSCRIPTION_MSG
);
const
message
=
useInput
(
""
);
const
onSubmit
=
async
(
e
)
=>
{
e
.
preventDefault
();
};
return
(
<
ChatPresenter
location
=
{
location
}
message
=
{
message
}
onSubmit
=
{
onSubmit
}
/
>
);
});
Please
register
or
login
to post a comment