Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -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 | */ |
| 18 | import { Box, Card, Grid, Stack, Typography } from '@mui/material'; |
| 19 | |
| 20 | import { |
| 21 | CallingChatButton, |
| 22 | CallingEndButton, |
| 23 | CallingExtensionButton, |
| 24 | CallingFullscreenButton, |
| 25 | CallingGroupButton, |
| 26 | CallingMicButton, |
| 27 | CallingRecordButton, |
| 28 | CallingScreenShareButton, |
| 29 | CallingVideoCameraButton, |
| 30 | CallingVolumeButton, |
| 31 | } from '../components/Button'; |
| 32 | |
| 33 | export default function CallInterface() { |
| 34 | return ( |
| 35 | <> |
| 36 | <Box sx={{ backgroundColor: 'blue', width: '100%', height: '100%', position: 'absolute' }}> |
| 37 | {/* Host video will be shown here */} |
| 38 | </Box> |
| 39 | <Stack |
| 40 | position="absolute" |
| 41 | direction="column" |
| 42 | spacing={1} |
| 43 | margin={2} |
| 44 | sx={{ left: 0, right: 0, top: 0, bottom: 0 }} |
| 45 | > |
| 46 | {/* Top panel with guest information */} |
| 47 | <Box> |
| 48 | <CallInterfaceInformation /> |
| 49 | </Box> |
| 50 | {/* Guest video, with empty space to be moved around and stickied to walls */} |
| 51 | <Box height="100%"> |
| 52 | <Box |
| 53 | sx={{ |
| 54 | aspectRatio: '16/9', |
| 55 | position: 'absolute', |
| 56 | right: 0, |
| 57 | zIndex: 2, |
| 58 | backgroundColor: 'white', |
| 59 | borderRadius: '12px', |
| 60 | minWidth: '25%', |
| 61 | minHeight: '25%', |
| 62 | maxWidth: '50%', |
| 63 | maxHeight: '50%', |
| 64 | }} |
| 65 | /> |
| 66 | </Box> |
| 67 | {/* Bottom panel with calling buttons */} |
| 68 | <Grid container justifyContent="space-between"> |
| 69 | <Grid item xs /> |
| 70 | <Grid item> |
| 71 | <CallInterfacePrimaryButtons /> |
| 72 | </Grid> |
| 73 | <Grid item xs sx={{ display: 'flex', justifyContent: 'flex-end' }}> |
| 74 | <CallInterfaceSecondaryButtons /> |
| 75 | </Grid> |
| 76 | </Grid> |
| 77 | </Stack> |
| 78 | </> |
| 79 | ); |
| 80 | } |
| 81 | |
| 82 | const CallInterfaceInformation = () => { |
| 83 | return ( |
| 84 | <Stack direction="row" justifyContent="space-between" alignItems="center"> |
| 85 | <Typography color="white" component="p"> |
| 86 | Alain Thérieur |
| 87 | </Typography> |
| 88 | <Typography color="white" component="p"> |
| 89 | 01:23 |
| 90 | </Typography> |
| 91 | </Stack> |
| 92 | ); |
| 93 | }; |
| 94 | |
| 95 | const CallInterfacePrimaryButtons = () => { |
| 96 | return ( |
| 97 | <Card sx={{ backgroundColor: 'black', textAlign: 'center' }}> |
| 98 | <CallingMicButton /> |
| 99 | <CallingEndButton /> |
| 100 | <CallingVideoCameraButton /> |
| 101 | </Card> |
| 102 | ); |
| 103 | }; |
| 104 | |
| 105 | const CallInterfaceSecondaryButtons = () => { |
| 106 | return ( |
| 107 | <Card style={{ backgroundColor: 'black' }}> |
| 108 | <CallingVolumeButton /> |
| 109 | <CallingGroupButton /> |
| 110 | <CallingChatButton /> |
| 111 | <CallingScreenShareButton /> |
| 112 | <CallingRecordButton /> |
| 113 | <CallingExtensionButton /> |
| 114 | <CallingFullscreenButton /> |
| 115 | </Card> |
| 116 | ); |
| 117 | }; |