From db01788f0752ad2577cf1cb678c2115222fc74eb Mon Sep 17 00:00:00 2001 From: Natalia Bandurova Date: Fri, 4 Oct 2024 23:36:51 +0300 Subject: [PATCH] feat: add messages query to component --- frontend/src/components/Messages.jsx | 75 +++++++++++++++------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/frontend/src/components/Messages.jsx b/frontend/src/components/Messages.jsx index 2bc68e9..3ad61c3 100644 --- a/frontend/src/components/Messages.jsx +++ b/frontend/src/components/Messages.jsx @@ -1,40 +1,45 @@ import { Button, Col, Form } from 'react-bootstrap'; import { ArrowRightSquare } from 'react-bootstrap-icons'; +import { useGetMessagesQuery } from '../api/messagesApi'; -const Messages = () => ( - -
-
-

- #general -

- 0 сообщений -
-
- Сообщения -
-
-
- - - - -
-
-
- -); +const Messages = () => { + const { data: messages = [] } = useGetMessagesQuery(); + console.log(messages); + return ( + +
+
+

+ #general +

+ 0 сообщений +
+
+ Сообщения +
+
+
+ + + + +
+
+
+ + ); +}; export default Messages;