blob: f498625bb50fbd5300b92643bf3e22d66135274b [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
simon9f814a32022-11-22 21:40:53 -050018import { Box, Stack } from '@mui/material';
idillon07d31cc2022-12-06 22:40:14 -050019import { ReactNode } from 'react';
Adrien Béraud35e7d7c2021-04-13 03:28:39 -040020
Adrien Béraud995e8022021-04-08 13:46:51 -040021import ConversationList from '../components/ConversationList';
simon07b4eb02022-09-29 17:50:26 -040022import Header from '../components/Header';
simon07b4eb02022-09-29 17:50:26 -040023import NewContactForm from '../components/NewContactForm';
ervinanoh34eb9472022-09-13 04:20:28 -040024
simon21f7d9f2022-11-28 14:21:54 -050025const Messenger = ({ children }: { children?: ReactNode }) => {
Adrien Béraud4e287b92021-04-24 16:15:56 -040026 return (
simon9f814a32022-11-22 21:40:53 -050027 <Box display="flex" height="100%">
simond47ef9e2022-09-28 22:24:28 -040028 <Stack flexGrow={0} flexShrink={0} overflow="auto">
idillonbef18a52022-09-01 01:51:40 -040029 <Header />
simon21f7d9f2022-11-28 14:21:54 -050030 <NewContactForm />
idillon07d31cc2022-12-06 22:40:14 -050031 <ConversationList />
idillonbef18a52022-09-01 01:51:40 -040032 </Stack>
simon9f814a32022-11-22 21:40:53 -050033 <Box flexGrow={1} display="flex" position="relative">
simon21f7d9f2022-11-28 14:21:54 -050034 {children}
simon9f814a32022-11-22 21:40:53 -050035 </Box>
36 </Box>
simond47ef9e2022-09-28 22:24:28 -040037 );
38};
Larbi Gharibe9af9732021-03-31 15:08:01 +010039
simond47ef9e2022-09-28 22:24:28 -040040export default Messenger;