Prepared some stuff for DMs update

This commit is contained in:
root 2025-03-22 17:20:01 +00:00
parent 02aa9cf4ea
commit 5ffde74942
2 changed files with 17 additions and 5 deletions

View File

@ -19,7 +19,7 @@ const GuildPage: React.FunctionComponent = () => {
const textChannels = useSelector(getGuildChannels(guildId)).filter(c => c.type === 'TEXT'); const textChannels = useSelector(getGuildChannels(guildId)).filter(c => c.type === 'TEXT');
useEffect(() => { useEffect(() => {
dispatch(uiActions.pageSwitched({ channel, guild })); dispatch(uiActions.pageSwitched({ channel, guild: guildId }));
}, [guild, channel]); }, [guild, channel]);
if (!guild) if (!guild)

View File

@ -1,24 +1,36 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { actions as ui } from '../../store/ui'; import { actions as uiActions } from '../../store/ui';
import AppNavbar from '../navigation/app-navbar'; import AppNavbar from '../navigation/app-navbar';
import Sidebar from '../navigation/sidebar/sidebar'; import Sidebar from '../navigation/sidebar/sidebar';
import PageWrapper from './page-wrapper'; import PageWrapper from './page-wrapper';
import DMList from '../navigation/sidebar/dm-list';
import TextBasedChannel from '../channel/text-based-channel';
const OverviewPage: React.FunctionComponent = () => { const OverviewPage: React.FunctionComponent = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const ui = useSelector((s: Store.AppState) => s.ui);
useEffect(() => { useEffect(() => {
dispatch(ui.pageSwitched({ channel: null, guild: null })); dispatch(uiActions.pageSwitched({ channel: null, guild: null }));
}, []); }, []);
return ( return (
<PageWrapper <PageWrapper
className="bg-bg-primary h-full w-full" className="bg-bg-primary h-full w-full"
pageTitle="acrd.app"> pageTitle="PVTChat">
<Sidebar /> <Sidebar />
<AppNavbar /> <AppNavbar />
There's nothing here yet, sadly..
<div className="bg-bg-primary h-full w-full flex flex-col flex-grow"></div> <div className="bg-bg-primary h-full w-full flex flex-col flex-grow"></div>
<div
style={{ height: 'calc(100vh - 48px)' }}
className="flex">
{ui.activeChannel && {
'DM': <TextBasedChannel />,
}["DM"]}
<DMList />
</div>
</PageWrapper> </PageWrapper>
); );
} }