simon | 26e79f7 | 2022-10-05 22:16:08 -0400 | [diff] [blame] | 1 | /* |
| 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 | */ |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 18 | import { Box, Stack } from '@mui/material'; |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 19 | import { ReactNode } from 'react'; |
Adrien Béraud | 35e7d7c | 2021-04-13 03:28:39 -0400 | [diff] [blame] | 20 | |
Adrien Béraud | 995e802 | 2021-04-08 13:46:51 -0400 | [diff] [blame] | 21 | import ConversationList from '../components/ConversationList'; |
simon | 07b4eb0 | 2022-09-29 17:50:26 -0400 | [diff] [blame] | 22 | import Header from '../components/Header'; |
ervinanoh | 34eb947 | 2022-09-13 04:20:28 -0400 | [diff] [blame] | 23 | |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 24 | const Messenger = ({ children }: { children?: ReactNode }) => { |
Adrien Béraud | 4e287b9 | 2021-04-24 16:15:56 -0400 | [diff] [blame] | 25 | return ( |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 26 | <Box display="flex" height="100%"> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 27 | <Stack flexGrow={0} flexShrink={0} overflow="auto"> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 28 | <Header /> |
idillon | 07d31cc | 2022-12-06 22:40:14 -0500 | [diff] [blame] | 29 | <ConversationList /> |
idillon | bef18a5 | 2022-09-01 01:51:40 -0400 | [diff] [blame] | 30 | </Stack> |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 31 | <Box flexGrow={1} display="flex" position="relative"> |
simon | 21f7d9f | 2022-11-28 14:21:54 -0500 | [diff] [blame] | 32 | {children} |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 33 | </Box> |
| 34 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 35 | ); |
| 36 | }; |
Larbi Gharib | e9af973 | 2021-03-31 15:08:01 +0100 | [diff] [blame] | 37 | |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 38 | export default Messenger; |