From e13c0290494bf177d50e3e0b3ec3e520bdec8896 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 20 Jul 2023 02:56:44 -0400 Subject: [PATCH] fix(striker-ui): correct types on FullSize --- striker-ui/components/Display/FullSize.tsx | 20 +------------------- striker-ui/types/FullSize.d.ts | 6 ++++++ 2 files changed, 7 insertions(+), 19 deletions(-) create mode 100644 striker-ui/types/FullSize.d.ts diff --git a/striker-ui/components/Display/FullSize.tsx b/striker-ui/components/Display/FullSize.tsx index 6e6240a9..18256241 100644 --- a/striker-ui/components/Display/FullSize.tsx +++ b/striker-ui/components/Display/FullSize.tsx @@ -2,7 +2,7 @@ import { Close as CloseIcon, Keyboard as KeyboardIcon, } from '@mui/icons-material'; -import { Box, IconButtonProps, Menu, styled, Typography } from '@mui/material'; +import { Box, Menu, styled, Typography } from '@mui/material'; import RFB from '@novnc/novnc/core/rfb'; import dynamic from 'next/dynamic'; import { useState, useEffect, FC, useMemo, useRef, useCallback } from 'react'; @@ -39,22 +39,6 @@ const StyledDiv = styled('div')(() => ({ const VncDisplay = dynamic(() => import('./VncDisplay'), { ssr: false }); -type FullSizeOptionalProps = { - onClickCloseButton?: IconButtonProps['onClick']; -}; - -type FullSizeProps = FullSizeOptionalProps & { - vncReconnectTimerStart: number; - serverUUID: string; - serverName: string | string[] | undefined; -}; - -const FULL_SIZE_DEFAULT_PROPS: Required< - Omit -> & - Pick = { - onClickCloseButton: undefined, -}; // Unit: seconds const DEFAULT_VNC_RECONNECT_TIMER_START = 5; @@ -275,6 +259,4 @@ const FullSize: FC = ({ ); }; -FullSize.defaultProps = FULL_SIZE_DEFAULT_PROPS; - export default FullSize; diff --git a/striker-ui/types/FullSize.d.ts b/striker-ui/types/FullSize.d.ts new file mode 100644 index 00000000..34bbc183 --- /dev/null +++ b/striker-ui/types/FullSize.d.ts @@ -0,0 +1,6 @@ +type FullSizeProps = { + onClickCloseButton?: import('@mui/material').IconButtonProps['onClick']; + serverUUID: string; + serverName: string; + vncReconnectTimerStart?: number; +};