fix: render ChatContent as DashboardLayout child so useChat has ChatProvider in scope
This commit is contained in:
@@ -10,7 +10,7 @@ import { notificationsApi } from '../services/notifications';
|
|||||||
import ChatRoomList from '../components/chat/ChatRoomList';
|
import ChatRoomList from '../components/chat/ChatRoomList';
|
||||||
import ChatMessageView from '../components/chat/ChatMessageView';
|
import ChatMessageView from '../components/chat/ChatMessageView';
|
||||||
|
|
||||||
const ChatPage: React.FC = () => {
|
const ChatContent: React.FC = () => {
|
||||||
const { rooms, selectedRoomToken, connected } = useChat();
|
const { rooms, selectedRoomToken, connected } = useChat();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const markedRoomsRef = React.useRef(new Set<string>());
|
const markedRoomsRef = React.useRef(new Set<string>());
|
||||||
@@ -44,7 +44,6 @@ const ChatPage: React.FC = () => {
|
|||||||
}, [selectedRoomToken, queryClient]);
|
}, [selectedRoomToken, queryClient]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardLayout>
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
height: 'calc(100vh - 112px)',
|
height: 'calc(100vh - 112px)',
|
||||||
@@ -91,6 +90,13 @@ const ChatPage: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ChatPage: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<DashboardLayout>
|
||||||
|
<ChatContent />
|
||||||
</DashboardLayout>
|
</DashboardLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user