handling overlay and making it WORK!!!!
This commit is contained in:
@@ -384,7 +384,7 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
|
||||
});
|
||||
|
||||
priorityConversations.sort((a, b) => {
|
||||
return b.createdDate.getTime() - a.createdDate.getTime();
|
||||
return b.createdDate.valueOf() - a.createdDate.valueOf();
|
||||
});
|
||||
|
||||
return [priorityConversations, inboxConversations];
|
||||
|
||||
@@ -36,8 +36,8 @@ export function ElectronProvider({ children }: { children: React.ReactNode }) {
|
||||
} else if (desktopMode === 'overlayOnly') {
|
||||
stayOnTop = true;
|
||||
finalDimensions = {
|
||||
height: 273,
|
||||
width: 350,
|
||||
height: DEFAULT_APP_PRESET.height,
|
||||
width: 100,
|
||||
};
|
||||
finalPosition = 'topRight';
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import { blueGrey } from '@mui/material/colors';
|
||||
import useAuth from '../providers/AuthProvider';
|
||||
import useConversations from '../providers/ConversationProvider';
|
||||
import useDevices from '../hooks/useDevices';
|
||||
import useElectron from '../providers/ElectronProvider';
|
||||
import useSearch from '../providers/SearchProvider';
|
||||
import useZen from '../providers/ZenProvider';
|
||||
|
||||
@@ -35,6 +36,8 @@ export default function FooterControls() {
|
||||
const { selectedConversation, priorityConversations } = useConversations();
|
||||
const { user, handleLogout } = useAuth();
|
||||
|
||||
const { handleToggleDesktopMode, desktopMode } = useElectron();
|
||||
|
||||
const [openUserSettings, setOpenUserSettings] = useState<boolean>(false);
|
||||
|
||||
const handleClickProfile = useCallback(
|
||||
@@ -64,6 +67,7 @@ export default function FooterControls() {
|
||||
<Box
|
||||
sx={{
|
||||
maxWidth: 100,
|
||||
width: '100%',
|
||||
zIndex: 10,
|
||||
boxShadow: 10,
|
||||
|
||||
@@ -104,7 +108,12 @@ export default function FooterControls() {
|
||||
<Divider orientation="horizontal" flexItem />
|
||||
|
||||
<Tooltip title={'overlay mode'}>
|
||||
<Switch color="secondary" size="small" />
|
||||
<Switch
|
||||
checked={desktopMode === 'overlayOnly'}
|
||||
onChange={handleToggleDesktopMode}
|
||||
color="secondary"
|
||||
size="small"
|
||||
/>
|
||||
</Tooltip>
|
||||
|
||||
<Divider orientation="horizontal" flexItem />
|
||||
@@ -156,7 +165,7 @@ function OverlayConversation({
|
||||
if (!isSelected) {
|
||||
selectConversation(masterConversation._id.toString(), false);
|
||||
}
|
||||
}, [masterConversation, selectConversation]);
|
||||
}, [masterConversation, selectConversation, isSelected]);
|
||||
|
||||
return (
|
||||
<Stack
|
||||
|
||||
@@ -8,6 +8,7 @@ import NewConversationDialog from './NewConversationDialog';
|
||||
import OmniSearchResults from './OmniSearchResults';
|
||||
import React from 'react';
|
||||
import { blueGrey } from '@mui/material/colors';
|
||||
import useElectron from '../providers/ElectronProvider';
|
||||
import useRouter from '../providers/RouterProvider';
|
||||
import useSearch from '../providers/SearchProvider';
|
||||
|
||||
@@ -16,6 +17,8 @@ export default function Terminal() {
|
||||
|
||||
const { searchQuery } = useSearch();
|
||||
|
||||
const { desktopMode } = useElectron();
|
||||
|
||||
return (
|
||||
<Container
|
||||
maxWidth={false}
|
||||
@@ -25,44 +28,47 @@ export default function Terminal() {
|
||||
flexDirection: 'row',
|
||||
}}
|
||||
>
|
||||
<Grid container spacing={0} sx={{ flex: 1 }}>
|
||||
<Grid
|
||||
item
|
||||
xs={4}
|
||||
sx={{
|
||||
zIndex: 2,
|
||||
backgroundColor: blueGrey[50],
|
||||
boxShadow: 3,
|
||||
borderRight: `1px solid ${blueGrey}`,
|
||||
{desktopMode === 'mainApp' && (
|
||||
<>
|
||||
{/* create chat dialog */}
|
||||
<NewConversationDialog />
|
||||
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<Navbar />
|
||||
<Grid container spacing={0} sx={{ flex: 1 }}>
|
||||
<Grid
|
||||
item
|
||||
xs={4}
|
||||
sx={{
|
||||
zIndex: 2,
|
||||
backgroundColor: blueGrey[50],
|
||||
boxShadow: 3,
|
||||
borderRight: `1px solid ${blueGrey}`,
|
||||
|
||||
<Box sx={{ p: 2 }}>{searchQuery ? <OmniSearchResults /> : <ConversationList />}</Box>
|
||||
</Grid>
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<Navbar />
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs={8}
|
||||
sx={{
|
||||
backgroundColor: 'white',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
maxHeight: '100vh',
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
<MainPanel />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Box sx={{ p: 2 }}>{searchQuery ? <OmniSearchResults /> : <ConversationList />}</Box>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs={8}
|
||||
sx={{
|
||||
backgroundColor: 'white',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
maxHeight: '100vh',
|
||||
}}
|
||||
>
|
||||
<MainPanel />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)}
|
||||
|
||||
<FooterControls />
|
||||
|
||||
{/* create chat dialog */}
|
||||
<NewConversationDialog />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user