v0.10.3 ui changes and bug fixes
This commit is contained in:
@@ -7,6 +7,7 @@ import Sidebar from '../components/Sidebar.jsx';
|
||||
import ChatWindow from '../components/ChatWindow.jsx';
|
||||
import ProfileModal from '../components/ProfileModal.jsx';
|
||||
import UserManagerModal from '../components/UserManagerModal.jsx';
|
||||
import HostPanel from '../components/HostPanel.jsx';
|
||||
import SettingsModal from '../components/SettingsModal.jsx';
|
||||
import BrandingModal from '../components/BrandingModal.jsx';
|
||||
import NewChatModal from '../components/NewChatModal.jsx';
|
||||
@@ -41,7 +42,7 @@ export default function Chat() {
|
||||
const [modal, setModal] = useState(null); // 'profile' | 'users' | 'settings' | 'newchat' | 'help' | 'groupmanager'
|
||||
const [page, setPage] = useState('chat'); // 'chat' | 'schedule'
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
const [features, setFeatures] = useState({ branding: false, groupManager: false, scheduleManager: false, appType: 'JAMA-Chat', teamToolManagers: [] });
|
||||
const [features, setFeatures] = useState({ branding: false, groupManager: false, scheduleManager: false, appType: 'JAMA-Chat', teamToolManagers: [], isHostDomain: false });
|
||||
const [helpDismissed, setHelpDismissed] = useState(true); // true until status loaded
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
|
||||
const [showSidebar, setShowSidebar] = useState(true);
|
||||
@@ -82,6 +83,7 @@ export default function Chat() {
|
||||
scheduleManager: settings.feature_schedule_manager === 'true',
|
||||
appType: settings.app_type || 'JAMA-Chat',
|
||||
teamToolManagers: JSON.parse(settings.team_tool_managers || settings.team_group_managers || '[]'),
|
||||
isHostDomain: settings.is_host_domain === 'true',
|
||||
}));
|
||||
}).catch(() => {});
|
||||
api.getMyUserGroups().then(({ groupIds }) => {
|
||||
@@ -332,6 +334,34 @@ export default function Chat() {
|
||||
|
||||
const isToolManager = user?.role === 'admin' || (features.teamToolManagers || []).some(gid => (features.userGroupMemberships || []).includes(gid));
|
||||
|
||||
if (page === 'hostpanel') {
|
||||
return (
|
||||
<div className="chat-layout">
|
||||
<GlobalBar isMobile={isMobile} showSidebar={true} onBurger={() => setDrawerOpen(true)} />
|
||||
<div className="chat-body" style={{ overflow: 'hidden' }}>
|
||||
<HostPanel />
|
||||
</div>
|
||||
<NavDrawer
|
||||
open={drawerOpen}
|
||||
onClose={() => setDrawerOpen(false)}
|
||||
onMessages={() => { setDrawerOpen(false); setPage('chat'); }}
|
||||
onSchedule={() => { setDrawerOpen(false); setPage('schedule'); }}
|
||||
onScheduleManager={() => { setDrawerOpen(false); setPage('schedule'); }}
|
||||
onGroupManager={() => { setDrawerOpen(false); if(isMobile) setModal('mobilegroupmanager'); else setModal('groupmanager'); }}
|
||||
onBranding={() => { setDrawerOpen(false); setModal('branding'); }}
|
||||
onSettings={() => { setDrawerOpen(false); setModal('settings'); }}
|
||||
onUsers={() => { setDrawerOpen(false); setModal('users'); }}
|
||||
onHostPanel={() => { setDrawerOpen(false); setPage('hostpanel'); }}
|
||||
features={features}
|
||||
currentPage={page}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
{modal === 'profile' && <ProfileModal onClose={() => setModal(null)} />}
|
||||
{modal === 'settings' && <SettingsModal onClose={() => setModal(null)} onFeaturesChanged={setFeatures} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (page === 'schedule') {
|
||||
return (
|
||||
<div className="chat-layout">
|
||||
@@ -356,6 +386,7 @@ export default function Chat() {
|
||||
onBranding={() => { setDrawerOpen(false); setModal('branding'); }}
|
||||
onSettings={() => { setDrawerOpen(false); setModal('settings'); }}
|
||||
onUsers={() => { setDrawerOpen(false); setModal('users'); }}
|
||||
onHostPanel={() => { setDrawerOpen(false); setPage('hostpanel'); }}
|
||||
features={features}
|
||||
currentPage={page}
|
||||
isMobile={isMobile}
|
||||
@@ -425,6 +456,7 @@ export default function Chat() {
|
||||
onBranding={() => { setDrawerOpen(false); setModal('branding'); }}
|
||||
onSettings={() => { setDrawerOpen(false); setModal('settings'); }}
|
||||
onUsers={() => { setDrawerOpen(false); setModal('users'); }}
|
||||
onHostPanel={() => { setDrawerOpen(false); setPage('hostpanel'); }}
|
||||
features={features}
|
||||
currentPage={page}
|
||||
isMobile={isMobile}
|
||||
|
||||
Reference in New Issue
Block a user