Skip to content

Commit

Permalink
add dragabble chat button
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Khaled308 committed Dec 16, 2023
1 parent b5a2026 commit 57385bf
Show file tree
Hide file tree
Showing 15 changed files with 10,720 additions and 9,920 deletions.
129 changes: 129 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"react": "^18.2.0",
"react-apexcharts": "^1.4.0",
"react-device-detect": "^2.2.2",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-perfect-scrollbar": "^1.5.8",
"react-redux": "^8.0.2",
Expand Down
5 changes: 4 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import Loader from 'ui-component/Loader';
import { authenticationAxios } from './utils/AxiosConfig';

import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';


// ==============================|| APP ||============================== //
Expand Down Expand Up @@ -58,13 +59,15 @@ const App = () => {
}, []);

return (
<DndProvider backend={HTML5Backend}>
<ThemeProvider theme={themes(customization)}>
<CssBaseline />
<LocalizationProvider dateAdapter={AdapterDateFns}>
{isLoading && <Loader />}
{!isLoading && <Routes />}
</LocalizationProvider>
</ThemeProvider>
</DndProvider>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ const pages = {
url: '/doctor/pages/contract',
target: false,
},
{
id: 'chat',
title: 'Chat',
type: 'item',
icon: icons.ChatIcon,
url: '/doctor/pages/chat',
target: false,
},
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ const pages = {
url: '/patient/wallet',
target: false,
},
{
id: 'chat',
title: 'Chat',
type: 'item',
icon: icons.ChatIcon,
url: '/patient/pages/chat',
target: false,
},
],
};

Expand Down
12 changes: 10 additions & 2 deletions client/src/layout/MainLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {

import Header from './Header';
import Sidebar from './Sidebar';
import Chat from '../../pages/chat/Chat';
// import Customization from '../Customization';

import { drawerWidth } from 'store/constant';
Expand Down Expand Up @@ -66,6 +67,7 @@ const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })(
// ==============================|| MAIN LAYOUT ||============================== //

const MainLayout = ({ userType }) => {
Outlet;
const theme = useTheme();
const matchDownMd = useMediaQuery(theme.breakpoints.down('md'));
const navigate = useNavigate();
Expand Down Expand Up @@ -133,11 +135,17 @@ const MainLayout = ({ userType }) => {
)}

{/* main content */}
<Main theme={theme} open={leftDrawerOpened}>
<Main theme={theme} open={leftDrawerOpened} sx={{ position: 'relative' }}>
{(!user || user.type != userType) && (
<h1>not autherized!!</h1>
)}
{user && user.type == userType && <Outlet />}
{user && user.type == userType &&
<Chat>
<div>
<Outlet />
</div>
</Chat>
}
</Main>

{/* <Customization /> */}
Expand Down
Loading

0 comments on commit 57385bf

Please sign in to comment.