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 | */ |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 18 | import { Box, Card, Grid, Stack, Typography } from '@mui/material'; |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 19 | import { |
| 20 | ComponentType, |
| 21 | Fragment, |
| 22 | ReactNode, |
simon | 492e840 | 2022-11-29 16:48:37 -0500 | [diff] [blame] | 23 | RefObject, |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 24 | useCallback, |
| 25 | useContext, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 26 | useEffect, |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 27 | useLayoutEffect, |
| 28 | useMemo, |
| 29 | useRef, |
| 30 | useState, |
| 31 | } from 'react'; |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 32 | import Draggable from 'react-draggable'; |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 33 | |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 34 | import { ExpandableButtonProps } from '../components/Button'; |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 35 | import { |
| 36 | CallingChatButton, |
| 37 | CallingEndButton, |
| 38 | CallingExtensionButton, |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 39 | CallingFullScreenButton, |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 40 | CallingGroupButton, |
| 41 | CallingMicButton, |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 42 | CallingMoreVerticalButton, |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 43 | CallingRecordButton, |
| 44 | CallingScreenShareButton, |
| 45 | CallingVideoCameraButton, |
| 46 | CallingVolumeButton, |
simon | 1170c32 | 2022-10-31 14:51:31 -0400 | [diff] [blame] | 47 | } from '../components/CallButtons'; |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 48 | import CallChatDrawer from '../components/CallChatDrawer'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 49 | import { CallContext, CallStatus } from '../contexts/CallProvider'; |
Gabriel Rochon | 15a5fb2 | 2022-11-27 19:25:14 -0500 | [diff] [blame] | 50 | import { ConversationContext } from '../contexts/ConversationProvider'; |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 51 | import { WebRtcContext } from '../contexts/WebRtcProvider'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 52 | import { CallPending } from './CallPending'; |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 53 | |
simon | 1170c32 | 2022-10-31 14:51:31 -0400 | [diff] [blame] | 54 | export default () => { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 55 | const { callStatus, isChatShown, isFullscreen } = useContext(CallContext); |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 56 | const callInterfaceRef = useRef<HTMLDivElement>(); |
| 57 | |
| 58 | useEffect(() => { |
| 59 | if (!callInterfaceRef.current) { |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | if (isFullscreen && document.fullscreenElement === null) { |
| 64 | callInterfaceRef.current.requestFullscreen(); |
| 65 | } else if (!isFullscreen && document.fullscreenEnabled !== null) { |
| 66 | document.exitFullscreen(); |
| 67 | } |
| 68 | }, [isFullscreen]); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 69 | |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 70 | if (callStatus !== CallStatus.InCall) { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 71 | return <CallPending />; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 72 | } |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 73 | |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 74 | return ( |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 75 | <Box ref={callInterfaceRef} flexGrow={1} display="flex"> |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 76 | <CallInterface /> |
| 77 | {isChatShown && <CallChatDrawer />} |
| 78 | </Box> |
| 79 | ); |
simon | 1170c32 | 2022-10-31 14:51:31 -0400 | [diff] [blame] | 80 | }; |
| 81 | |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 82 | interface Props { |
| 83 | children?: ReactNode; |
| 84 | } |
| 85 | |
simon | 1170c32 | 2022-10-31 14:51:31 -0400 | [diff] [blame] | 86 | const CallInterface = () => { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 87 | const { localStream, remoteStreams } = useContext(WebRtcContext); |
simon | 492e840 | 2022-11-29 16:48:37 -0500 | [diff] [blame] | 88 | const { |
| 89 | isVideoOn, |
| 90 | currentMediaDeviceIds: { |
| 91 | audiooutput: { id: audioOutDeviceId }, |
| 92 | }, |
| 93 | localVideoRef, |
| 94 | remoteVideoRef, |
| 95 | } = useContext(CallContext); |
| 96 | const gridItemRef = useRef<HTMLDivElement | null>(null); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 97 | |
| 98 | useEffect(() => { |
| 99 | if (localStream && localVideoRef.current) { |
| 100 | localVideoRef.current.srcObject = localStream; |
| 101 | } |
simon | 492e840 | 2022-11-29 16:48:37 -0500 | [diff] [blame] | 102 | }, [localStream, localVideoRef]); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 103 | |
| 104 | useEffect(() => { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 105 | // TODO: For now, `remoteStream` is the first remote stream in the array. |
| 106 | // There should only be one in the array, but we should make sure this is right. |
| 107 | const remoteStream = remoteStreams?.at(0); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 108 | if (remoteStream && remoteVideoRef.current) { |
| 109 | remoteVideoRef.current.srcObject = remoteStream; |
| 110 | } |
simon | 492e840 | 2022-11-29 16:48:37 -0500 | [diff] [blame] | 111 | }, [remoteStreams, remoteVideoRef]); |
| 112 | |
| 113 | useEffect(() => { |
| 114 | if (!audioOutDeviceId) { |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | if (remoteVideoRef.current?.setSinkId) { |
| 119 | // This only work on chrome and other browsers that support `setSinkId` |
| 120 | // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId#browser_compatibility |
| 121 | remoteVideoRef.current.setSinkId(audioOutDeviceId); |
| 122 | } |
| 123 | }, [audioOutDeviceId, remoteVideoRef]); |
simon | ce2c0c4 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 124 | |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 125 | return ( |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 126 | <Box display="flex" flexGrow={1}> |
simon | ce2c0c4 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 127 | <video |
| 128 | ref={remoteVideoRef} |
| 129 | autoPlay |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 130 | style={{ zIndex: -1, backgroundColor: 'black', position: 'absolute', height: '100%', width: '100%' }} |
simon | ce2c0c4 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 131 | /> |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 132 | <Box flexGrow={1} margin={2} display="flex" flexDirection="column"> |
| 133 | {/* Guest video, takes the whole screen */} |
simon | 8b496b0 | 2022-11-29 01:46:46 -0500 | [diff] [blame] | 134 | <CallInterfaceInformation /> |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 135 | <Box flexGrow={1} marginY={2} position="relative"> |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 136 | <Draggable bounds="parent" nodeRef={localVideoRef ?? undefined}> |
| 137 | <video |
| 138 | ref={localVideoRef} |
| 139 | autoPlay |
Issam E. Maghni | 8961593 | 2022-11-29 19:05:28 +0000 | [diff] [blame] | 140 | muted |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 141 | style={{ |
| 142 | position: 'absolute', |
| 143 | right: 0, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 144 | borderRadius: '12px', |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 145 | maxHeight: '50%', |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 146 | maxWidth: '50%', |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 147 | visibility: isVideoOn ? 'visible' : 'hidden', |
| 148 | }} |
| 149 | /> |
| 150 | </Draggable> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 151 | </Box> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 152 | <Grid container> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 153 | <Grid item xs /> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 154 | <Grid item sx={{ display: 'flex', justifyContent: 'center' }}> |
| 155 | <div> |
| 156 | <CallInterfacePrimaryButtons /> |
| 157 | </div> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 158 | </Grid> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 159 | <Grid item xs sx={{ display: 'flex', justifyContent: 'flex-end' }} ref={gridItemRef}> |
| 160 | <CallInterfaceSecondaryButtons gridItemRef={gridItemRef} /> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 161 | </Grid> |
| 162 | </Grid> |
simon | 9f814a3 | 2022-11-22 21:40:53 -0500 | [diff] [blame] | 163 | </Box> |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 164 | </Box> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 165 | ); |
simon | 1170c32 | 2022-10-31 14:51:31 -0400 | [diff] [blame] | 166 | }; |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 167 | |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 168 | const formatElapsedSeconds = (elapsedSeconds: number): string => { |
| 169 | const seconds = Math.floor(elapsedSeconds % 60); |
| 170 | elapsedSeconds = Math.floor(elapsedSeconds / 60); |
| 171 | const minutes = elapsedSeconds % 60; |
| 172 | elapsedSeconds = Math.floor(elapsedSeconds / 60); |
| 173 | const hours = elapsedSeconds % 24; |
| 174 | |
| 175 | const times: string[] = []; |
| 176 | if (hours > 0) { |
| 177 | times.push(hours.toString().padStart(2, '0')); |
| 178 | } |
| 179 | times.push(minutes.toString().padStart(2, '0')); |
| 180 | times.push(seconds.toString().padStart(2, '0')); |
| 181 | |
| 182 | return times.join(':'); |
| 183 | }; |
| 184 | |
simon | 8b496b0 | 2022-11-29 01:46:46 -0500 | [diff] [blame] | 185 | const CallInterfaceInformation = () => { |
| 186 | const { callStartTime } = useContext(CallContext); |
Gabriel Rochon | 15a5fb2 | 2022-11-27 19:25:14 -0500 | [diff] [blame] | 187 | const { conversation } = useContext(ConversationContext); |
Misha Krieger-Raynauld | d0cc3e3 | 2022-11-29 19:59:31 -0500 | [diff] [blame] | 188 | const [elapsedTime, setElapsedTime] = useState(0); |
Gabriel Rochon | 15a5fb2 | 2022-11-27 19:25:14 -0500 | [diff] [blame] | 189 | const memberName = useMemo(() => conversation.getFirstMember().contact.getRegisteredName(), [conversation]); |
simon | 8b496b0 | 2022-11-29 01:46:46 -0500 | [diff] [blame] | 190 | |
| 191 | useEffect(() => { |
| 192 | if (callStartTime) { |
| 193 | const interval = setInterval(() => { |
Misha Krieger-Raynauld | d0cc3e3 | 2022-11-29 19:59:31 -0500 | [diff] [blame] | 194 | setElapsedTime((Date.now() - callStartTime) / 1000); |
simon | 8b496b0 | 2022-11-29 01:46:46 -0500 | [diff] [blame] | 195 | }, 1000); |
| 196 | return () => clearInterval(interval); |
| 197 | } |
| 198 | }, [callStartTime]); |
| 199 | |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 200 | const elapsedTimerString = formatElapsedSeconds(elapsedTime); |
| 201 | |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 202 | return ( |
| 203 | <Stack direction="row" justifyContent="space-between" alignItems="center"> |
| 204 | <Typography color="white" component="p"> |
Gabriel Rochon | 15a5fb2 | 2022-11-27 19:25:14 -0500 | [diff] [blame] | 205 | {memberName} |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 206 | </Typography> |
| 207 | <Typography color="white" component="p"> |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 208 | {elapsedTimerString} |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 209 | </Typography> |
| 210 | </Stack> |
| 211 | ); |
| 212 | }; |
| 213 | |
| 214 | const CallInterfacePrimaryButtons = () => { |
| 215 | return ( |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 216 | <Card sx={{ backgroundColor: '#00000088', overflow: 'visible' }}> |
| 217 | <Stack direction="row" justifyContent="center" alignItems="center"> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 218 | <CallingMicButton /> |
simon | 9a8fe20 | 2022-11-15 18:25:49 -0500 | [diff] [blame] | 219 | <CallingEndButton /> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 220 | <CallingVideoCameraButton /> |
| 221 | </Stack> |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 222 | </Card> |
| 223 | ); |
| 224 | }; |
| 225 | |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 226 | const SECONDARY_BUTTONS = [ |
| 227 | CallingVolumeButton, |
| 228 | CallingGroupButton, |
| 229 | CallingChatButton, |
| 230 | CallingScreenShareButton, |
| 231 | CallingRecordButton, |
| 232 | CallingExtensionButton, |
| 233 | CallingFullScreenButton, |
| 234 | ]; |
| 235 | |
simon | 492e840 | 2022-11-29 16:48:37 -0500 | [diff] [blame] | 236 | const CallInterfaceSecondaryButtons = (props: Props & { gridItemRef: RefObject<HTMLElement> }) => { |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 237 | const stackRef = useRef<HTMLElement>(null); |
| 238 | |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 239 | const [initialMeasurementDone, setInitialMeasurementDone] = useState(false); |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 240 | const [hiddenStackCount, setHiddenStackCount] = useState(0); |
| 241 | const [hiddenMenuVisible, setHiddenMenuVisible] = useState(false); |
| 242 | |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 243 | const calculateStackCount = useCallback(() => { |
| 244 | if (stackRef?.current && props.gridItemRef?.current) { |
| 245 | const buttonWidth = stackRef.current.children[0].clientWidth; |
| 246 | const availableSpace = props.gridItemRef.current.clientWidth; |
| 247 | let availableButtons = Math.floor((availableSpace - 1) / buttonWidth); |
| 248 | if (availableButtons < SECONDARY_BUTTONS.length) { |
| 249 | availableButtons -= 1; // Leave room for CallingMoreVerticalButton |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 250 | } |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 251 | setHiddenStackCount(SECONDARY_BUTTONS.length - availableButtons); |
| 252 | } |
| 253 | }, [props.gridItemRef]); |
| 254 | |
| 255 | useLayoutEffect(() => { |
| 256 | // Run once, at the beginning, for initial measurements |
| 257 | if (!initialMeasurementDone) { |
| 258 | calculateStackCount(); |
| 259 | setInitialMeasurementDone(true); |
| 260 | } |
| 261 | |
| 262 | const onResize = () => { |
| 263 | calculateStackCount(); |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 264 | }; |
| 265 | window.addEventListener('resize', onResize); |
| 266 | return () => { |
| 267 | window.removeEventListener('resize', onResize); |
| 268 | }; |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 269 | }, [calculateStackCount, initialMeasurementDone]); |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 270 | |
| 271 | const { displayedButtons, hiddenButtons } = useMemo(() => { |
| 272 | const displayedButtons: ComponentType<ExpandableButtonProps>[] = []; |
| 273 | const hiddenButtons: ComponentType<ExpandableButtonProps>[] = []; |
| 274 | SECONDARY_BUTTONS.forEach((button, i) => { |
| 275 | if (i < SECONDARY_BUTTONS.length - hiddenStackCount) { |
| 276 | displayedButtons.push(button); |
| 277 | } else { |
| 278 | hiddenButtons.push(button); |
| 279 | } |
| 280 | }); |
| 281 | |
| 282 | return { |
| 283 | displayedButtons, |
| 284 | hiddenButtons, |
| 285 | }; |
| 286 | }, [hiddenStackCount]); |
| 287 | |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 288 | return ( |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 289 | <Card sx={{ backgroundColor: '#00000088', overflow: 'visible', height: '100%' }}> |
| 290 | <Stack direction="row" justifyContent="center" alignItems="center" height="100%" ref={stackRef}> |
| 291 | {initialMeasurementDone && |
| 292 | displayedButtons.map((SecondaryButton, i) => ( |
| 293 | <Fragment key={i}> |
simon | 9a8fe20 | 2022-11-15 18:25:49 -0500 | [diff] [blame] | 294 | <SecondaryButton /> |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 295 | </Fragment> |
| 296 | ))} |
| 297 | {(!!hiddenButtons.length || !initialMeasurementDone) && ( |
simon | 9a8fe20 | 2022-11-15 18:25:49 -0500 | [diff] [blame] | 298 | <CallingMoreVerticalButton isVertical onClick={() => setHiddenMenuVisible(!hiddenMenuVisible)} /> |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 299 | )} |
| 300 | </Stack> |
| 301 | |
| 302 | {!!hiddenButtons.length && hiddenMenuVisible && ( |
| 303 | <Box sx={{ position: 'absolute', right: 0, bottom: '50px' }}> |
| 304 | <Card sx={{ backgroundColor: '#00000088', overflow: 'visible', justifyContent: 'flex-end' }}> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 305 | <Stack |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 306 | direction="column" |
| 307 | justifyContent="flex-end" |
| 308 | alignItems="flex-end" |
| 309 | sx={{ bottom: 0, right: 0, height: '100%' }} |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 310 | > |
| 311 | {hiddenButtons.map((SecondaryButton, i) => ( |
| 312 | <Fragment key={i}> |
simon | 4e7445c | 2022-11-16 21:18:46 -0500 | [diff] [blame] | 313 | <SecondaryButton isVertical /> |
simon | 33c0618 | 2022-11-02 17:39:31 -0400 | [diff] [blame] | 314 | </Fragment> |
| 315 | ))} |
| 316 | </Stack> |
| 317 | </Card> |
Gabriel Rochon | 8321a0d | 2022-11-06 23:18:36 -0500 | [diff] [blame] | 318 | </Box> |
| 319 | )} |
Gabriel Rochon | e3ec0d2 | 2022-10-08 14:27:03 -0400 | [diff] [blame] | 320 | </Card> |
| 321 | ); |
| 322 | }; |