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 ChatMessageView from '../components/chat/ChatMessageView';
|
||||
|
||||
const ChatPage: React.FC = () => {
|
||||
const ChatContent: React.FC = () => {
|
||||
const { rooms, selectedRoomToken, connected } = useChat();
|
||||
const queryClient = useQueryClient();
|
||||
const markedRoomsRef = React.useRef(new Set<string>());
|
||||
@@ -44,7 +44,6 @@ const ChatPage: React.FC = () => {
|
||||
}, [selectedRoomToken, queryClient]);
|
||||
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<Box
|
||||
sx={{
|
||||
height: 'calc(100vh - 112px)',
|
||||
@@ -91,6 +90,13 @@ const ChatPage: React.FC = () => {
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
const ChatPage: React.FC = () => {
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<ChatContent />
|
||||
</DashboardLayout>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user