blob: 601f855ca51bb9ee51dcc03e846944321f8e8099 [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 */
simon1170c322022-10-31 14:51:31 -040018import { QuestionMark, RadioButtonChecked, RadioButtonUnchecked } from '@mui/icons-material';
simon33c06182022-11-02 17:39:31 -040019import {
20 Box,
21 ClickAwayListener,
simon492e8402022-11-29 16:48:37 -050022 FormControlLabel,
simon33c06182022-11-02 17:39:31 -040023 IconButton,
24 IconButtonProps,
25 ListItemIcon,
26 ListItemText,
27 Menu,
28 MenuItem,
29 Popper,
30 Radio,
31 RadioGroup,
simon492e8402022-11-29 16:48:37 -050032 RadioGroupProps,
simon33c06182022-11-02 17:39:31 -040033 SvgIconProps,
34} from '@mui/material';
simond47ef9e2022-09-28 22:24:28 -040035import { styled } from '@mui/material/styles';
simon35378692022-10-02 23:25:57 -040036import EmojiPicker, { IEmojiData } from 'emoji-picker-react';
simondaae9102022-12-02 16:51:31 -050037import { ComponentType, MouseEvent, ReactNode, useCallback, useState } from 'react';
simon07b4eb02022-09-29 17:50:26 -040038
simond47ef9e2022-09-28 22:24:28 -040039import {
40 Arrow2Icon,
41 Arrow3Icon,
42 ArrowIcon,
idillonae655dd2022-10-14 18:11:02 -040043 AudioCallIcon,
simond47ef9e2022-09-28 22:24:28 -040044 CameraIcon,
45 CameraInBubbleIcon,
46 CancelIcon,
47 CrossedEyeIcon,
48 CrossIcon,
49 EmojiIcon,
simon33c06182022-11-02 17:39:31 -040050 ExpandLessIcon,
simond47ef9e2022-09-28 22:24:28 -040051 EyeIcon,
52 FolderIcon,
53 InfoIcon,
idillonae655dd2022-10-14 18:11:02 -040054 ListIcon,
simond47ef9e2022-09-28 22:24:28 -040055 MicroInBubbleIcon,
56 PaperClipIcon,
57 PenIcon,
idillonae655dd2022-10-14 18:11:02 -040058 PeopleWithPlusSignIcon,
simond47ef9e2022-09-28 22:24:28 -040059 SaltireIcon,
idillonae655dd2022-10-14 18:11:02 -040060 VideoCallIcon,
simon35378692022-10-02 23:25:57 -040061} from './SvgIcon';
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -040062import CustomTooltip from './Tooltip';
idillon-sfl44b05342022-08-24 15:46:42 -040063
simonf929a362022-11-18 16:53:45 -050064export type ShapedButtonProps = IconButtonProps & {
simon35378692022-10-02 23:25:57 -040065 Icon: ComponentType<SvgIconProps>;
66};
67
simonf929a362022-11-18 16:53:45 -050068export const RoundButton = styled(({ Icon, ...props }: ShapedButtonProps) => (
simond47ef9e2022-09-28 22:24:28 -040069 <IconButton {...props} disableRipple={true}>
70 <Icon fontSize="inherit" />
71 </IconButton>
72))(({ theme }) => ({
73 border: `1px solid ${theme.palette.primary.dark}`,
74 color: theme.palette.primary.dark,
75 fontSize: '15px',
idillonb0ec86a2022-12-06 17:54:55 -050076 background: 'white',
77 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -040078 '&:hover': {
79 background: theme.palette.primary.light,
80 },
81 '&:active': {
82 color: '#FFF',
83 background: theme.palette.primary.dark,
84 },
85 '&.MuiIconButton-sizeSmall': {
86 height: '15px',
87 width: '15px',
88 },
89 '&.MuiIconButton-sizeMedium': {
90 height: '30px',
91 width: '30px',
92 },
93 '&.MuiIconButton-sizeLarge': {
94 height: '53px',
95 width: '53px',
96 },
idillon-sfld5cc7862022-08-25 11:11:34 -040097}));
idillon-sfl44b05342022-08-24 15:46:42 -040098
simon33c06182022-11-02 17:39:31 -040099type ExpandMenuOption = {
100 description: ReactNode;
101 icon?: ReactNode;
102};
103
simon492e8402022-11-29 16:48:37 -0500104export type ExpandMenuRadioOption = RadioGroupProps & {
simon33c06182022-11-02 17:39:31 -0400105 options: {
106 key: string;
107 description: ReactNode;
108 }[];
simon33c06182022-11-02 17:39:31 -0400109};
110
111export type ExpandableButtonProps = IconButtonProps & {
simon9a8fe202022-11-15 18:25:49 -0500112 isVertical?: boolean;
simon571240f2022-11-29 23:59:27 -0500113 expandMenuOnClick?: boolean;
simon33c06182022-11-02 17:39:31 -0400114 Icon?: ComponentType<SvgIconProps>;
115 expandMenuOptions?: (ExpandMenuOption | ExpandMenuRadioOption)[];
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500116 IconButtonComp?: ComponentType<IconButtonProps>;
simon33c06182022-11-02 17:39:31 -0400117};
118
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500119export const ExpandableButton = ({
simon9a8fe202022-11-15 18:25:49 -0500120 isVertical,
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500121 Icon,
simon571240f2022-11-29 23:59:27 -0500122 expandMenuOnClick,
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500123 expandMenuOptions = undefined,
124 IconButtonComp = IconButton,
125 ...props
126}: ExpandableButtonProps) => {
simon33c06182022-11-02 17:39:31 -0400127 const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
128 const handleClose = () => {
129 setAnchorEl(null);
130 };
131
simon33c06182022-11-02 17:39:31 -0400132 return (
simon9a8fe202022-11-15 18:25:49 -0500133 <>
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500134 {expandMenuOptions && (
135 <Menu
136 anchorEl={anchorEl}
137 open={!!anchorEl}
138 onClose={handleClose}
139 anchorOrigin={{
simon9a8fe202022-11-15 18:25:49 -0500140 vertical: !isVertical ? 'top' : 'center',
141 horizontal: !isVertical ? 'center' : 'left',
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500142 }}
143 transformOrigin={{
simon9a8fe202022-11-15 18:25:49 -0500144 vertical: !isVertical ? 'bottom' : 'center',
145 horizontal: !isVertical ? 'center' : 'right',
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500146 }}
147 >
148 {expandMenuOptions?.map((option, id) => {
149 if ('options' in option) {
simon492e8402022-11-29 16:48:37 -0500150 const { options, ...radioGroupProps } = option;
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500151 return (
simon492e8402022-11-29 16:48:37 -0500152 <RadioGroup key={id} {...radioGroupProps}>
153 {options.map(({ description, key }, i) => (
154 <MenuItem key={i}>
155 <FormControlLabel
156 value={key}
157 control={<Radio value={key} />}
158 label={<ListItemText>{description}</ListItemText>}
159 sx={{
160 width: '100%',
161 }}
162 />
163 </MenuItem>
164 ))}
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500165 </RadioGroup>
166 );
167 }
simon33c06182022-11-02 17:39:31 -0400168
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500169 return (
170 <MenuItem key={id} onClick={handleClose}>
171 <ListItemIcon>{option.icon}</ListItemIcon>
172 <ListItemText>{option.description}</ListItemText>
173 </MenuItem>
174 );
175 })}
176 </Menu>
177 )}
simon9a8fe202022-11-15 18:25:49 -0500178 <Box position="relative" display="flex" justifyContent="center" alignItems="center">
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500179 {expandMenuOptions && (
simon33c06182022-11-02 17:39:31 -0400180 <IconButton
simon33c06182022-11-02 17:39:31 -0400181 aria-label="expand options"
simon9a8fe202022-11-15 18:25:49 -0500182 onClick={(e) => setAnchorEl(e.currentTarget)}
simon33c06182022-11-02 17:39:31 -0400183 sx={{
simon9a8fe202022-11-15 18:25:49 -0500184 rotate: !isVertical ? '' : '-90deg',
simon33c06182022-11-02 17:39:31 -0400185 position: 'absolute',
simon9a8fe202022-11-15 18:25:49 -0500186 top: !isVertical ? '-55%' : 'auto',
187 left: !isVertical ? 'auto' : '-55%',
188 zIndex: 1,
simon33c06182022-11-02 17:39:31 -0400189 }}
simon9a8fe202022-11-15 18:25:49 -0500190 className={props.className}
simon33c06182022-11-02 17:39:31 -0400191 >
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500192 <ExpandLessIcon
simon9a8fe202022-11-15 18:25:49 -0500193 fontSize="small"
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500194 sx={{
195 backgroundColor: '#444444',
196 borderRadius: '5px',
197 }}
198 />
simon33c06182022-11-02 17:39:31 -0400199 </IconButton>
200 )}
simon571240f2022-11-29 23:59:27 -0500201 <IconButtonComp
202 onClick={
203 expandMenuOnClick
204 ? (event) => {
205 setAnchorEl(event.currentTarget);
206 }
207 : undefined
208 }
209 {...props}
210 >
211 {Icon && <Icon />}
212 </IconButtonComp>
simon33c06182022-11-02 17:39:31 -0400213 </Box>
simon9a8fe202022-11-15 18:25:49 -0500214 </>
simon33c06182022-11-02 17:39:31 -0400215 );
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500216};
simon33c06182022-11-02 17:39:31 -0400217
simon35378692022-10-02 23:25:57 -0400218export const CancelPictureButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400219 return <RoundButton {...props} aria-label="remove picture" Icon={CancelIcon} size="large" />;
220};
idillon-sfl44b05342022-08-24 15:46:42 -0400221
simon35378692022-10-02 23:25:57 -0400222export const EditPictureButton = (props: IconButtonProps) => {
idillonb0ec86a2022-12-06 17:54:55 -0500223 return <RoundButton {...props} aria-label="edit picture" Icon={PenIcon} size="medium" />;
simond47ef9e2022-09-28 22:24:28 -0400224};
idillon-sfl44b05342022-08-24 15:46:42 -0400225
simon35378692022-10-02 23:25:57 -0400226export const UploadPictureButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400227 return <RoundButton {...props} aria-label="upload picture" Icon={FolderIcon} size="large" />;
228};
idillon-sfl44b05342022-08-24 15:46:42 -0400229
simon35378692022-10-02 23:25:57 -0400230export const TakePictureButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400231 return <RoundButton {...props} aria-label="take picture" Icon={CameraIcon} size="large" />;
232};
idillon-sfl37c18df2022-08-26 18:44:27 -0400233
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -0400234type InfoButtonProps = IconButtonProps & {
235 tooltipTitle: string;
236};
237export const InfoButton = ({ tooltipTitle, ...props }: InfoButtonProps) => {
238 return (
239 <CustomTooltip className="tooltip" title={tooltipTitle}>
240 <RoundButton {...props} aria-label="informations" Icon={InfoIcon} size="small" />
241 </CustomTooltip>
242 );
simond47ef9e2022-09-28 22:24:28 -0400243};
idillon-sfl37c18df2022-08-26 18:44:27 -0400244
simon35378692022-10-02 23:25:57 -0400245export const TipButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400246 return <RoundButton {...props} aria-label="tip" Icon={QuestionMark} size="medium" />;
247};
idillon-sfl37c18df2022-08-26 18:44:27 -0400248
simon35378692022-10-02 23:25:57 -0400249export const MoreButton = styled((props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400250 return (
251 <IconButton {...props} disableRipple={true} aria-label="more">
252 <CrossIcon fontSize="inherit" />
253 </IconButton>
254 );
255})(({ theme }) => ({
256 border: `1px solid ${theme.palette.primary.dark}`,
257 color: theme.palette.primary.dark,
258 fontSize: '10px',
259 height: '20px',
260 width: '20px',
261 '&:hover': {
262 background: theme.palette.primary.light,
263 },
264 '&:active': {
265 color: '#FFF',
266 background: theme.palette.primary.dark,
267 },
268}));
idillon927b7592022-09-15 12:56:45 -0400269
simon35378692022-10-02 23:25:57 -0400270export const BackButton = styled((props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400271 return (
272 <IconButton {...props} disableRipple={true} aria-label="back">
273 <ArrowIcon fontSize="inherit" />
274 </IconButton>
275 );
276})(({ theme }) => ({
277 color: theme.palette.primary.dark,
278 fontSize: '15px',
279 height: '30px',
280 width: '51px',
281 borderRadius: '5px',
282 '&:hover': {
283 background: theme.palette.primary.light,
284 },
285}));
idillonb3788bf2022-08-29 15:57:57 -0400286
simon1170c322022-10-31 14:51:31 -0400287export type ToggleIconButtonProps = IconButtonProps & {
288 selected: boolean;
289 toggle: () => void;
290 IconOn?: ComponentType<SvgIconProps>;
291 IconOff?: ComponentType<SvgIconProps>;
Gabriel Rochone3ec0d22022-10-08 14:27:03 -0400292};
simon33c06182022-11-02 17:39:31 -0400293
simon1170c322022-10-31 14:51:31 -0400294export const ToggleIconButton = ({
295 IconOn = RadioButtonChecked,
296 IconOff = RadioButtonUnchecked,
297 selected,
298 toggle,
299 ...props
300}: ToggleIconButtonProps) => {
Gabriel Rochone3ec0d22022-10-08 14:27:03 -0400301 return (
simon1170c322022-10-31 14:51:31 -0400302 <IconButton
303 {...props}
Gabriel Rochon8321a0d2022-11-06 23:18:36 -0500304 sx={{
305 color: selected ? 'white' : 'red',
306 ...props.sx,
307 }}
simon1170c322022-10-31 14:51:31 -0400308 onClick={() => {
309 toggle();
310 }}
311 >
312 {selected ? <IconOn /> : <IconOff />}
Gabriel Rochone3ec0d22022-10-08 14:27:03 -0400313 </IconButton>
314 );
315};
316
simon35378692022-10-02 23:25:57 -0400317export const CloseButton = styled((props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400318 return (
319 <IconButton {...props} disableRipple={true} aria-label="close">
320 <SaltireIcon fontSize="inherit" />
321 </IconButton>
322 );
323})(({ theme }) => ({
324 color: theme.palette.primary.dark,
325 fontSize: '15px',
326 height: '30px',
327 width: '30px',
328 borderRadius: '5px',
329 '&:hover': {
330 background: theme.palette.primary.light,
331 },
332}));
idillonb3788bf2022-08-29 15:57:57 -0400333
simon35378692022-10-02 23:25:57 -0400334type ToggleVisibilityButtonProps = IconButtonProps & {
335 visible: boolean;
336};
337export const ToggleVisibilityButton = styled(({ visible, ...props }: ToggleVisibilityButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400338 const Icon = visible ? CrossedEyeIcon : EyeIcon;
339 return (
340 <IconButton {...props} disableRipple={true}>
341 <Icon fontSize="inherit" />
342 </IconButton>
343 );
344})(({ theme }) => ({
345 color: theme.palette.primary.dark,
346 fontSize: '15px',
347 height: '15px',
348 width: '15px',
349 '&:hover': {
350 background: theme.palette.primary.light,
351 },
352}));
idillonaedab942022-09-01 14:29:43 -0400353
simon35378692022-10-02 23:25:57 -0400354const SquareButton = styled(({ Icon, ...props }: ShapedButtonProps) => (
simond47ef9e2022-09-28 22:24:28 -0400355 <IconButton {...props} disableRipple={true}>
356 <Icon fontSize="inherit" />
357 </IconButton>
simon416d0792022-11-03 02:46:18 -0400358))(() => ({
simond47ef9e2022-09-28 22:24:28 -0400359 color: '#7E7E7E',
360 fontSize: '25px',
361 height: '36px',
362 width: '36px',
363 borderRadius: '5px',
364 '&:hover': {
365 background: '#E5E5E5',
366 },
idillonaedab942022-09-01 14:29:43 -0400367}));
368
idillonae655dd2022-10-14 18:11:02 -0400369export const AddParticipantButton = (props: IconButtonProps) => {
370 return <SquareButton {...props} aria-label="add participant" Icon={PeopleWithPlusSignIcon} />;
371};
372
simon35378692022-10-02 23:25:57 -0400373export const RecordVideoMessageButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400374 return <SquareButton {...props} aria-label="record video message" Icon={CameraInBubbleIcon} />;
375};
idillonaedab942022-09-01 14:29:43 -0400376
simon35378692022-10-02 23:25:57 -0400377export const RecordVoiceMessageButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400378 return <SquareButton {...props} aria-label="record voice message" Icon={MicroInBubbleIcon} />;
379};
idillonaedab942022-09-01 14:29:43 -0400380
idillonae655dd2022-10-14 18:11:02 -0400381export const ShowOptionsMenuButton = (props: IconButtonProps) => {
382 return <SquareButton {...props} aria-label="show options menu" Icon={ListIcon} />;
383};
384
385export const StartVideoCallButton = (props: IconButtonProps) => {
simoncd698c52022-11-08 19:21:38 -0500386 return <SquareButton {...props} aria-label="start audio call" Icon={VideoCallIcon} />;
idillonae655dd2022-10-14 18:11:02 -0400387};
388
389export const StartAudioCallButton = (props: IconButtonProps) => {
simoncd698c52022-11-08 19:21:38 -0500390 return <SquareButton {...props} aria-label="start video call" Icon={AudioCallIcon} />;
idillonae655dd2022-10-14 18:11:02 -0400391};
392
simon35378692022-10-02 23:25:57 -0400393export const UploadFileButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400394 return <SquareButton {...props} aria-label="upload file" Icon={PaperClipIcon} />;
395};
idillonaedab942022-09-01 14:29:43 -0400396
simon35378692022-10-02 23:25:57 -0400397export const SendMessageButton = (props: IconButtonProps) => {
simond47ef9e2022-09-28 22:24:28 -0400398 return <SquareButton {...props} aria-label="send message" Icon={Arrow2Icon} />;
399};
idillonaedab942022-09-01 14:29:43 -0400400
simon35378692022-10-02 23:25:57 -0400401export const ReplyMessageButton = styled((props: IconButtonProps) => (
simond47ef9e2022-09-28 22:24:28 -0400402 <IconButton {...props} disableRipple={true} aria-label="send message">
403 <Arrow3Icon fontSize="inherit" />
404 </IconButton>
405))(({ theme }) => ({
406 color: theme.palette.primary.dark,
407 fontSize: '20px',
408 height: '20px',
409 width: '20px',
410 borderRadius: '5px',
411 '&:hover': {
412 background: '#E5E5E5',
413 },
idillon927b7592022-09-15 12:56:45 -0400414}));
415
simon35378692022-10-02 23:25:57 -0400416type EmojiButtonProps = IconButtonProps & {
417 emoji: string;
418};
419export const EmojiButton = styled(({ emoji, ...props }: EmojiButtonProps) => (
simond47ef9e2022-09-28 22:24:28 -0400420 <IconButton {...props} disableRipple={true}>
421 {emoji}
422 </IconButton>
simon416d0792022-11-03 02:46:18 -0400423))(() => ({
simond47ef9e2022-09-28 22:24:28 -0400424 color: 'white',
425 fontSize: '20px',
426 height: '20px',
427 width: '20px',
idillon927b7592022-09-15 12:56:45 -0400428}));
429
simon35378692022-10-02 23:25:57 -0400430type SelectEmojiButtonProps = {
431 onEmojiSelected: (emoji: string) => void;
432};
simon416d0792022-11-03 02:46:18 -0400433export const SelectEmojiButton = ({ onEmojiSelected }: SelectEmojiButtonProps) => {
simon35378692022-10-02 23:25:57 -0400434 const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
idillon1664bb22022-09-14 17:18:15 -0400435
simon35378692022-10-02 23:25:57 -0400436 const handleOpenEmojiPicker = useCallback(
437 (e: MouseEvent<HTMLButtonElement>) => setAnchorEl(anchorEl ? null : e.currentTarget),
438 [anchorEl]
439 );
simond47ef9e2022-09-28 22:24:28 -0400440
441 const handleClose = useCallback(() => setAnchorEl(null), [setAnchorEl]);
442
443 const onEmojiClick = useCallback(
simon35378692022-10-02 23:25:57 -0400444 (e: MouseEvent, emojiObject: IEmojiData) => {
simon80b7b3b2022-09-28 17:50:10 -0400445 onEmojiSelected(emojiObject.emoji);
simond47ef9e2022-09-28 22:24:28 -0400446 handleClose();
447 },
simon80b7b3b2022-09-28 17:50:10 -0400448 [handleClose, onEmojiSelected]
simond47ef9e2022-09-28 22:24:28 -0400449 );
450
451 const open = Boolean(anchorEl);
452 const id = open ? 'simple-popover' : undefined;
453
454 return (
455 <ClickAwayListener onClickAway={handleClose}>
456 <Box>
idillonae655dd2022-10-14 18:11:02 -0400457 <SquareButton
458 aria-describedby={id}
459 aria-label="select emoji"
460 Icon={EmojiIcon}
461 onClick={handleOpenEmojiPicker}
462 />
simon35378692022-10-02 23:25:57 -0400463 <Popper id={id} open={open} anchorEl={anchorEl}>
464 <EmojiPicker onEmojiClick={onEmojiClick} disableAutoFocus={true} disableSkinTonePicker={true} native />
simond47ef9e2022-09-28 22:24:28 -0400465 </Popper>
466 </Box>
467 </ClickAwayListener>
468 );
469};
idillonb0ec86a2022-12-06 17:54:55 -0500470
471const RecordButtonSize = '50px';
472const RecordButtonOutlineWidth = '1px';
473const RecordButtonOutlineOffset = '4px';
474const RecordButtonInnerSize =
475 parseInt(RecordButtonSize) - parseInt(RecordButtonOutlineWidth) * 2 - parseInt(RecordButtonOutlineOffset) * 2 + 'px';
476export const RecordButton = styled((props: IconButtonProps) => (
477 <IconButton {...props} disableRipple={true}>
478 <Box
479 sx={{
480 width: RecordButtonInnerSize,
481 height: RecordButtonInnerSize,
482 borderRadius: '100%',
483 outline: `${RecordButtonOutlineWidth} solid #e57f90`,
484 outlineOffset: RecordButtonOutlineOffset,
485 backgroundColor: '#e57f90',
486 '&:hover': {
487 outlineColor: '#cc0022',
488 backgroundColor: '#cc0022',
489 },
490 }}
491 />
492 </IconButton>
493))({
494 width: RecordButtonSize,
495 height: RecordButtonSize,
496 padding: 0,
497});
498
499export const CornerCloseButton = styled(({ ...props }: IconButtonProps) => (
500 <IconButton {...props}>
501 <SaltireIcon fontSize="inherit" />
502 </IconButton>
503))({
504 position: 'absolute',
505 top: '20px',
506 right: '20px',
507 zIndex: 200,
508 color: 'white',
509 fontSize: '10px',
510});